android-emulator-webrtc 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,449 +44,588 @@ import "google/protobuf/empty.proto";
44
44
  // sendXXX --> send a single event XXX, possibly returning state information.
45
45
  // android usually responds to these events.
46
46
  service EmulatorController {
47
- // set/get/stream the sensor data
48
- rpc streamSensor(SensorValue) returns (stream SensorValue) {}
49
- rpc getSensor(SensorValue) returns (SensorValue) {}
50
- rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
51
-
52
- // set/get/stream the physical model, this is likely the one you are
53
- // looking for when you wish to modify the device state.
54
- rpc setPhysicalModel(PhysicalModelValue) returns (google.protobuf.Empty) {}
55
- rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
56
- rpc streamPhysicalModel(PhysicalModelValue)
57
- returns (stream PhysicalModelValue) {}
58
-
59
- // Atomically set/get the current primary clipboard data.
60
- rpc setClipboard(ClipData) returns (google.protobuf.Empty) {}
61
- rpc getClipboard(google.protobuf.Empty) returns (ClipData) {}
62
-
63
- // Streams the current data on the clipboard. This will immediately produce
64
- // a result with the current state of the clipboard after which the stream
65
- // will block and wait until a new clip event is available from the guest.
66
- // Calling the setClipboard method above will not result in generating a clip
67
- // event. It is possible to lose clipboard events if the clipboard updates
68
- // very rapidly.
69
- rpc streamClipboard(google.protobuf.Empty) returns (stream ClipData) {}
70
-
71
- // Set/get the battery to the given state.
72
- rpc setBattery(BatteryState) returns (google.protobuf.Empty) {}
73
- rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
74
-
75
- // Set the state of the gps, gps support will only work
76
- // properly if:
77
- //
78
- // - no location ui is active. That is the emulator
79
- // is launched in headless mode (-no-window) or the location
80
- // ui is disabled (-no-location-ui).
81
- // - the passiveUpdate is set to false. Setting this to false
82
- // will disable/break the LocationUI.
83
- //
84
- // Keep in mind that android usually only samples the gps at 1 hz.
85
- rpc setGps(GpsState) returns (google.protobuf.Empty) {}
86
-
87
- // Gets the latest gps state as delivered by the setGps call, or location ui
88
- // if active.
89
- //
90
- // Note: this is not necessarily the actual gps coordinate visible at the
91
- // time, due to gps sample frequency (usually 1hz).
92
- rpc getGps(google.protobuf.Empty) returns (GpsState) {}
93
-
94
- // Simulate a touch event on the finger print sensor.
95
- rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
96
-
97
- // Send a keyboard event. Translating the event.
98
- rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
99
-
100
- // Send touch/mouse events. Note that mouse events can be simulated
101
- // by touch events.
102
- rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
103
- rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
104
-
105
- // Make a phone call.
106
- rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
107
-
108
- // Sends an sms message to the emulator.
109
- rpc sendSms(SmsMessage) returns (PhoneResponse) {}
110
-
111
- // Retrieve the status of the emulator. This will contain general
112
- // hardware information, and whether the device has booted or not.
113
- rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
114
-
115
- // Gets an individual screenshot in the desired format.
116
- //
117
- // The image will be scaled to the desired ImageFormat, while maintaining
118
- // the aspect ratio. The returned image will never exceed the provided width
119
- // and height. Not setting the width or height (i.e. they are 0) will result
120
- // in using the device width and height.
121
- //
122
- // The resulting image will be properly oriented and can be displayed
123
- // directly without post processing. For example, if the device has a
124
- // 1080x1920 screen and is in landscape mode and called with no width or
125
- // height parameter, it will return an 1920x1080 image.
126
- //
127
- // This method will return an empty image if the display is not visible.
128
- rpc getScreenshot(ImageFormat) returns (Image) {}
129
-
130
- // Streams a series of screenshots in the desired format.
131
- // A new frame will be delivered whenever the device produces a new frame.
132
- // (Beware that this can produce a significant amount of data, and that
133
- // certain translations are (png transform) can be costly).
134
- //
135
- // If the requested display is not visible it will send a single empty image
136
- // and wait start producing images once the display becomes active, again
137
- // producing a single empty image when the display becomes inactive.
138
- rpc streamScreenshot(ImageFormat) returns (stream Image) {}
139
-
140
- // Streams a series of audio packets in the desired format.
141
- // A new frame will be delivered whenever the emulated device
142
- // produces a new audio frame.
143
- rpc streamAudio(AudioFormat) returns (stream AudioPacket) {}
144
-
145
- // Returns the last 128Kb of logcat output from the emulator
146
- // Note that parsed logcat messages are only available after L (Api >23).
147
- // it is possible that the logcat buffer gets overwritten, or falls behind.
148
- rpc getLogcat(LogMessage) returns (LogMessage) {}
149
-
150
- // Streams the logcat output from the emulator. The first call
151
- // can retrieve up to 128Kb. This call will not return.
152
- // Note that parsed logcat messages are only available after L (Api >23)
153
- // it is possible that the logcat buffer gets overwritten, or falls behind.
154
- rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
155
-
156
- // Transition the virtual machine to the desired state. Note that
157
- // some states are only observable. For example you cannot transition
158
- // to the error state.
159
- rpc setVmState(VmRunState) returns (google.protobuf.Empty) {}
160
-
161
- // Gets the state of the virtual machine.
162
- rpc getVmState(google.protobuf.Empty) returns (VmRunState) {}
163
-
164
- // Atomically changes the current multi-display configuration.
165
- // After this call the given display configurations will be activated. You
166
- // can only update secondary displays. Displays with id 0 will be ignored.
167
- //
168
- // This call can result in the removal or addition of secondary displays, the final
169
- // display state can be observed by the returned configuration.
170
- //
171
- // The following gRPC error codes can be returned:
172
- // - unimplemented (code 14) if the AVD does NOT support a configurable secondary display.
173
- // - aborted (code 10) if:
174
- // - The same display id is defined multiple times.
175
- // - The display configurations are outside valid ranges
176
- // (see DisplayConfiguration)
177
- // - Internal emulator failure.
178
- rpc setDisplayConfigurations(DisplayConfigurations)
179
- returns (DisplayConfigurations) {}
180
-
181
- // Returns all currently valid logical displays.
182
- rpc getDisplayConfigurations(google.protobuf.Empty)
183
- returns (DisplayConfigurations) {}
184
-
185
- // Notifies client of the following changes:
186
- //
187
- // - Virtual scene camera status change.
188
- // - Display configuration changes from extended ui. This will only be fired
189
- // if the user makes modifications the extended displays through the extended
190
- // control tab.
191
- //
192
- // Note that this method will send the initial virtual scene state immediately.
193
- rpc streamNotification(google.protobuf.Empty) returns (stream Notification) {}
194
-
47
+ // set/get/stream the sensor data
48
+ rpc streamSensor(SensorValue) returns (stream SensorValue) {}
49
+ rpc getSensor(SensorValue) returns (SensorValue) {}
50
+ rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
51
+
52
+ // set/get/stream the physical model, this is likely the one you are
53
+ // looking for when you wish to modify the device state.
54
+ rpc setPhysicalModel(PhysicalModelValue) returns (google.protobuf.Empty) {}
55
+ rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
56
+ rpc streamPhysicalModel(PhysicalModelValue)
57
+ returns (stream PhysicalModelValue) {}
58
+
59
+ // Atomically set/get the current primary clipboard data.
60
+ rpc setClipboard(ClipData) returns (google.protobuf.Empty) {}
61
+ rpc getClipboard(google.protobuf.Empty) returns (ClipData) {}
62
+
63
+ // Streams the current data on the clipboard. This will immediately produce
64
+ // a result with the current state of the clipboard after which the stream
65
+ // will block and wait until a new clip event is available from the guest.
66
+ // Calling the setClipboard method above will not result in generating a
67
+ // clip event. It is possible to lose clipboard events if the clipboard
68
+ // updates very rapidly.
69
+ rpc streamClipboard(google.protobuf.Empty) returns (stream ClipData) {}
70
+
71
+ // Set/get the battery to the given state.
72
+ rpc setBattery(BatteryState) returns (google.protobuf.Empty) {}
73
+ rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
74
+
75
+ // Set the state of the gps.
76
+ // Note: Setting the gps position will not be reflected in the user
77
+ // interface. Keep in mind that android usually only samples the gps at 1
78
+ // hz.
79
+ rpc setGps(GpsState) returns (google.protobuf.Empty) {}
80
+
81
+ // Gets the latest gps state as delivered by the setGps call, or location ui
82
+ // if active.
83
+ //
84
+ // Note: this is not necessarily the actual gps coordinate visible at the
85
+ // time, due to gps sample frequency (usually 1hz).
86
+ rpc getGps(google.protobuf.Empty) returns (GpsState) {}
87
+
88
+ // Simulate a touch event on the finger print sensor.
89
+ rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
90
+
91
+ // Send a keyboard event. Translating the event.
92
+ rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
93
+
94
+ // Send touch/mouse events. Note that mouse events can be simulated
95
+ // by touch events.
96
+ rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
97
+ rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
98
+ rpc injectWheel(stream WheelEvent) returns (google.protobuf.Empty) {}
99
+
100
+ // Make a phone call.
101
+ rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
102
+
103
+ // Sends an sms message to the emulator.
104
+ rpc sendSms(SmsMessage) returns (PhoneResponse) {}
105
+
106
+ // Sends an sms message to the emulator.
107
+ rpc setPhoneNumber(PhoneNumber) returns (PhoneResponse) {}
108
+
109
+ // Retrieve the status of the emulator. This will contain general
110
+ // hardware information, and whether the device has booted or not.
111
+ rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
112
+
113
+ // Gets an individual screenshot in the desired format.
114
+ //
115
+ // The image will be scaled to the desired ImageFormat, while maintaining
116
+ // the aspect ratio. The returned image will never exceed resolution of the
117
+ // device display. Not setting the width or height (i.e. they are 0) will
118
+ // result in using the display width and height.
119
+ //
120
+ // The resulting image will be properly oriented and can be displayed
121
+ // directly without post processing. For example, if the device has a
122
+ // 1080x1920 screen and is in landscape mode and called with no width or
123
+ // height parameter, it will return a 1920x1080 image.
124
+ //
125
+ // The dimensions of the returned image will never exceed the corresponding
126
+ // display dimensions. For example, this method will return a 1920x1080
127
+ // screenshot, if the display resolution is 1080x1920 and a screenshot of
128
+ // 2048x2048 is requested when the device is in landscape mode.
129
+ //
130
+ // This method will return an empty image if the display is not visible.
131
+ rpc getScreenshot(ImageFormat) returns (Image) {}
132
+
133
+ // Streams a series of screenshots in the desired format.
134
+ //
135
+ // A new frame will be delivered whenever the device produces a new frame.
136
+ // Beware that this can produce a significant amount of data and that
137
+ // certain translations can be very costly. For example, streaming a series
138
+ // of png images is very cpu intensive.
139
+ //
140
+ // Images are produced according to the getScreenshot API described above.
141
+ //
142
+ // If the display is inactive, or becomes inactive, an empty image will be
143
+ // delivered. Images will be delived again if the display becomes active and
144
+ // new frames are produced.
145
+ rpc streamScreenshot(ImageFormat) returns (stream Image) {}
146
+
147
+ // Streams a series of audio packets in the desired format.
148
+ // A new frame will be delivered whenever the emulated device
149
+ // produces a new audio frame. You can expect packets to be
150
+ // delivered in intervals of 20-30ms.
151
+ //
152
+ // Be aware that this can block when the emulator does not
153
+ // produce any audio whatsoever!
154
+ rpc streamAudio(AudioFormat) returns (stream AudioPacket) {}
155
+
156
+ // Injects a series of audio packets to the android microphone.
157
+ // A new frame will be delivered whenever the emulated device
158
+ // requests a new audio frame. Audio is usually delivered at a rate
159
+ // that the emulator is requesting frames. Audio will be stored in a
160
+ // temporary buffer that can hold 300ms of audio.
161
+ //
162
+ // Notes:
163
+ // - Only the first audio format packet that is delivered will be
164
+ // honored. There is no need to send the audio format multiple times.
165
+ // - Real time audio currently immediately overrides the buffer. This
166
+ // means you must provide a constant rate of audio packets. The real
167
+ // time mode is experimental. Timestamps of audio packets might be
168
+ // used in the future to improve synchronization.
169
+ //
170
+ // - INVALID_ARGUMENT (code 3) The sampling rate was too high/low
171
+ // - INVALID_ARGUMENT (code 3) The audio packet was too large to handle.
172
+ // - FAILED_PRECONDITION (code 9) If there was a microphone registered
173
+ // already.
174
+ rpc injectAudio(stream AudioPacket) returns (google.protobuf.Empty) {}
175
+
176
+ // Returns the last 128Kb of logcat output from the emulator
177
+ // Note that parsed logcat messages are only available after L (Api >23).
178
+ // it is possible that the logcat buffer gets overwritten, or falls behind.
179
+ rpc getLogcat(LogMessage) returns (LogMessage) {}
180
+
181
+ // Streams the logcat output from the emulator. The first call
182
+ // can retrieve up to 128Kb. This call will not return.
183
+ // Note that parsed logcat messages are only available after L (Api >23)
184
+ // it is possible that the logcat buffer gets overwritten, or falls behind.
185
+ rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
186
+
187
+ // Transition the virtual machine to the desired state. Note that
188
+ // some states are only observable. For example you cannot transition
189
+ // to the error state.
190
+ rpc setVmState(VmRunState) returns (google.protobuf.Empty) {}
191
+
192
+ // Gets the state of the virtual machine.
193
+ rpc getVmState(google.protobuf.Empty) returns (VmRunState) {}
194
+
195
+ // Atomically changes the current multi-display configuration.
196
+ // After this call the given display configurations will be activated. You
197
+ // can only update secondary displays. Displays with id 0 will be ignored.
198
+ //
199
+ // This call can result in the removal or addition of secondary displays,
200
+ // the final display state can be observed by the returned configuration.
201
+ //
202
+ // The following gRPC error codes can be returned:
203
+ // - FAILED_PRECONDITION (code 9) if the AVD does not support a
204
+ // configurable
205
+ // secondary display.
206
+ // - INVALID_ARGUMENT (code 3) if:
207
+ // - The same display id is defined multiple times.
208
+ // - The display configurations are outside valid ranges.
209
+ // See DisplayConfiguration for details on valid ranges.
210
+ // - INTERNAL (code 13) if there was an internal emulator failure.
211
+ rpc setDisplayConfigurations(DisplayConfigurations)
212
+ returns (DisplayConfigurations) {}
213
+
214
+ // Returns all currently valid logical displays.
215
+ //
216
+ // The gRPC error code FAILED_PRECONDITION (code 9) is returned if the AVD
217
+ // does not support a configurable secondary display.
218
+ rpc getDisplayConfigurations(google.protobuf.Empty)
219
+ returns (DisplayConfigurations) {}
220
+
221
+ // Notifies client of the following changes:
222
+ //
223
+ // - Virtual scene camera status change.
224
+ // - Display configuration changes from extended ui. This will only be fired
225
+ // if the user makes modifications the extended displays through the
226
+ // extended control tab.
227
+ //
228
+ // Note that this method will send the initial virtual scene state
229
+ // immediately.
230
+ rpc streamNotification(google.protobuf.Empty)
231
+ returns (stream Notification) {}
232
+
233
+ // RotationRadian is relative to the camera's current orientation.
234
+ rpc rotateVirtualSceneCamera(RotationRadian)
235
+ returns (google.protobuf.Empty) {}
236
+ // Velocity is absolute
237
+ rpc setVirtualSceneCameraVelocity(Velocity)
238
+ returns (google.protobuf.Empty) {}
239
+ // Set foldable posture
240
+ rpc setPosture(Posture) returns (google.protobuf.Empty) {}
241
+
242
+ // Get the backlight brightness.
243
+ // The following gRPC error codes can be returned:
244
+ // - FAILED_PRECONDITION (code 9) if the AVD does not support hw-control.
245
+ rpc getBrightness(BrightnessValue) returns (BrightnessValue) {}
246
+
247
+ // Set the backlight brightness.
248
+ // The following gRPC error codes can be returned:
249
+ // - FAILED_PRECONDITION (code 9) if the AVD does not support hw-control.
250
+ // - INVALID_ARGUMENT (code 3) The brightness exceeds the valid range.
251
+ rpc setBrightness(BrightnessValue) returns (google.protobuf.Empty) {}
252
+
253
+ // Returns the current mode of the primary display of a resizable AVD.
254
+ // The following gRPC error codes can be returned:
255
+ // - FAILED_PRECONDITION (code 9) if the AVD is not resizable.
256
+ rpc getDisplayMode(google.protobuf.Empty) returns (DisplayMode) {}
257
+
258
+ // Sets the size of the primary display of a resizable AVD. Fails if the AVD
259
+ // is not resizable. The following gRPC error codes can be returned:
260
+ // - FAILED_PRECONDITION (code 9) if the AVD is not resizable.
261
+ rpc setDisplayMode(DisplayMode) returns (google.protobuf.Empty) {}
195
262
  }
