@aiot-toolkit/emulator 2.0.5-beta.9 → 2.0.5-widget-provider-beta.2

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