196
263
 
197
264
  // A Run State that describes the state of the Virtual Machine.
198
265
  message VmRunState {
199
- enum RunState {
200
- // The emulator is in an unknown state. You cannot transition to this state.
201
- UNKNOWN = 0;
202
- // Guest is actively running. You can transition to this state from the
203
- // paused state.
204
- RUNNING = 1;
205
- // Guest is paused to load a snapshot. You cannot transition to this state.
206
- RESTORE_VM = 2;
207
- // Guest has been paused. Transitioning to this state will pause the
208
- // emulator the guest will not be consuming any cpu cycles.
209
- PAUSED = 3;
210
- // Guest is paused to take or export a snapshot. You cannot
211
- // transition to this state.
212
- SAVE_VM = 4;
213
- // System shutdown, note that it is similar to power off. It tries to set
214
- // the system status and notify guest. The system is likely going to
215
- // disappear soon and do proper cleanup of resources, possibly taking
216
- // a snapshot. This is the same behavior as closing the emulator by clicking
217
- // the X (close) in the user interface.
218
- SHUTDOWN = 5;
219
- // Immediately terminate the emulator. No resource cleanup will take place.
220
- // There is a good change to corrupt the system.
221
- TERMINATE = 7;
222
- // Will cause the emulator to reset. This is not a state you can observe.
223
- RESET = 9;
224
- // Guest experienced some error state, you cannot transition to this state.
225
- INTERNAL_ERROR = 10;
226
- }
227
-
228
- RunState state = 1;
229
- }
230
-
231
- message ParameterValue { repeated float data = 1 [ packed = true ]; }
266
+ enum RunState {
267
+ // The emulator is in an unknown state. You cannot transition to this
268
+ // state.
269
+ UNKNOWN = 0;
270
+ // Guest is actively running. You can transition to this state from the
271
+ // paused state.
272
+ RUNNING = 1;
273
+ // Guest is paused to load a snapshot. You cannot transition to this
274
+ // state.
275
+ RESTORE_VM = 2;
276
+ // Guest has been paused. Transitioning to this state will pause the
277
+ // emulator the guest will not be consuming any cpu cycles.
278
+ PAUSED = 3;
279
+ // Guest is paused to take or export a snapshot. You cannot
280
+ // transition to this state.
281
+ SAVE_VM = 4;
282
+ // System shutdown, note that it is similar to power off. It tries to
283
+ // set the system status and notify guest. The system is likely going to
284
+ // disappear soon and do proper cleanup of resources, possibly taking
285
+ // a snapshot. This is the same behavior as closing the emulator by
286
+ // clicking the X (close) in the user interface.
287
+ SHUTDOWN = 5;
288
+ // Immediately terminate the emulator. No resource cleanup will take
289
+ // place. There is a good change to corrupt the system.
290
+ TERMINATE = 7;
291
+ // Will cause the emulator to reset. This is not a state you can
292
+ // observe.
293
+ RESET = 9;
294
+ // Guest experienced some error state, you cannot transition to this
295
+ // state.
296
+ INTERNAL_ERROR = 10;
297
+ }
298
+
299
+ RunState state = 1;
300
+ }
301
+
302
+ message ParameterValue {
303
+ repeated float data = 1 [packed = true];
304
+ }
232
305
 
233
306
  message PhysicalModelValue {
234
- enum State {
235
- OK = 0;
236
- NO_SERVICE = -3; // qemud service is not available/initiated.
237
- DISABLED = -2; // Sensor is disabled.
238
- UNKNOWN = -1; // Unknown sensor (should not happen)
239
- }
307
+ enum State {
308
+ OK = 0;
309
+ NO_SERVICE = -3; // qemud service is not available/initiated.
310
+ DISABLED = -2; // Sensor is disabled.
311
+ UNKNOWN = -1; // Unknown sensor (should not happen)
312
+ }
313
+
314
+ // Details on the sensors documentation can be found here:
315
+ // https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_
316
+ // The types must follow the order defined in
317
+ // "external/qemu/android/hw-sensors.h"
318
+ enum PhysicalType {
319
+ POSITION = 0;
320
+
321
+ // All values are angles in degrees.
322
+ // values = [x,y,z]
323
+ ROTATION = 1;
324
+
325
+ MAGNETIC_FIELD = 2;
326
+
327
+ // Temperature in °C
328
+ TEMPERATURE = 3;
329
+
330
+ // Proximity sensor distance measured in centimeters
331
+ PROXIMITY = 4;
240
332
 
241
- // Details on the sensors documentation can be found here:
242
- // https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_
243
- enum PhysicalType {
244
- POSITION = 0;
333
+ // Ambient light level in SI lux units
334
+ LIGHT = 5;
245
335
 
246
- // All values are angles in degrees.
247
- // values = [x,y,z]
248
- ROTATION = 1;
336
+ // Atmospheric pressure in hPa (millibar)
337
+ PRESSURE = 6;
249
338
 
250
- MAGNETIC_FIELD = 2;
339
+ // Relative ambient air humidity in percent
340
+ HUMIDITY = 7;
251
341
 
252
- // Temperature in °C
253
- TEMPERATURE = 3;
342
+ VELOCITY = 8;
343
+ AMBIENT_MOTION = 9;
254
344
 
255
- // Proximity sensor distance measured in centimeters
256
- PROXIMITY = 4;
345
+ // Describing a hinge angle sensor in degrees.
346
+ HINGE_ANGLE0 = 10;
347
+ HINGE_ANGLE1 = 11;
348
+ HINGE_ANGLE2 = 12;
257
349
 
258
- // Ambient light level in SI lux units
259
- LIGHT = 5;
350
+ ROLLABLE0 = 13;
351
+ ROLLABLE1 = 14;
352
+ ROLLABLE2 = 15;
260
353
 
261
- // Atmospheric pressure in hPa (millibar)
262
- PRESSURE = 6;
354
+ // Describing the device posture; the value should be an enum defined
355
+ // in Posture::PostureValue.
356
+ POSTURE = 16;
263
357
 
264
- // Relative ambient air humidity in percent
265
- HUMIDITY = 7;
358
+ // Heart rate in bpm
359
+ HEART_RATE = 17;
266
360
 
267
- VELOCITY = 8;
268
- AMBIENT_MOTION = 9;
269
- }
270
- PhysicalType target = 1;
361
+ // Ambient RGBC light intensity. Values are in order (Red, Green, Blue,
362
+ // Clear).
363
+ RGBC_LIGHT = 18;
271
364
 
272
- // [Output Only]
273
- State status = 2;
365
+ // Wrist tilt gesture (1 = gaze, 0 = ungaze)
366
+ WRIST_TILT = 19;
367
+ }
368
+ PhysicalType target = 1;
369
+
370
+ // [Output Only]
371
+ State status = 2;
274
372
 
275
- // Value interpretation depends on sensor, will contain at most 3 values.
276
- ParameterValue value = 3;
373
+ // Value interpretation depends on sensor.
374
+ ParameterValue value = 3;
277
375
  }
278
376
 
279
377
  // A single sensor value.
280
378
  message SensorValue {
281
- enum State {
282
- OK = 0;
283
- NO_SERVICE = -3; // qemud service is not available/initiated.
284
- DISABLED = -2; // Sensor is disabled.
285
- UNKNOWN = -1; // Unknown sensor (should not happen)
286
- }
287
-
288
- // These are the various sensors that can be available in an emulated
289
- // devices.
290
- enum SensorType {
291
- // Measures the acceleration force in m/s2 that is applied to a device
292
- // on all three physical axes (x, y, and z), including the force of
293
- // gravity.
294
- ACCELERATION = 0;
295
- // Measures a device's rate of rotation in rad/s around each of the
296
- // three physical axes (x, y, and z).
297
- GYROSCOPE = 1;
298
- // Measures the ambient geomagnetic field for all three physical axes
299
- // (x, y, z) in μT.
300
- MAGNETIC_FIELD = 2;
301
- // Measures degrees of rotation that a device makes around all three
302
- // physical axes (x, y, z)
303
- ORIENTATION = 3;
304
- // Measures the temperature of the device in degrees Celsius (°C).
305
- TEMPERATURE = 4;
306
- // Measures the proximity of an object in cm relative to the view screen
307
- // of a device. This sensor is typically used to determine whether a
308
- // handset is being held up to a person's ear.
309
- PROXIMITY = 5;
310
- // Measures the ambient light level (illumination) in lx.
311
- LIGHT = 6;
312
- // Measures the ambient air pressure in hPa or mbar.
313
- PRESSURE = 7;
314
- // Measures the relative ambient humidity in percent (%).
315
- HUMIDITY = 8;
316
- MAGNETIC_FIELD_UNCALIBRATED = 9;
317
- GYROSCOPE_UNCALIBRATED = 10;
318
- }
319
-
320
- // Type of sensor
321
- SensorType target = 1;
322
-
323
- // [Output Only]
324
- State status = 2;
325
-
326
- // Value interpretation depends on sensor enum, will contain at most 3
327
- // values.
328
- ParameterValue value = 3;
379
+ enum State {
380
+ OK = 0;
381
+ NO_SERVICE = -3; // qemud service is not available/initiated.
382
+ DISABLED = -2; // Sensor is disabled.
383
+ UNKNOWN = -1; // Unknown sensor (should not happen)
384
+ }
385
+
386
+ // These are the various sensors that can be available in an emulated
387
+ // devices.
388
+ enum SensorType {
389
+ // Measures the acceleration force in m/s2 that is applied to a device
390
+ // on all three physical axes (x, y, and z), including the force of
391
+ // gravity.
392
+ ACCELERATION = 0;
393
+ // Measures a device's rate of rotation in rad/s around each of the
394
+ // three physical axes (x, y, and z).
395
+ GYROSCOPE = 1;
396
+ // Measures the ambient geomagnetic field for all three physical axes
397
+ // (x, y, z) in μT.
398
+ MAGNETIC_FIELD = 2;
399
+ // Measures degrees of rotation that a device makes around all three
400
+ // physical axes (x, y, z)
401
+ ORIENTATION = 3;
402
+ // Measures the temperature of the device in degrees Celsius (°C).
403
+ TEMPERATURE = 4;
404
+ // Measures the proximity of an object in cm relative to the view screen
405
+ // of a device. This sensor is typically used to determine whether a
406
+ // handset is being held up to a person's ear.
407
+ PROXIMITY = 5;
408
+ // Measures the ambient light level (illumination) in lx.
409
+ LIGHT = 6;
410
+ // Measures the ambient air pressure in hPa or mbar.
411
+ PRESSURE = 7;
412
+ // Measures the relative ambient humidity in percent (%).
413
+ HUMIDITY = 8;
414
+ MAGNETIC_FIELD_UNCALIBRATED = 9;
415
+ GYROSCOPE_UNCALIBRATED = 10;
416
+
417
+ // HINGE_ANGLE0 (11), HINGE_ANGLE1 (12), HINGE_ANGLE2 (13) are
418
+ // skipped; clients should use get/setPhysicalModel() instead for these
419
+ // "sensors".
420
+
421
+ // Measures the heart rate in bpm.
422
+ HEART_RATE = 14;
423
+ // Measures the ambient RGBC light intensity.
424
+ // Values are in order (Red, Green, Blue, Clear).
425
+ RGBC_LIGHT = 15;
426
+ // WIRST_TILT (16) is skipped; clients should use get/setPhysicalModel()
427
+ // instead.
428
+ // Measures acceleration force and provides bias data.
429
+ ACCELERATION_UNCALIBRATED = 17;
430
+ }
431
+
432
+ // Type of sensor
433
+ SensorType target = 1;
434
+
435
+ // [Output Only]
436
+ State status = 2;
437
+
438
+ // Value interpretation depends on sensor enum.
439
+ ParameterValue value = 3;
440
+ }
441
+
442
+ // A single backlight brightness value.
443
+ message BrightnessValue {
444
+ enum LightType {
445
+ // Display backlight. This will affect all displays.
446
+ LCD = 0;
447
+ KEYBOARD = 1;
448
+ BUTTON = 2;
449
+ }
450
+
451
+ // Type of light
452
+ LightType target = 1;
453
+
454
+ // Light intensity, ranges from 0-255.
455
+ uint32 value = 2;
456
+ }
457
+
458
+ // in line with android/emulation/resizable_display_config.h
459
+ enum DisplayModeValue {
460
+ PHONE = 0;
461
+ FOLDABLE = 1;
462
+ TABLET = 2;
463
+ DESKTOP = 3;
464
+ }
465
+
466
+ message DisplayMode {
467
+ DisplayModeValue value = 1;
329
468
  }
330
469
 
331
470
  message LogMessage {
332
- // [Output Only] The contents of the log output.
333
- string contents = 1;
334
- // The starting byte position of the output that was returned. This
335
- // should match the start parameter sent with the request. If the serial
336
- // console output exceeds the size of the buffer, older output will be
337
- // overwritten by newer content and the start values will be mismatched.
338
- int64 start = 2;
339
- //[Output Only] The position of the next byte of content from the serial
340
- // console output. Use this value in the next request as the start
341
- // parameter.
342
- int64 next = 3;
343
-
344
- // Set the sort of response you are interested it in.
345
- // It the type is "Parsed" the entries field will contain the parsed
346
- // results. otherwise the contents field will be set.
347
- LogType sort = 4;
348
-
349
- // [Output Only] The parsed logcat entries so far. Only set if sort is
350
- // set to Parsed
351
- repeated LogcatEntry entries = 5;
352
-
353
- enum LogType {
354
- Text = 0;
355
- Parsed = 1;
356
- }
471
+ // [Output Only] The contents of the log output.
472
+ string contents = 1;
473
+ // The starting byte position of the output that was returned. This
474
+ // should match the start parameter sent with the request. If the serial
475
+ // console output exceeds the size of the buffer, older output will be
476
+ // overwritten by newer content and the start values will be mismatched.
477
+ int64 start = 2;
478
+ //[Output Only] The position of the next byte of content from the serial
479
+ // console output. Use this value in the next request as the start
480
+ // parameter.
481
+ int64 next = 3;
482
+
483
+ // Set the sort of response you are interested it in.
484
+ // It the type is "Parsed" the entries field will contain the parsed
485
+ // results. otherwise the contents field will be set.
486
+ LogType sort = 4;
487
+
488
+ // [Output Only] The parsed logcat entries so far. Only set if sort is
489
+ // set to Parsed
490
+ repeated LogcatEntry entries = 5;
491
+
492
+ enum LogType {
493
+ Text = 0;
494
+ Parsed = 1;
495
+ }
357
496
  }
358
497
 
359
498
  // A parsed logcat entry.
360
499
  message LogcatEntry {
361
- // The possible log levels.
362
- enum LogLevel {
363
- UNKNOWN = 0;
364
- DEFAULT = 1;
365
- VERBOSE = 2;
366
- DEBUG = 3;
367
- INFO = 4;
368
- WARN = 5;
369
- ERR = 6;
370
- FATAL = 7;
371
- SILENT = 8;
372
- };
373
-
374
- // A Unix timestamps in milliseconds (The number of milliseconds that
375
- // have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
376
- // leap seconds)
377
- uint64 timestamp = 1;
378
-
379
- // Process id.
380
- uint32 pid = 2;
381
-
382
- // Thread id.
383
- uint32 tid = 3;
384
- LogLevel level = 4;
385
- string tag = 5;
386
- string msg = 6;
500
+ // The possible log levels.
501
+ enum LogLevel {
502
+ UNKNOWN = 0;
503
+ DEFAULT = 1;
504
+ VERBOSE = 2;
505
+ DEBUG = 3;
506
+ INFO = 4;
507
+ WARN = 5;
508
+ ERR = 6;
509
+ FATAL = 7;
510
+ SILENT = 8;
511
+ }
512
+
513
+ // A Unix timestamps in milliseconds (The number of milliseconds that
514
+ // have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
515
+ // leap seconds)
516
+ uint64 timestamp = 1;
517
+
518
+ // Process id.
519
+ uint32 pid = 2;
520
+
521
+ // Thread id.
522
+ uint32 tid = 3;
523
+ LogLevel level = 4;
524
+ string tag = 5;
525
+ string msg = 6;
387
526
  }
388
527
 
389
528
  // Information about the hypervisor that is currently in use.
390
529
  message VmConfiguration {
391
- enum VmHypervisorType {
392
- // An unknown hypervisor
393
- UNKNOWN = 0;
530
+ enum VmHypervisorType {
531
+ // An unknown hypervisor
532
+ UNKNOWN = 0;
394
533
 
395
- // No hypervisor is in use. This usually means that the guest is
396
- // running on a different CPU than the host, or you are using a
397
- // platform where no hypervisor is available.
398
- NONE = 1;
534
+ // No hypervisor is in use. This usually means that the guest is
535
+ // running on a different CPU than the host, or you are using a
536
+ // platform where no hypervisor is available.
537
+ NONE = 1;
399
538
 
400
- // The Kernel based Virtual Machine
401
- // (https://www.linux-kvm.org/page/Main_Page)
402
- KVM = 2;
539
+ // The Kernel based Virtual Machine
540
+ // (https://www.linux-kvm.org/page/Main_Page)
541
+ KVM = 2;
403
542
 
404
- // Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
405
- // https://github.com/intel/haxm
406
- HAXM = 3;
543
+ // Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
544
+ // https://github.com/intel/haxm
545
+ HAXM = 3;
407
546
 
408
- // Hypervisor Framework.
409
- // https://developer.apple.com/documentation/hypervisor
410
- HVF = 4;
547
+ // Hypervisor Framework.
548
+ // https://developer.apple.com/documentation/hypervisor
549
+ HVF = 4;
411
550
 
412
- // Window Hypervisor Platform
413
- // https://docs.microsoft.com/en-us/virtualization/api/
414
- WHPX = 5;
551
+ // Window Hypervisor Platform
552
+ // https://docs.microsoft.com/en-us/virtualization/api/
553
+ WHPX = 5;
415
554
 
416
- GVM = 6;
417
- };
555
+ AEHD = 6;
556
+ }
418
557
 
419
- VmHypervisorType hypervisorType = 1;
420
- int32 numberOfCpuCores = 2;
421
- int64 ramSizeBytes = 3;
558
+ VmHypervisorType hypervisorType = 1;
559
+ int32 numberOfCpuCores = 2;
560
+ int64 ramSizeBytes = 3;
422
561
  }
423
562
 
424
563
  // Representation of a clipped data object on the clipboard.
425
564
  message ClipData {
426
- // UTF-8 Encoded text.
427
- string text = 1;
565
+ // UTF-8 Encoded text.
566
+ string text = 1;
428
567
  }
429
568
 
430
569
  // The Touch interface represents a single contact point on a
431
570
  // touch-sensitive device. The contact point is commonly a finger or stylus
432
571
  // and the device may be a touchscreen or trackpad.
433
572
  message Touch {
434
- // The horizontal coordinate. This is the physical location on the
435
- // screen For example 0 indicates the leftmost coordinate.
436
- int32 x = 1;
437
-
438
- // The vertical coordinate. This is the physical location on the screen
439
- // For example 0 indicates the top left coordinate.
440
- int32 y = 2;
441
-
442
- // The identifier is an arbitrary non-negative integer that is used to
443
- // identify and track each tool independently when multiple tools are
444
- // active. For example, when multiple fingers are touching the device,
445
- // each finger should be assigned a distinct tracking id that is used as
446
- // long as the finger remains in contact. Tracking ids may be reused
447
- // when their associated tools move out of range.
448
- //
449
- // The emulator currently supports up to 10 concurrent touch events. The
450
- // identifier can be any uninque value and will be mapped to the next
451
- // available internal identifier.
452
- int32 identifier = 3;
453
-
454
- // Reports the physical pressure applied to the tip of the tool or the
455
- // signal strength of the touch contact.
456
- //
457
- // The values reported must be non-zero when the tool is touching the
458
- // device and zero otherwise to indicate that the touch event is
459
- // completed.
460
- //
461
- // Make sure to deliver a pressure of 0 for the given identifier when
462
- // the touch event is completed, otherwise the touch identifier will not
463
- // be unregistered!
464
- int32 pressure = 4;
465
-
466
- // Optionally reports the cross-sectional area of the touch contact, or
467
- // the length of the longer dimension of the touch contact.
468
- int32 touch_major = 5;
469
-
470
- // Optionally reports the length of the shorter dimension of the touch
471
- // contact. This axis will be ignored if touch_major is reporting an
472
- // area measurement greater than 0.
473
- int32 touch_minor = 6;
573
+ // The horizontal coordinate. This is the physical location on the
574
+ // screen For example 0 indicates the leftmost coordinate.
575
+ int32 x = 1;
576
+
577
+ // The vertical coordinate. This is the physical location on the screen
578
+ // For example 0 indicates the top left coordinate.
579
+ int32 y = 2;
580
+
581
+ // The identifier is an arbitrary non-negative integer that is used to
582
+ // identify and track each tool independently when multiple tools are
583
+ // active. For example, when multiple fingers are touching the device,
584
+ // each finger should be assigned a distinct tracking id that is used as
585
+ // long as the finger remains in contact. Tracking ids may be reused
586
+ // when their associated tools move out of range.
587
+ //
588
+ // The emulator currently supports up to 10 concurrent touch events. The
589
+ // identifier can be any uninque value and will be mapped to the next
590
+ // available internal identifier.
591
+ int32 identifier = 3;
592
+
593
+ // Reports the physical pressure applied to the tip of the tool or the
594
+ // signal strength of the touch contact.
595
+ //
596
+ // The values reported must be non-zero when the tool is touching the
597
+ // device and zero otherwise to indicate that the touch event is
598
+ // completed.
599
+ //
600
+ // Make sure to deliver a pressure of 0 for the given identifier when
601
+ // the touch event is completed, otherwise the touch identifier will not
602
+ // be unregistered!
603
+ int32 pressure = 4;
604
+
605
+ // Optionally reports the cross-sectional area of the touch contact, or
606
+ // the length of the longer dimension of the touch contact.
607
+ int32 touch_major = 5;
608
+
609
+ // Optionally reports the length of the shorter dimension of the touch
610
+ // contact. This axis will be ignored if touch_major is reporting an
611
+ // area measurement greater than 0.
612
+ int32 touch_minor = 6;
474
613
 
475
614
  enum EventExpiration {
476
- // The system will use the default time of 120s to track
477
- // the touch event with the given identifier. If no update happens
478
- // within this timeframe the identifier is considered expired
479
- // and can be made available for re-use. This means that a touch event
480
- // with pressure 0 for this identifier will be send to the emulator.
481
- EVENT_EXPIRATION_UNSPECIFIED = 0;
482
-
483
- // Never expire the given slot. You must *ALWAYS* close the identifier
484
- // by sending a touch event with 0 pressure.
485
- NEVER_EXPIRE = 1;
615
+ // The system will use the default time of 120s to track
616
+ // the touch event with the given identifier. If no update happens
617
+ // within this timeframe the identifier is considered expired
618
+ // and can be made available for re-use. This means that a touch event
619
+ // with pressure 0 for this identifier will be send to the emulator.
620
+ EVENT_EXPIRATION_UNSPECIFIED = 0;
621
+
622
+ // Never expire the given slot. You must *ALWAYS* close the identifier
623
+ // by sending a touch event with 0 pressure.
624
+ NEVER_EXPIRE = 1;
486
625
  }
487
626
 
488
627
  EventExpiration expiration = 7;
489
- };
628
+ }
490
629
 
491
630
  // A TouchEvent contains a list of Touch objects that are in contact with
492
631
  // the touch surface.
@@ -496,37 +635,53 @@ message Touch {
496
635
  // TouchEvents are delivered to the emulated devices using ["Protocol
497
636
  // B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
498
637
  message TouchEvent {
499
- // The list of Touch objects, note that these do not need to be unique
500
- repeated Touch touches = 1;
501
-
502
- // The display device where the touch event occurred.
503
- // Omitting or using the value 0 indicates the main display.
504
- //
505
- // Touch events cannot be send to devices other than 0, due to
506
- // https://issuetracker.google.com/issues/150699691
507
- int32 device = 2;
638
+ // The list of Touch objects, note that these do not need to be unique
639
+ repeated Touch touches = 1;
640
+
641
+ // The display device where the touch event occurred.
642
+ // Omitting or using the value 0 indicates the main display.
643
+ //
644
+ // Touch events cannot be send to displays other than 0, due to
645
+ // https://issuetracker.google.com/issues/150699691
646
+ int32 display = 2;
508
647
  }
509
648
 
510
649
  // The MouseEvent interface represents events that occur due to the user
511
650
  // interacting with a pointing device (such as a mouse).
512
651
  message MouseEvent {
513
- // The horizontal coordinate. This is the physical location on the
514
- // screen For example 0 indicates the leftmost coordinate.
515
- int32 x = 1;
516
-
517
- // The vertical coordinate. This is the physical location on the screen
518
- // For example 0 indicates the top left coordinate.
519
- int32 y = 2;
520
-
521
- // Indicates which buttons are pressed.
522
- // 0: No button was pressed
523
- // 1: Primary button (left)
524
- // 2: Secondary button (right)
525
- int32 buttons = 3;
652
+ // The horizontal coordinate. This is the physical location on the
653
+ // screen For example 0 indicates the leftmost coordinate.
654
+ int32 x = 1;
655
+
656
+ // The vertical coordinate. This is the physical location on the screen
657
+ // For example 0 indicates the top left coordinate.
658
+ int32 y = 2;
659
+
660
+ // Indicates which buttons are pressed.
661
+ // 0: No button was pressed
662
+ // 1: Primary button (left)
663
+ // 2: Secondary button (right)
664
+ int32 buttons = 3;
665
+
666
+ // The display device where the mouse event occurred.
667
+ // Omitting or using the value 0 indicates the main display.
668
+ int32 display = 4;
669
+ }
526
670
 
527
- // The display device where the mouse event occurred.
528
- // Omitting or using the value 0 indicates the main display.
529
- int32 device = 4;
671
+ message WheelEvent {
672
+ // The value indicating how much the mouse wheel is rotated. Scaled so that
673
+ // 120 equals to 1 wheel click. (120 is chosen as a multiplier often used to
674
+ // represent wheel movements less than 1 wheel click. e.g.
675
+ // https://doc.qt.io/qt-5/qwheelevent.html#angleDelta) Positive delta value
676
+ // is assigned to dx when the top of wheel is moved to left. Similarly
677
+ // positive delta value is assigned to dy when the top of wheel is moved
678
+ // away from the user.
679
+ int32 dx = 1;
680
+ int32 dy = 2;
681
+
682
+ // The display device where the mouse event occurred.
683
+ // Omitting or using the value 0 indicates the main display.
684
+ int32 display = 3;
530
685
  }
531
686
 
532
687
  // KeyboardEvent objects describe a user interaction with the keyboard; each
@@ -538,368 +693,413 @@ message MouseEvent {
538
693
  // Note: that only keyCode, key, or text can be set and that the semantics
539
694
  // will slightly vary.
540
695
  message KeyboardEvent {
541
- // Code types that the emulator can receive. Note that the emulator
542
- // will do its best to translate the code to an evdev value that
543
- // will be send to the emulator. This translation is based on
544
- // the chromium translation tables. See
545
- // (this)[https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-grpc/android/emulation/control/keyboard/keycode_converter_data.inc]
546
- // for details on the translation.
547
- enum KeyCodeType {
548
- Usb = 0;
549
- Evdev = 1;
550
- XKB = 2;
551
- Win = 3;
552
- Mac = 4;
553
- };
554
-
555
- enum KeyEventType {
556
- // Indicates that this keyevent should be send to the emulator
557
- // as a key down event. Meaning that the key event will be
558
- // translated to an EvDev event type and bit 11 (0x400) will be
559
- // set before it is sent to the emulator.
560
- keydown = 0;
561
-
562
- // Indicates that the keyevent should be send to the emulator
563
- // as a key up event. Meaning that the key event will be
564
- // translated to an EvDev event type and
565
- // sent to the emulator.
566
- keyup = 1;
567
-
568
- // Indicates that the keyevent will be send to the emulator
569
- // as e key down event and immediately followed by a keyup event.
570
- keypress = 2;
571
- };
572
-
573
- // Type of keycode contained in the keyCode field.
574
- KeyCodeType codeType = 1;
575
-
576
- // The type of keyboard event that should be sent to the emulator
577
- KeyEventType eventType = 2;
578
-
579
- // This property represents a physical key on the keyboard (as opposed
580
- // to the character generated by pressing the key). In other words, this
581
- // property is a value which isn't altered by keyboard layout or the
582
- // state of the modifier keys. This value will be interpreted by the
583
- // emulator depending on the KeyCodeType. The incoming key code will be
584
- // translated to an evdev code type and send to the emulator.
585
- // The values in key and text will be ignored.
586
- int32 keyCode = 3;
587
-
588
- // The value of the key pressed by the user, taking into consideration
589
- // the state of modifier keys such as Shift as well as the keyboard
590
- // locale and layout. This follows the w3c standard used in browsers.
591
- // You can find an accurate description of valid values
592
- // [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
593
- //
594
- // Note that some keys can result in multiple evdev events that are
595
- // delivered to the emulator. for example the Key "A" will result in a
596
- // sequence:
597
- // ["Shift", "a"] -> [0x2a, 0x1e] whereas "a" results in ["a"] -> [0x1e].
598
- //
599
- // Not all documented keys are understood by android, and only printable
600
- // ASCII [32-127) characters are properly translated.
601
- //
602
- // Keep in mind that there are a set of key values that result in android
603
- // specific behavior
604
- // [see](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#Phone_keys):
605
- //
606
- // - "AppSwitch": Behaves as the "Overview" button in android.
607
- // - "GoBack": The Back button.
608
- // - "GoHome": The Home button, which takes the user to the phone's main
609
- // screen (usually an application launcher).
610
- // - "Power": The Power button.
611
- string key = 4;
612
-
613
- // Series of utf8 encoded characters to send to the emulator. An attempt
614
- // will be made to translate every character will an EvDev event type and
615
- // send to the emulator as a keypress event. The values in keyCode,
616
- // eventType, codeType and key will be ignored.
617
- //
618
- // Note that most printable ASCII characters (range [32-127) can be send
619
- // individually with the "key" param. Do not expect arbitrary UTF symbols to
620
- // arrive in the emulator (most will be ignored).
621
- string text = 5;
696
+ // Code types that the emulator can receive. Note that the emulator
697
+ // will do its best to translate the code to an evdev value that
698
+ // will be send to the emulator. This translation is based on
699
+ // the chromium translation tables. See
700
+ // (this)[https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-grpc/android/emulation/control/keyboard/keycode_converter_data.inc]
701
+ // for details on the translation.
702
+ enum KeyCodeType {
703
+ Usb = 0;
704
+ Evdev = 1;
705
+ XKB = 2;
706
+ Win = 3;
707
+ Mac = 4;
708
+ }
709
+
710
+ enum KeyEventType {
711
+ // Indicates that this keyevent should be send to the emulator
712
+ // as a key down event. Meaning that the key event will be
713
+ // translated to an EvDev event type and bit 11 (0x400) will be
714
+ // set before it is sent to the emulator.
715
+ keydown = 0;
716
+
717
+ // Indicates that the keyevent should be send to the emulator
718
+ // as a key up event. Meaning that the key event will be
719
+ // translated to an EvDev event type and
720
+ // sent to the emulator.
721
+ keyup = 1;
722
+
723
+ // Indicates that the keyevent will be send to the emulator
724
+ // as e key down event and immediately followed by a keyup event.
725
+ keypress = 2;
726
+ }
727
+
728
+ // Type of keycode contained in the keyCode field.
729
+ KeyCodeType codeType = 1;
730
+
731
+ // The type of keyboard event that should be sent to the emulator
732
+ KeyEventType eventType = 2;
733
+
734
+ // This property represents a physical key on the keyboard (as opposed
735
+ // to the character generated by pressing the key). In other words, this
736
+ // property is a value which isn't altered by keyboard layout or the
737
+ // state of the modifier keys. This value will be interpreted by the
738
+ // emulator depending on the KeyCodeType. The incoming key code will be
739
+ // translated to an evdev code type and send to the emulator.
740
+ // The values in key and text will be ignored.
741
+ int32 keyCode = 3;
742
+
743
+ // The value of the key pressed by the user, taking into consideration
744
+ // the state of modifier keys such as Shift as well as the keyboard
745
+ // locale and layout. This follows the w3c standard used in browsers.
746
+ // You can find an accurate description of valid values
747
+ // [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
748
+ //
749
+ // Note that some keys can result in multiple evdev events that are
750
+ // delivered to the emulator. for example the Key "A" will result in a
751
+ // sequence:
752
+ // ["Shift", "a"] -> [0x2a, 0x1e] whereas "a" results in ["a"] -> [0x1e].
753
+ //
754
+ // Not all documented keys are understood by android, and only printable
755
+ // ASCII [32-127) characters are properly translated.
756
+ //
757
+ // Keep in mind that there are a set of key values that result in android
758
+ // specific behavior
759
+ // [see](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#Phone_keys):
760
+ //
761
+ // - "AppSwitch": Behaves as the "Overview" button in android.
762
+ // - "GoBack": The Back button.
763
+ // - "GoHome": The Home button, which takes the user to the phone's main
764
+ // screen (usually an application launcher).
765
+ // - "Power": The Power button.
766
+ string key = 4;
767
+
768
+ // Series of utf8 encoded characters to send to the emulator. An attempt
769
+ // will be made to translate every character will an EvDev event type and
770
+ // send to the emulator as a keypress event. The values in keyCode,
771
+ // eventType, codeType and key will be ignored.
772
+ //
773
+ // Note that most printable ASCII characters (range [32-127) can be send
774
+ // individually with the "key" param. Do not expect arbitrary UTF symbols to
775
+ // arrive in the emulator (most will be ignored).
776
+ //
777
+ // Note that it is possible to overrun the keyboard buffer by slamming this
778
+ // endpoint with large quantities of text (>1kb). The clipboard api is
779
+ // better suited for transferring large quantities of text.
780
+ string text = 5;
622
781
  }
623
782
 
624
783
  message Fingerprint {
625
- // True when the fingprint is touched.
626
- bool isTouching = 1;
784
+ // True when the fingprint is touched.
785
+ bool isTouching = 1;
627
786
 
628
- // The identifier of the registered fingerprint.
629
- int32 touchId = 2;
787
+ // The identifier of the registered fingerprint.
788
+ int32 touchId = 2;
630
789
  }
631
790
 
632
791
  message GpsState {
633
- // Setting this to false will disable auto updating from the LocationUI,
634
- // otherwise the location UI will override the location at a frequency of 1hz.
635
- //
636
- // - This is unused if the emulator is launched with -no-window, or when he
637
- // location ui is disabled.
638
- // - This will BREAK the location ui experience if it is set to false. For
639
- // example routing will no longer function.
640
- bool passiveUpdate = 1;
641
-
642
- // The latitude, in degrees.
643
- double latitude = 2;
644
-
645
- // The longitude, in degrees.
646
- double longitude = 3;
647
-
648
- // The speed if it is available, in meters/second over ground
649
- double speed = 4;
792
+ // Setting this to false will disable auto updating from the LocationUI,
793
+ // otherwise the location UI will override the location at a frequency of
794
+ // 1hz.
795
+ //
796
+ // - This is unused if the emulator is launched with -no-window, or when he
797
+ // location ui is disabled.
798
+ // - This will BREAK the location ui experience if it is set to false. For
799
+ // example routing will no longer function.
800
+ bool passiveUpdate = 1;
801
+
802
+ // The latitude, in degrees.
803
+ double latitude = 2;
804
+
805
+ // The longitude, in degrees.
806
+ double longitude = 3;
807
+
808
+ // The speed if it is available, in meters/second over ground
809
+ double speed = 4;
810
+
811
+ // gets the horizontal direction of travel of this device, and is not
812
+ // related to the device orientation. It is guaranteed to be in the
813
+ // range [0.0, 360.0] if the device has a bearing. 0=North, 90=East,
814
+ // 180=South, etc..
815
+ double bearing = 5;
816
+
817
+ // The altitude if available, in meters above the WGS 84 reference
818
+ // ellipsoid.
819
+ double altitude = 6;
820
+
821
+ // The number of satellites used to derive the fix
822
+ int32 satellites = 7;
823
+ }
650
824
 
651
- // gets the horizontal direction of travel of this device, and is not
652
- // related to the device orientation. It is guaranteed to be in the
653
- // range [0.0, 360.0] if the device has a bearing. 0=North, 90=East,
654
- // 180=South, etc..
655
- double bearing = 5;
825
+ message BatteryState {
826
+ enum BatteryStatus {
827
+ UNKNOWN = 0;
828
+ CHARGING = 1;
829
+ DISCHARGING = 2;
830
+ NOT_CHARGING = 3;
831
+ FULL = 4;
832
+ }
656
833
 
657
- // The altitude if available, in meters above the WGS 84 reference
658
- // ellipsoid.
659
- double altitude = 6;
834
+ enum BatteryCharger {
835
+ NONE = 0;
836
+ AC = 1;
837
+ USB = 2;
838
+ WIRELESS = 3;
839
+ }
660
840
 
661
- // The number of satellites used to derive the fix
662
- int32 satellites = 7;
663
- }
841
+ enum BatteryHealth {
842
+ GOOD = 0;
843
+ FAILED = 1;
844
+ DEAD = 2;
845
+ OVERVOLTAGE = 3;
846
+ OVERHEATED = 4;
847
+ }
664
848
 
665
- message BatteryState {
666
- enum BatteryStatus {
667
- UNKNOWN = 0;
668
- CHARGING = 1;
669
- DISCHARGING = 2;
670
- NOT_CHARGING = 3;
671
- FULL = 4;
672
- };
673
- enum BatteryCharger {
674
- NONE = 0;
675
- AC = 1;
676
- USB = 2;
677
- WIRELESS = 3;
678
- };
679
-
680
- enum BatteryHealth {
681
- GOOD = 0;
682
- FAILED = 1;
683
- DEAD = 2;
684
- OVERVOLTAGE = 3;
685
- OVERHEATED = 4;
686
- };
687
- bool hasBattery = 1;
688
- bool isPresent = 2;
689
- BatteryCharger charger = 3;
690
- int32 chargeLevel = 4;
691
- BatteryHealth health = 5;
692
- BatteryStatus status = 6;
849
+ bool hasBattery = 1;
850
+ bool isPresent = 2;
851
+ BatteryCharger charger = 3;
852
+ int32 chargeLevel = 4;
853
+ BatteryHealth health = 5;
854
+ BatteryStatus status = 6;
693
855
  }
694
856
 
695
857
  // An ImageTransport allows for specifying a side channel for
696
858
  // delivering image frames versus using the standard bytes array that is
697
859
  // returned with the gRPC request.
698
860
  message ImageTransport {
699
- enum TransportChannel {
700
- // Return full frames over the gRPC transport
701
- TRANSPORT_CHANNEL_UNSPECIFIED = 0;
861
+ enum TransportChannel {
862
+ // Return full frames over the gRPC transport
863
+ TRANSPORT_CHANNEL_UNSPECIFIED = 0;
702
864
 
703
- // Write images to the a file/shared memory handle.
704
- MMAP = 1;
705
- }
865
+ // Write images to the a file/shared memory handle.
866
+ MMAP = 1;
867
+ }
706
868
 
707
- // The desired transport channel used for delivering image frames. Only
708
- // relevant when streaming screenshots.
709
- TransportChannel channel = 1;
869
+ // The desired transport channel used for delivering image frames. Only
870
+ // relevant when streaming screenshots.
871
+ TransportChannel channel = 1;
710
872
 
711
- // Handle used for writing image frames if transport is mmap. The client sets
712
- // and owns this handle. It can be either a shm region, or a mmap. A mmap
713
- // should be a url that starts with `file:///`
714
- // Note: the mmap can result in tearing.
715
- string handle = 2;
873
+ // Handle used for writing image frames if transport is mmap. The client
874
+ // sets and owns this handle. It can be either a shm region, or a mmap. A
875
+ // mmap should be a url that starts with `file:///` Note: the mmap can
876
+ // result in tearing.
877
+ string handle = 2;
716
878
  }
717
879
 
718
- message ImageFormat {
719
- enum ImgFormat {
720
- // Portable Network Graphics format
721
- // (https://en.wikipedia.org/wiki/Portable_Network_Graphics)
722
- PNG = 0;
723
-
724
- // Three-channel RGB color model supplemented with a fourth alpha
725
- // channel. https://en.wikipedia.org/wiki/RGBA_color_model
726
- // Each pixel consists of 4 bytes.
727
- RGBA8888 = 1;
728
-
729
- // Three-channel RGB color model, each pixel consists of 3 bytes
730
- RGB888 = 2;
731
- }
732
-
733
- // The (desired) format of the resulting bytes.
734
- ImgFormat format = 1;
735
-
736
- // [Output Only] The rotation of the image. The image will be rotated
737
- // based upon the coarse grained orientation of the device.
738
- Rotation rotation = 2;
739
-
740
- // The (desired) width of the image. When passed as input
741
- // the image will be scaled to match the given
742
- // width, while maintaining the aspect ratio of the device.
743
- // The returned image will never exceed the given width, but can be less.
744
- // Omitting this value (or passing in 0) will result in no scaling,
745
- // and the width of the actual device will be used.
746
- uint32 width = 3;
747
-
748
- // The (desired) height of the image. When passed as input
749
- // the image will be scaled to match the given
750
- // height, while maintaining the aspect ratio of the device.
751
- // The returned image will never exceed the given height, but can be less.
752
- // Omitting this value (or passing in 0) will result in no scaling,
753
- // and the height of the actual device will be used.
754
- uint32 height = 4;
755
-
756
- // The (desired) display id of the device. Setting this to 0 (or omitting)
757
- // indicates the main display.
758
- uint32 display = 5;
759
-
760
- // Set this if you wish to use a different transport channel to deliver image
761
- // frames.
762
- ImageTransport transport = 6;
880
+ // The aspect ratio (width/height) will be different from the one
881
+ // where the device is unfolded.
882
+ message FoldedDisplay {
883
+ uint32 width = 1;
884
+ uint32 height = 2;
885
+ // It is possible for the screen to be folded in different ways depending
886
+ // on which surface is shown to the user. So xOffset and yOffset indicate
887
+ // the top left corner of the folded screen within the original unfolded
888
+ // screen.
889
+ uint32 xOffset = 3;
890
+ uint32 yOffset = 4;
763
891
  }
764
892
 
765
- message Image {
766
- ImageFormat format = 1;
767
-
768
- uint32 width = 2 [ deprecated = true ]; // width is contained in format.
769
- uint32 height = 3 [ deprecated = true ]; // height is contained in format.
770
-
771
- // The organization of the pixels in the image buffer is from left to
772
- // right and bottom up. This will be empty if an alternative image transport
773
- // is requested in the image format. In that case the side channel should
774
- // be used to obtain the image data.
775
- bytes image = 4;
893
+ message ImageFormat {
894
+ enum ImgFormat {
895
+ // Portable Network Graphics format
896
+ // (https://en.wikipedia.org/wiki/Portable_Network_Graphics)
897
+ PNG = 0;
898
+
899
+ // Three-channel RGB color model supplemented with a fourth alpha
900
+ // channel. https://en.wikipedia.org/wiki/RGBA_color_model
901
+ // Each pixel consists of 4 bytes.
902
+ RGBA8888 = 1;
903
+
904
+ // Three-channel RGB color model, each pixel consists of 3 bytes
905
+ RGB888 = 2;
906
+ }
776
907
 
777
- // [Output Only] Monotonically increasing sequence number in a stream of
778
- // screenshots. The first screenshot will have a sequence of 0. A single
779
- // screenshot will always have a sequence number of 0. The sequence is not
780
- // necessarily contiguous, and can be used to detect how many frames were
781
- // dropped. An example sequence could be: [0, 3, 5, 7, 9, 11].
782
- uint32 seq = 5;
908
+ // The (desired) format of the resulting bytes.
909
+ ImgFormat format = 1;
910
+
911
+ // [Output Only] The rotation of the image. The image will be rotated
912
+ // based upon the coarse grained orientation of the device.
913
+ Rotation rotation = 2;
914
+
915
+ // The (desired) width of the image. When passed as input
916
+ // the image will be scaled to match the given
917
+ // width, while maintaining the aspect ratio of the device.
918
+ // The returned image will never exceed the given width, but can be less.
919
+ // Omitting this value (or passing in 0) will result in no scaling,
920
+ // and the width of the actual device will be used.
921
+ uint32 width = 3;
922
+
923
+ // The (desired) height of the image. When passed as input
924
+ // the image will be scaled to match the given
925
+ // height, while maintaining the aspect ratio of the device.
926
+ // The returned image will never exceed the given height, but can be less.
927
+ // Omitting this value (or passing in 0) will result in no scaling,
928
+ // and the height of the actual device will be used.
929
+ uint32 height = 4;
930
+
931
+ // The (desired) display id of the device. Setting this to 0 (or omitting)
932
+ // indicates the main display.
933
+ uint32 display = 5;
934
+
935
+ // Set this if you wish to use a different transport channel to deliver
936
+ // image frames.
937
+ ImageTransport transport = 6;
938
+
939
+ // [Output Only] Display configuration when screen is folded. The value is
940
+ // the original configuration before scaling.
941
+ FoldedDisplay foldedDisplay = 7;
942
+
943
+ // [Output Only] Display mode when AVD is resizable.
944
+ DisplayModeValue displayMode = 8;
945
+ }
783
946
 
784
- // [Output Only] Unix timestamp in microseconds when the emulator estimates
785
- // the frame was generated. The timestamp is before the actual frame is
786
- // copied and transformed. This can be used to calculate variance between
787
- // frame production time, and frame depiction time.
788
- uint64 timestampUs = 6;
947
+ message Image {
948
+ ImageFormat format = 1;
949
+
950
+ uint32 width = 2 [deprecated = true]; // width is contained in format.
951
+ uint32 height = 3 [deprecated = true]; // height is contained in format.
952
+
953
+ // The organization of the pixels in the image buffer is from left to
954
+ // right and bottom up. This will be empty if an alternative image transport
955
+ // is requested in the image format. In that case the side channel should
956
+ // be used to obtain the image data.
957
+ bytes image = 4;
958
+
959
+ // [Output Only] Monotonically increasing sequence number in a stream of
960
+ // screenshots. The first screenshot will have a sequence of 0. A single
961
+ // screenshot will always have a sequence number of 0. The sequence is not
962
+ // necessarily contiguous, and can be used to detect how many frames were
963
+ // dropped. An example sequence could be: [0, 3, 5, 7, 9, 11].
964
+ uint32 seq = 5;
965
+
966
+ // [Output Only] Unix timestamp in microseconds when the emulator estimates
967
+ // the frame was generated. The timestamp is before the actual frame is
968
+ // copied and transformed. This can be used to calculate variance between
969
+ // frame production time, and frame depiction time.
970
+ uint64 timestampUs = 6;
789
971
  }
790
972
 
791
973
  message Rotation {
792
- enum SkinRotation {
793
- PORTRAIT = 0; // 0 degrees
794
- LANDSCAPE = 1; // 90 degrees
795
- REVERSE_PORTRAIT = 2; // -180 degrees
796
- REVERSE_LANDSCAPE = 3; // -90 degrees
797
- }
974
+ enum SkinRotation {
975
+ PORTRAIT = 0; // 0 degrees
976
+ LANDSCAPE = 1; // 90 degrees
977
+ REVERSE_PORTRAIT = 2; // -180 degrees
978
+ REVERSE_LANDSCAPE = 3; // -90 degrees
979
+ }
798
980
 
799
- // The rotation of the device, derived from the sensor state
800
- // of the emulator. The derivation reflects how android observes
801
- // the rotation state.
802
- SkinRotation rotation = 1;
981
+ // The rotation of the device, derived from the sensor state
982
+ // of the emulator. The derivation reflects how android observes
983
+ // the rotation state.
984
+ SkinRotation rotation = 1;
803
985
 
804
- // Specifies the angle of rotation, in degrees [-180, 180]
805
- double xAxis = 2;
806
- double yAxis = 3;
807
- double zAxis = 4;
986
+ // Specifies the angle of rotation, in degrees [-180, 180]
987
+ double xAxis = 2;
988
+ double yAxis = 3;
989
+ double zAxis = 4;
808
990
  }
809
991
 
810
992
  message PhoneCall {
811
- enum Operation {
812
- InitCall = 0;
813
- AcceptCall = 1;
814
- RejectCallExplicit = 2;
815
- RejectCallBusy = 3;
816
- DisconnectCall = 4;
817
- PlaceCallOnHold = 5;
818
- TakeCallOffHold = 6;
819
- }
820
- Operation operation = 1;
821
- string number = 2;
993
+ enum Operation {
994
+ InitCall = 0;
995
+ AcceptCall = 1;
996
+ RejectCallExplicit = 2;
997
+ RejectCallBusy = 3;
998
+ DisconnectCall = 4;
999
+ PlaceCallOnHold = 5;
1000
+ TakeCallOffHold = 6;
1001
+ }
1002
+ Operation operation = 1;
1003
+ string number = 2;
822
1004
  }
823
1005
 
824
1006
  message PhoneResponse {
825
- enum Response {
826
- OK = 0;
827
- BadOperation = 1; // Enum out of range
828
- BadNumber = 2; // Mal-formed telephone number
829
- InvalidAction = 3; // E.g., disconnect when no call is in progress
830
- ActionFailed = 4; // Internal error
831
- RadioOff = 5; // Radio power off
832
- }
833
- Response response = 1;
1007
+ enum Response {
1008
+ OK = 0;
1009
+ BadOperation = 1; // Enum out of range
1010
+ BadNumber = 2; // Mal-formed telephone number
1011
+ InvalidAction = 3; // E.g., disconnect when no call is in progress
1012
+ ActionFailed = 4; // Internal error
1013
+ RadioOff = 5; // Radio power off
1014
+ }
1015
+ Response response = 1;
834
1016
  }
835
1017
 
836
1018
  message Entry {
837
- string key = 1;
838
- string value = 2;
1019
+ string key = 1;
1020
+ string value = 2;
839
1021
  }
840
1022
 
841
- message EntryList { repeated Entry entry = 1; }
1023
+ message EntryList {
1024
+ repeated Entry entry = 1;
1025
+ }
842
1026
 
843
1027
  message EmulatorStatus {
844
- // The emulator version string.
845
- string version = 1;
1028
+ // The emulator version string.
1029
+ string version = 1;
846
1030
 
847
- // The time the emulator has been active in .ms
848
- uint64 uptime = 2;
1031
+ // The time the emulator has been active in .ms
1032
+ uint64 uptime = 2;
849
1033
 
850
- // True if the device has completed booting.
851
- // For P and later this information will accurate,
852
- // for older images we rely on adb.
853
- bool booted = 3;
1034
+ // True if the device has completed booting.
1035
+ // For P and later this information will accurate,
1036
+ // for older images we rely on adb.
1037
+ bool booted = 3;
854
1038
 
855
- // The current vm configuration
856
- VmConfiguration vmConfig = 4;
1039
+ // The current vm configuration
1040
+ VmConfiguration vmConfig = 4;
857
1041
 
858
- // The hardware configuration of the running emulator as
859
- // key valure pairs.
860
- EntryList hardwareConfig = 5;
861
- };
1042
+ // The hardware configuration of the running emulator as
1043
+ // key valure pairs.
1044
+ EntryList hardwareConfig = 5;
1045
+ }
862
1046
 
863
1047
  message AudioFormat {
864
- enum SampleFormat {
865
- AUD_FMT_U8 = 0; // Unsigned 8 bit
866
- AUD_FMT_S16 = 1; // Signed 16 bit (little endian)
867
- };
868
-
869
- enum Channels {
870
- Mono = 0;
871
- Stereo = 1;
872
- };
873
-
874
- // Sampling rate to use, defaulting to 44100 if this is not set.
875
- // Note, that android devices typically will not use a sampling
876
- // rate higher than 48kHz. See https://developer.android.com/ndk/guides/audio.
877
- uint64 samplingRate = 1;
878
- Channels channels = 2;
879
- SampleFormat format = 3;
880
- };
1048
+ enum SampleFormat {
1049
+ AUD_FMT_U8 = 0; // Unsigned 8 bit
1050
+ AUD_FMT_S16 = 1; // Signed 16 bit (little endian)
1051
+ }
1052
+
1053
+ enum Channels {
1054
+ Mono = 0;
1055
+ Stereo = 1;
1056
+ }
1057
+
1058
+ enum DeliveryMode {
1059
+ // The audio queue will block and wait until the emulator requests
1060
+ // packets. The client does not have to throttle and can push packets at
1061
+ // will. This can result in the client falling behind.
1062
+ MODE_UNSPECIFIED = 0;
1063
+ // Audio packets will be delivered in real time (when possible). The
1064
+ // audio queue will be overwritten with incoming data if data is made
1065
+ // available. This means the client needs to control timing properly, or
1066
+ // packets will get overwritten.
1067
+ MODE_REAL_TIME = 1; //
1068
+ }
1069
+ // Sampling rate to use, defaulting to 44100 if this is not set.
1070
+ // Note, that android devices typically will not use a sampling
1071
+ // rate higher than 48kHz. See
1072
+ // https://developer.android.com/ndk/guides/audio.
1073
+ uint64 samplingRate = 1;
1074
+ Channels channels = 2;
1075
+ SampleFormat format = 3;
1076
+
1077
+ // [Input Only]
1078
+ // The mode used when delivering audio packets.
1079
+ DeliveryMode mode = 4;
1080
+ }
881
1081
 
882
1082
  message AudioPacket {
883
- AudioFormat format = 1;
1083
+ AudioFormat format = 1;
884
1084
 
885
- // Unix epoch in us when this frame was captured.
886
- uint64 timestamp = 2;
1085
+ // Unix epoch in us when this frame was captured.
1086
+ uint64 timestamp = 2;
887
1087
 
888
- // Contains a sample in the given audio format.
889
- bytes audio = 3;
1088
+ // Contains a sample in the given audio format.
1089
+ bytes audio = 3;
890
1090
  }
891
1091
 
892
1092
  message SmsMessage {
893
- // The source address where this message came from.
894
- //
895
- // The address should be a valid GSM-formatted address as specified by
896
- // 3GPP 23.040 Sec 9.1.2.5.
897
- //
898
- // For example: +3106225412 or (650) 555-1221
899
- string srcAddress = 1;
900
-
901
- // A utf8 encoded text message that should be delivered.
902
- string text = 2;
1093
+ // The source address where this message came from.
1094
+ //
1095
+ // The address should be a valid GSM-formatted address as specified by
1096
+ // 3GPP 23.040 Sec 9.1.2.5.
1097
+ //
1098
+ // For example: +3106225412 or (650) 555-1221
1099
+ string srcAddress = 1;
1100
+
1101
+ // A utf8 encoded text message that should be delivered.
1102
+ string text = 2;
903
1103
  }
904
1104
 
905
1105
  // A DisplayConfiguration describes a primary or secondary
@@ -918,97 +1118,183 @@ message SmsMessage {
918
1118
  // this method. By default, virtual displays are created to be private,
919
1119
  // non-presentation and unsecure.
920
1120
  message DisplayConfiguration {
1121
+ // These are the set of known android flags and their respective values.
1122
+ // you can combine the int values to (de)construct the flags field below.
1123
+ enum DisplayFlags {
1124
+ DISPLAYFLAGS_UNSPECIFIED = 0;
1125
+
1126
+ // When this flag is set, the virtual display is public.
1127
+ // A public virtual display behaves just like most any other display
1128
+ // that is connected to the system such as an external or wireless
1129
+ // display. Applications can open windows on the display and the system
1130
+ // may mirror the contents of other displays onto it. see:
1131
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PUBLIC
1132
+ VIRTUAL_DISPLAY_FLAG_PUBLIC = 1;
1133
+
1134
+ // When this flag is set, the virtual display is registered as a
1135
+ // presentation display in the presentation display category.
1136
+ // Applications may automatically project their content to presentation
1137
+ // displays to provide richer second screen experiences.
1138
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PRESENTATION
1139
+ VIRTUAL_DISPLAY_FLAG_PRESENTATION = 2;
1140
+
1141
+ // When this flag is set, the virtual display is considered secure as
1142
+ // defined by the Display#FLAG_SECURE display flag. The caller promises
1143
+ // to take reasonable measures, such as over-the-air encryption, to
1144
+ // prevent the contents of the display from being intercepted or
1145
+ // recorded on a persistent medium.
1146
+ // see:
1147
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_SECURE
1148
+ VIRTUAL_DISPLAY_FLAG_SECURE = 4;
1149
+
1150
+ // This flag is used in conjunction with VIRTUAL_DISPLAY_FLAG_PUBLIC.
1151
+ // Ordinarily public virtual displays will automatically mirror the
1152
+ // content of the default display if they have no windows of their own.
1153
+ // When this flag is specified, the virtual display will only ever show
1154
+ // its own content and will be blanked instead if it has no windows. See
1155
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
1156
+ VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY = 8;
1157
+
1158
+ // Allows content to be mirrored on private displays when no content is
1159
+ // being shown.
1160
+ // This flag is mutually exclusive with
1161
+ // VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY. If both flags are specified
1162
+ // then the own-content only behavior will be applied.
1163
+ // see:
1164
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR)
1165
+ VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR = 16;
1166
+ }
921
1167
 
922
- // These are the set of known android flags and their respective values.
923
- // you can combine the int values to (de)construct the flags field below.
924
- enum DisplayFlags {
925
- DISPLAYFLAGS_UNSPECIFIED = 0;
926
-
927
- // When this flag is set, the virtual display is public.
928
- // A public virtual display behaves just like most any other display
929
- // that is connected to the system such as an external or wireless
930
- // display. Applications can open windows on the display and the system
931
- // may mirror the contents of other displays onto it. see:
932
- // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PUBLIC
933
- VIRTUAL_DISPLAY_FLAG_PUBLIC = 1;
934
-
935
- // When this flag is set, the virtual display is registered as a
936
- // presentation display in the presentation display category.
937
- // Applications may automatically project their content to presentation
938
- // displays to provide richer second screen experiences.
939
- // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PRESENTATION
940
- VIRTUAL_DISPLAY_FLAG_PRESENTATION = 2;
941
-
942
- // When this flag is set, the virtual display is considered secure as
943
- // defined by the Display#FLAG_SECURE display flag. The caller promises
944
- // to take reasonable measures, such as over-the-air encryption, to
945
- // prevent the contents of the display from being intercepted or
946
- // recorded on a persistent medium.
947
- // see:
948
- // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_SECURE
949
- VIRTUAL_DISPLAY_FLAG_SECURE = 4;
950
-
951
- // This flag is used in conjunction with VIRTUAL_DISPLAY_FLAG_PUBLIC.
952
- // Ordinarily public virtual displays will automatically mirror the
953
- // content of the default display if they have no windows of their own.
954
- // When this flag is specified, the virtual display will only ever show
955
- // its own content and will be blanked instead if it has no windows. See
956
- // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
957
- VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY = 8;
958
-
959
- // Allows content to be mirrored on private displays when no content is
960
- // being shown.
961
- // This flag is mutually exclusive with
962
- // VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY. If both flags are specified
963
- // then the own-content only behavior will be applied.
964
- // see:
965
- // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR)
966
- VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR = 16;
967
- }
968
-
969
- // The width of the display, restricted to:
970
- // 320 * (dpi / 160) <= width
971
- uint32 width = 1;
972
-
973
- // The heigh of the display, restricted to:
974
- // * 320 * (dpi / 160) <= height
975
- uint32 height = 2;
976
-
977
- // The pixel density (dpi).
978
- // See https://developer.android.com/training/multiscreen/screendensities
979
- // for details. This value shoud be in the range [120, ..., 640]
980
- uint32 dpi = 3;
981
-
982
- // A combination of virtual display flags. These flags can be constructed
983
- // by combining the DisplayFlags enum described above.
984
- //
985
- // The behavior of the virtual display depends on the flags. By default
986
- // virtual displays are created to be private, non-presentation and
987
- // unsecure.
988
- uint32 flags = 4;
989
-
990
- // The id of the display.
991
- // The primary (default) display has the display ID of 0.
992
- // A secondary display has a display ID not 0.
993
- //
994
- // The id can be used to get or stream a screenshot.
995
- uint32 display = 5;
1168
+ // The width of the display, restricted to:
1169
+ // 320 * (dpi / 160) <= width
1170
+ uint32 width = 1;
1171
+
1172
+ // The heigh of the display, restricted to:
1173
+ // * 320 * (dpi / 160) <= height
1174
+ uint32 height = 2;
1175
+
1176
+ // The pixel density (dpi).
1177
+ // See https://developer.android.com/training/multiscreen/screendensities
1178
+ // for details. This value should be in the range [120, ..., 640]
1179
+ uint32 dpi = 3;
1180
+
1181
+ // A combination of virtual display flags. These flags can be constructed
1182
+ // by combining the DisplayFlags enum described above.
1183
+ //
1184
+ // The behavior of the virtual display depends on the flags. By default
1185
+ // virtual displays are created to be private, non-presentation and
1186
+ // unsecure.
1187
+ uint32 flags = 4;
1188
+
1189
+ // The id of the display.
1190
+ // The primary (default) display has the display ID of 0.
1191
+ // A secondary display has a display ID not 0.
1192
+ //
1193
+ // A display with the id in the range [1, userConfigurable]
1194
+ // can be modified. See DisplayConfigurations below for details.
1195
+ //
1196
+ // The id can be used to get or stream a screenshot.
1197
+ uint32 display = 5;
996
1198
  }
997
-
1199
+ // Provides information about all the displays that can be attached
1200
+ // to the emulator. The emulator will always have at least one display.
1201
+ //
1202
+ // The emulator usually has the following display configurations:
1203
+ // 0: The default display.
1204
+ // 1 - 3: User configurable displays. These can be added/removed.
1205
+ // For example the standalone emulator allows you to modify these
1206
+ // in the extended controls.
1207
+ // 6 - 11: Fixed external displays. For example Android Auto uses fixed
1208
+ // displays in this range.
998
1209
  message DisplayConfigurations {
999
- repeated DisplayConfiguration displays = 1;
1210
+ repeated DisplayConfiguration displays = 1;
1211
+
1212
+ // Display configurations with id [1, userConfigurable] are
1213
+ // user configurable, that is they can be added, removed or
1214
+ // updated.
1215
+ uint32 userConfigurable = 2;
1216
+
1217
+ // The maximum number of attached displays this emulator supports.
1218
+ // This is the total number of displays that can be attached to
1219
+ // the emulator.
1220
+ //
1221
+ // Note: A display with an id that is larger than userConfigurable cannot
1222
+ // be modified.
1223
+ uint32 maxDisplays = 3;
1000
1224
  }
1001
1225
 
1002
1226
  message Notification {
1003
- enum EventType {
1004
- VIRTUAL_SCENE_CAMERA_INACTIVE = 0;
1005
- VIRTUAL_SCENE_CAMERA_ACTIVE = 1;
1227
+ enum EventType {
1228
+ VIRTUAL_SCENE_CAMERA_INACTIVE = 0;
1229
+ VIRTUAL_SCENE_CAMERA_ACTIVE = 1;
1230
+
1231
+ // Fired when an update to a display event has been fired through
1232
+ // the extended ui. This does not fire events when the display
1233
+ // is changed through the console or gRPC endpoint.
1234
+ DISPLAY_CONFIGURATIONS_CHANGED_UI = 2;
1235
+ // Keep adding more for other event types
1236
+ }
1006
1237
 
1007
- // Fired when an update to a display event has been fired through
1008
- // the extended ui.
1009
- MULTIDISPLAY_EXTENDED_UI_EVENT = 2;
1010
- // Keep adding more for other event types
1011
- }
1238
+ // Deprecated, use the type below to get detailed information
1239
+ // regarding the event.
1240
+ EventType event = 1 [deprecated = true];
1241
+
1242
+ // Detailed notification information.
1243
+ oneof type {
1244
+ CameraNotification cameraNotification = 2;
1245
+ DisplayConfigurationsChangedNotification
1246
+ displayConfigurationsChangedNotification = 3;
1247
+ }
1248
+ }
1249
+
1250
+ // Fired when the virtual scene camera is activated or deactivated and also in
1251
+ // response to the streamNotification call.
1252
+ message CameraNotification {
1253
+ // Indicates whether the camera app was activated or deactivated.
1254
+ bool active = 1;
1255
+ // The display the camera app is associated with.
1256
+ int32 display = 2;
1257
+ }
1258
+
1259
+ // Fired when an update to a display event has been fired through the extended
1260
+ // ui. This does not fire events when the display is changed through the console
1261
+ // or the gRPC endpoint.
1262
+ message DisplayConfigurationsChangedNotification {
1263
+ DisplayConfigurations displayConfigurations = 1;
1264
+ }
1265
+
1266
+ message RotationRadian {
1267
+ float x = 1; // x axis is horizontal and orthogonal to the view direction.
1268
+ float y = 2; // y axis points up and is perpendicular to the floor.
1269
+ float z = 3; // z axis is the view direction and is set to 0.0 in
1270
+ // rotateVirtualSceneCamera call.
1271
+ }
1272
+
1273
+ message Velocity {
1274
+ float x = 1; // x axis is horizontal and orthogonal to the view direction.
1275
+ float y = 2; // y axis points up and is perpendicular to the floor.
1276
+ float z = 3; // z axis is the view direction
1277
+ }
1278
+
1279
+ // must follow the definition in "external/qemu/android/hw-sensors.h"
1280
+ message Posture {
1281
+ enum PostureValue {
1282
+ POSTURE_UNKNOWN = 0;
1283
+ POSTURE_CLOSED = 1;
1284
+ POSTURE_HALF_OPENED = 2;
1285
+ POSTURE_OPENED = 3;
1286
+ POSTURE_FLIPPED = 4;
1287
+ POSTURE_TENT = 5;
1288
+ POSTURE_MAX = 6;
1289
+ }
1290
+ PostureValue value = 3;
1291
+ }
1012
1292
 
1013
- EventType event = 1;
1293
+ message PhoneNumber {
1294
+ //
1295
+ // The phone number should be a valid GSM-formatted number as specified by
1296
+ // 3GPP 23.040 Sec 9.1.2.5.
1297
+ //
1298
+ // For example: +3106225412 or (650) 555-1221
1299
+ string number = 1;
1014
1300
  }