@tapflowio/android-agent 0.6.0 → 0.7.0

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,1813 @@
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
+ // This RPC is not implemented in EmulatorController and will return an unimplemented error.
49
+ rpc streamSensor(SensorValue) returns (stream SensorValue) {}
50
+ // Gets the current value of a specified sensor.
51
+ //
52
+ // The following gRPC error codes can be returned:
53
+ // - INTERNAL (code 13) if `getSensorSize` fails to retrieve sensor dimensions.
54
+ //
55
+ // The `status` field in the `SensorValue` reply indicates the operational state:
56
+ // - `OK` (0): Sensor data retrieved successfully.
57
+ // - `UNKNOWN` (2): Unknown sensor type (should not happen if using valid `SensorType`).
58
+ // - `DISABLED` (3): The sensor is disabled.
59
+ // - `NO_SERVICE` (4): The `qemud` service responsible for sensors is not available or initiated.
60
+ rpc getSensor(SensorValue) returns (SensorValue) {}
61
+ // Sets the override value for a specified sensor. This operation is asynchronous
62
+ // and executed on the emulator's main looper. An immediate subsequent `getSensor`
63
+ // call might not reflect the newly set value.
64
+ //
65
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
66
+ // No specific gRPC error codes are returned by this method itself, but underlying
67
+ // operations might log warnings if the sensor agent is unavailable.
68
+ rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
69
+
70
+ // set/get/stream the physical model, this is likely the one you are
71
+ // looking for when you wish to modify the device state.
72
+ //
73
+ // This operation is asynchronous and executed on the emulator's main looper. An immediate subsequent `getPhysicalModel`
74
+ // call might not reflect the newly set value. The `interpolation` field from the request is used to determine the
75
+ // physical interpolation method, mapped using `abs((static_cast<int>(physicalValue.interpolation())) - 1)`.
76
+ //
77
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
78
+ rpc setPhysicalModel(PhysicalModelValue) returns (google.protobuf.Empty) {}
79
+ // Gets the current value of a specified physical model parameter.
80
+ //
81
+ // The `status` field in the `PhysicalModelValue` reply indicates the operational state:
82
+ // - `OK` (0): Physical model data retrieved successfully.
83
+ // - `UNKNOWN` (2): Unknown physical type (should not happen if using valid `PhysicalType`).
84
+ // - `NO_SERVICE` (3): The `qemud` service responsible for physical parameters is not available or initiated.
85
+ rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
86
+ // This RPC is not implemented in EmulatorController and will return an unimplemented error.
87
+ rpc streamPhysicalModel(PhysicalModelValue)
88
+ returns (stream PhysicalModelValue) {}
89
+
90
+ // Atomically sets the current primary clipboard data. This operation is asynchronous
91
+ // and executed on the emulator's main looper. It triggers a `ClipboardEvent`
92
+ // to all listeners (except the originating channel) indicating the new content.
93
+ //
94
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
95
+ rpc setClipboard(ClipData) returns (google.protobuf.Empty) {}
96
+ // Retrieves the current primary clipboard data. This is a synchronous operation.
97
+ //
98
+ // This method returns `OK` (code 0) and the current `ClipData` upon success.
99
+ rpc getClipboard(google.protobuf.Empty) returns (ClipData) {}
100
+
101
+ // Streams real-time updates of the clipboard content. Upon subscription,
102
+ // it immediately sends the current clipboard state. Subsequent updates are
103
+ // streamed as new content becomes available from the guest or is set via `setClipboard`
104
+ // from a different client. Events originating from the same client that initiated
105
+ // the stream are filtered out to prevent echoing.
106
+ //
107
+ // It is possible to miss very rapid clipboard updates. The stream will block
108
+ // awaiting new events after the initial state is sent.
109
+ //
110
+ // This method returns a server-side streaming reactor.
111
+ rpc streamClipboard(google.protobuf.Empty) returns (stream ClipData) {}
112
+
113
+ // Sets the emulator's battery state to the provided values. This operation is
114
+ // executed asynchronously on the main looper.
115
+ //
116
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling
117
+ // of the operation. No explicit gRPC error codes are returned by this method.
118
+ rpc setBattery(BatteryState) returns (google.protobuf.Empty) {}
119
+ // Retrieves the current battery state from the emulator. This is a
120
+ // synchronous operation that waits for completion.
121
+ //
122
+ // This method returns `OK` (code 0) and populates the `BatteryState` reply
123
+ // with the current information upon success. No explicit gRPC error codes
124
+ // are returned by this method.
125
+ rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
126
+
127
+ // Sets the state of the GPS in the emulator. This operation is asynchronous
128
+ // and executed on the main looper. It updates the emulator's GPS location
129
+ // (latitude, longitude, altitude, speed, bearing, and satellites) and sets
130
+ // the timestamp.
131
+ //
132
+ // Note: Setting the GPS position will not be immediately reflected in the user
133
+ // interface. Android typically samples GPS at 1 Hz.
134
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling
135
+ // of the operation.
136
+ rpc setGps(GpsState) returns (google.protobuf.Empty) {}
137
+
138
+ // Gets the latest GPS state as reported by the emulator. This includes data
139
+ // delivered by previous `setGps` calls or from the location UI if active.
140
+ // This is a synchronous operation that waits for completion.
141
+ //
142
+ // Note: The returned GPS state is not necessarily the exact coordinate
143
+ // visible at the time due to Android's typical 1 Hz GPS sample frequency.
144
+ //
145
+ // This method returns `OK` (code 0) and populates the `GpsState` reply
146
+ // with the retrieved information upon success. No explicit gRPC error codes
147
+ // are returned by this method.
148
+ rpc getGps(google.protobuf.Empty) returns (GpsState) {}
149
+
150
+ // Simulates a touch event on the fingerprint sensor. This operation is
151
+ // executed asynchronously on the main looper.
152
+ //
153
+ // The `isTouching` field indicates whether the fingerprint sensor is being
154
+ // touched, and `touchId` specifies the identifier of the registered
155
+ // fingerprint. The `setTouch` agent function is used to apply these values.
156
+ //
157
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling
158
+ // of the operation. No explicit gRPC error codes are returned by this method.
159
+ rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
160
+
161
+ // Sends a keyboard event to the emulator. This operation is asynchronous
162
+ // and executed on the main looper.
163
+ //
164
+ // The `KeyboardEvent` message allows specifying input using `keyCode`, `key` (W3C standard string), or `text` (UTF-8 string).
165
+ // The `KeyEventSender` prioritizes `key`, then `keyCode`, then `text`.
166
+ // - If `key` is a non-printable W3C key string (e.g., "Backspace", "ArrowUp"), it's translated to an evdev keycode and sent.
167
+ // - If `key` is a printable Unicode character, it's converted to a sequence of evdev keydown/keyup events, handling modifiers.
168
+ // - If `keyCode` is provided, it's translated from its `codeType` (Usb, Evdev, XKB, Win, Mac) to an evdev keycode and sent as keydown/keyup pairs.
169
+ // - If `text` is provided, each UTF-8 character is converted to evdev keypress (keydown then keyup) events.
170
+ //
171
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
172
+ rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
173
+ // Sends touch events to the emulator. This operation is asynchronous and executed on the main looper.
174
+ //
175
+ // The `TouchEvent` contains a list of `Touch` objects, each with `x`, `y` coordinates, `identifier`, `pressure`, `touch_major`, `touch_minor`, `expiration`, and `orientation`.
176
+ // Coordinates are scaled to the emulator's display resolution. Each `Touch` `identifier` is mapped to an internal Linux multitouch slot.
177
+ // Expiration handling ensures that inactive touch events are properly "lifted" after 120 seconds.
178
+ //
179
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation. Warnings are logged if no touch slots are available.
180
+ rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
181
+ // Sends mouse events to the emulator. This operation is asynchronous and executed on the main looper.
182
+ //
183
+ // The `MouseEvent` specifies `x`, `y` coordinates, `buttons` state (bitmask: 1 for left, 2 for right), and `display` ID.
184
+ // In certain virtual input configurations (VirtioInput enabled, but VirtioMouse and VirtioTablet disabled), `buttons` may be masked to only consider the primary button.
185
+ // The event is sent to the emulator's `user_event_agent`.
186
+ //
187
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
188
+ rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
189
+ // Injects a stream of wheel events into the emulator. This is a server-side streaming RPC.
190
+ //
191
+ // Each `WheelEvent` contains `dx`, `dy` (delta values, `dy` is pre-multiplied by 120 for scroll clicks), and `display` ID.
192
+ // If the emulator's input device has rotary capabilities (e.g., AVD_WEAR flavor), `dy` is scaled and sent as a rotary event.
193
+ // Otherwise, it's sent as a standard mouse wheel event.
194
+ //
195
+ // This method returns a server-side streaming reactor.
196
+ rpc injectWheel(stream WheelEvent) returns (google.protobuf.Empty) {}
197
+
198
+ // Streams a series of generic input events to the emulator. The events are processed in the order they arrive.
199
+ // This is a server-side streaming RPC that supports various input types encapsulated within `InputEvent`'s `oneof type` field.
200
+ //
201
+ // Supported input types:
202
+ // - `key_event` (KeyboardEvent): Processed by `KeyEventSender` as described in `sendKey`.
203
+ // - `touch_event` (TouchEvent): Processed by `TouchEventSender` as described in `sendTouch`.
204
+ // - `mouse_event` (MouseEvent): Processed by `MouseEventSender` as described in `sendMouse`.
205
+ // - `android_event` (AndroidEvent): Raw Linux input events (`type`, `code`, `value`) sent directly to the kernel.
206
+ // - `pen_event` (PenEvent): Processed by `PenEventSender` for pen input, including pressure, orientation, and button state.
207
+ // - `wheel_event` (WheelEvent): Processed by `WheelEventSender` as described in `injectWheel`.
208
+ // - `xr_command` (XrCommand): Executes XR-specific commands (e.g., `RECENTER` to recenter the viewport). Unknown actions are logged as warnings.
209
+ // - `xr_head_rotation_event` (RotationRadian): Sends head rotation data in radians. Logs an error if the agent call fails.
210
+ // - `xr_head_movement_event` (Translation): Sends head movement data in meters. Logs an error if the agent call fails.
211
+ // - `xr_head_angular_velocity_event` (AngularVelocity): Sends head angular velocity data in radians per second. Logs an error if the agent call fails.
212
+ // - `xr_head_velocity_event` (Velocity): Sends head velocity data in meters per second. Logs an error if the agent call fails.
213
+ // - `touchpad_event` (TouchpadEvent): Processed by `TouchpadEventSender` for touchpad input, similar to touch events but for a touchpad device.
214
+ //
215
+ // All underlying input sending operations for XR events are executed asynchronously on the main looper.
216
+ //
217
+ // Returns `INVALID_ARGUMENT` (code 3) if an unrecognized input event type is received, indicating a potential out-of-date emulator.
218
+ // The stream reactor automatically deletes itself upon completion.
219
+ rpc streamInputEvent(stream InputEvent) returns (google.protobuf.Empty) {}
220
+
221
+ // Initiates or manipulates a phone call in the emulator. This is a synchronous
222
+ // operation executed on the main looper.
223
+ //
224
+ // The `PhoneCall` message specifies the `operation` (e.g., InitCall, AcceptCall)
225
+ // and the target phone `number`. The `telephonyCmd` agent function handles the
226
+ // actual call action.
227
+ //
228
+ // Returns a `PhoneResponse` indicating the outcome:
229
+ // - `OK` (0): The operation was successful.
230
+ // - `BadOperation` (1): The provided `operation` enum is out of range.
231
+ // - `BadNumber` (2): The provided `number` is malformed.
232
+ // - `InvalidAction` (3): The requested `operation` is invalid given the current call state (e.g., disconnecting when no call is active).
233
+ // - `ActionFailed` (4): An internal error occurred, typically if the modem agent is unavailable.
234
+ // - `RadioOff` (5): The emulator's radio is turned off.
235
+ rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
236
+
237
+ // Sends an SMS message to the emulator. This is a synchronous operation.
238
+ //
239
+ // The `SmsMessage` contains the `srcAddress` (source phone number) and the `text` of the message.
240
+ // The `srcAddress` is validated for GSM formatting. The message `text` is converted into SMS PDUs
241
+ // (Protocol Data Units) and delivered via the modem agent.
242
+ //
243
+ // Returns a `PhoneResponse` indicating the outcome:
244
+ // - `OK` (0): The SMS message was successfully delivered.
245
+ // - `BadNumber` (2): The `srcAddress` is malformed.
246
+ // - `ActionFailed` (4): An internal error occurred, e.g., if the modem agent is unavailable or PDU creation fails.
247
+ //
248
+ // Other error cases from PDU creation (e.g., invalid characters in text) also result in `ActionFailed`.
249
+ rpc sendSms(SmsMessage) returns (PhoneResponse) {}
250
+
251
+ // Sets the emulator's phone number. This is a synchronous operation.
252
+ //
253
+ // The `PhoneNumber` message contains the new `number` to be set. The modem agent's
254
+ // `amodem_update_phone_number` function is used for this update.
255
+ //
256
+ // Returns a `PhoneResponse` indicating the outcome:
257
+ // - `OK` (0): The phone number was successfully updated.
258
+ // - `BadNumber` (2): The provided `number` is invalid for the modem.
259
+ // - `ActionFailed` (4): An internal error occurred, typically if the modem agent is unavailable.
260
+ rpc setPhoneNumber(PhoneNumber) returns (PhoneResponse) {}
261
+
262
+ // Retrieves the current status of the emulator. This includes comprehensive
263
+ // information about the virtual machine's configuration and the guest operating system's state.
264
+ //
265
+ // The `EmulatorStatus` reply contains:
266
+ // - `version`: The emulator version string.
267
+ // - `uptime`: The time the emulator has been active in milliseconds.
268
+ // - `booted`: A boolean indicating if the device has completed booting.
269
+ // - `vmConfig`: Detailed `VmConfiguration` (hypervisor type, CPU cores, RAM size).
270
+ // - `hardwareConfig`: Key-value pairs describing the emulator's hardware configuration.
271
+ // - `heartbeat`: A monotonically increasing number indicating guest activity (incremented approximately once per second).
272
+ // - `guestConfig`: A map of key-value pairs with guest-specific configurations, including:
273
+ // - "multidisplay": "available" or "unavailable" based on display pipe readiness.
274
+ // - "androidVersion": The Android version of the guest OS.
275
+ // - "hypervisorVersion": The hypervisor version used by the guest.
276
+ //
277
+ // This method returns `OK` (code 0) upon successful retrieval of the emulator status.
278
+ rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
279
+
280
+ // Retrieves a single screenshot in the desired format.
281
+ //
282
+ // The image will be scaled to the `desiredWidth` and `desiredHeight` specified in `ImageFormat`, while maintaining
283
+ // the aspect ratio. If `width` or `height` are 0, the device's current display dimensions are used.
284
+ // The returned image will never exceed the device's actual display resolution, but can be smaller.
285
+ //
286
+ // The `display` field in `ImageFormat` specifies the target display; 0 (or omitted) indicates the main display.
287
+ // For folded Pixel Fold devices, the display ID might be internally remapped, and `foldedDisplay` information will be populated.
288
+ // The resulting image is properly oriented based on the device's coarse-grained orientation, derived from sensor state.
289
+ //
290
+ // The `transport` field in `ImageFormat` can specify `MMAP` for shared memory delivery, but if the shared memory region
291
+ // is too small, a `FAILED_PRECONDITION` error will be returned.
292
+ //
293
+ // This method returns:
294
+ // - `OK` (code 0) and an `Image` object upon success.
295
+ // - `INVALID_ARGUMENT` (code 3) if the specified `display` ID is invalid or disabled.
296
+ // - `CANCELLED` (code 1) if the gRPC context is cancelled during the operation (an expensive operation).
297
+ // - `FAILED_PRECONDITION` (code 9) if the guest has not posted a new frame yet (for non-PNG formats when fast path is used).
298
+ //
299
+ // This method will return an image with width 0 and height 0 if the display is not visible.
300
+ rpc getScreenshot(ImageFormat) returns (Image) {}
301
+
302
+ // Streams a series of screenshots in the desired format. This is a server-side streaming RPC.
303
+ //
304
+ // A new frame is delivered whenever the device produces a new frame or when sensor changes occur.
305
+ // Initial state: The first frame delivered might be an empty image (width 0, height 0) if the display is inactive.
306
+ // Subsequent frames are delivered when new content is available or a sensor event triggers an update.
307
+ // If the display becomes inactive, an empty image will be delivered again. Images resume when the display becomes active.
308
+ //
309
+ // `ImageFormat` parameters (format, width, height, display) behave as described in `getScreenshot`.
310
+ // The `transport` field in `ImageFormat` can specify `MMAP` for shared memory delivery. If `MMAP` is used and the
311
+ // provided shared memory handle is valid and mapped, pixel data will be written directly to it.
312
+ // The `image` field in the `Image` reply will be empty if `MMAP` transport is used.
313
+ //
314
+ // Performance considerations:
315
+ // - Streaming can produce a significant amount of data.
316
+ // - `PNG` format is CPU-intensive due to encoding overhead.
317
+ // - Using `MMAP` transport can significantly reduce gRPC overhead for pixel data.
318
+ //
319
+ // This method returns:
320
+ // - A server-side streaming reactor.
321
+ // - `INVALID_ARGUMENT` (code 3) if the specified `display` ID is invalid or disabled.
322
+ // - `CANCELLED` (code 1) if the gRPC context is cancelled during the operation.
323
+ rpc streamScreenshot(ImageFormat) returns (stream Image) {}
324
+
325
+ // Streams a series of audio packets in the desired format. This is a server-side streaming RPC.
326
+ // A new frame is delivered approximately every 20-30ms when the emulated device produces audio.
327
+ // If `samplingRate` is 0, it defaults to 44100 Hz.
328
+ // The stream may block indefinitely if the emulator ceases to produce audio.
329
+ // Packets are allocated with a buffer size calculated based on the audio format and a 30ms frame time.
330
+ //
331
+ // This method returns `OK` (code 0) upon successful streaming initiation.
332
+ rpc streamAudio(AudioFormat) returns (stream AudioPacket) {}
333
+
334
+ // Injects a series of audio packets into the Android microphone. This is a client-side streaming RPC.
335
+ // Audio packets are processed at a rate determined by the emulator's request for frames.
336
+ // An internal buffer can hold approximately 300ms of audio.
337
+ //
338
+ // Notes:
339
+ // - Only the `AudioFormat` from the first received packet is honored. Subsequent `AudioFormat` changes are ignored.
340
+ // - `MODE_REAL_TIME` is experimental: incoming data may overwrite existing data if the client does not control timing properly.
341
+ // - The circular buffer attempts to deliver all queued samples upon stream closure by writing silence for up to 300ms.
342
+ //
343
+ // Returns the following gRPC error codes:
344
+ // - `FAILED_PRECONDITION` (code 9): If another microphone is already active, or if unable to register the microphone.
345
+ // - `INVALID_ARGUMENT` (code 3): If the desired `samplingRate` exceeds 48kHz, or if an `AudioPacket` is too large for the internal buffer.
346
+ //
347
+ // This method returns `OK` (code 0) upon successful completion of the stream.
348
+ rpc injectAudio(stream AudioPacket) returns (google.protobuf.Empty) {}
349
+
350
+ // Retrieves the current settings for the microphone
351
+ rpc getMicrophoneState(google.protobuf.Empty) returns (MicrophoneState) {}
352
+
353
+ // Sets the state for the microphone
354
+ rpc setMicrophoneState(MicrophoneState) returns (google.protobuf.Empty) {}
355
+
356
+ // Deprecated, please use the streamLogcat method instead.
357
+ rpc getLogcat(LogMessage) returns (LogMessage) {
358
+ option deprecated = true;
359
+ }
360
+
361
+ // Streams the logcat output from the emulator in real-time. This is a server-side streaming RPC.
362
+ // The stream sources its data from the `logcat` command executed via `AdbShellStream` in the Android guest.
363
+ // Log lines are processed individually as they arrive.
364
+ //
365
+ // The `LogMessage.sort` field determines the output format:
366
+ // - If `LogMessage.sort` is `Parsed`, each incoming log line is parsed into a structured `LogcatEntry` object,
367
+ // and these entries are returned in the `LogMessage.entries` field. Structured parsing is typically
368
+ // available for Android API Level 23 (Marshmallow) and later.
369
+ // - If `LogMessage.sort` is `Text` (or unspecified), the raw log line is returned in the `LogMessage.contents` field.
370
+ //
371
+ // The stream continues as long as the underlying `logcat` process is running and the client is connected.
372
+ // The stream will naturally terminate if the `logcat` process stops or the connection is lost.
373
+ // No explicit gRPC error codes are returned by this method during active streaming.
374
+ rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
375
+
376
+ // Transitions the virtual machine to the desired state. This operation is asynchronous
377
+ // and executed on the QEMU looper to handle necessary IO locks. Note that some states
378
+ // (e.g., `UNKNOWN`, `RESTORE_VM`, `SAVE_VM`, `INTERNAL_ERROR`) are purely observable
379
+ // and cannot be set directly.
380
+ //
381
+ // The `VmRunState.state` field triggers specific VM operations:
382
+ // - `RESET`: Calls `vmReset()` to reset the VM.
383
+ // - `SHUTDOWN`: Calls `skin_winsys_quit_request()` for a graceful shutdown, similar to closing the emulator GUI.
384
+ // - `TERMINATE`: Forcefully kills the emulator process. This can lead to system corruption and should be used with extreme caution.
385
+ // - `PAUSED`: Calls `vmPause()` to pause the VM, halting CPU cycles.
386
+ // - `RUNNING`: Calls `vmResume()` to resume the VM.
387
+ // - `RESTART`: Calls `ui->requestRestart()` to perform a full emulator restart.
388
+ // - `START`: Calls `vmStart()` to resume a stopped emulator.
389
+ // - `STOP`: Calls `vmStop()` to stop (pause) a running emulator.
390
+ //
391
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
392
+ rpc setVmState(VmRunState) returns (google.protobuf.Empty) {}
393
+
394
+ // Retrieves the current run state of the virtual machine. This is a synchronous operation.
395
+ //
396
+ // Internal QEMU run states are mapped to `VmRunState.RunState` as follows:
397
+ // - `QEMU_RUN_STATE_PAUSED` and `QEMU_RUN_STATE_SUSPENDED` map to `PAUSED`.
398
+ // - `QEMU_RUN_STATE_RESTORE_VM` maps to `RESTORE_VM`.
399
+ // - `QEMU_RUN_STATE_RUNNING` maps to `RUNNING`.
400
+ // - `QEMU_RUN_STATE_SAVE_VM` maps to `SAVE_VM`.
401
+ // - `QEMU_RUN_STATE_SHUTDOWN` maps to `SHUTDOWN`.
402
+ // - `QEMU_RUN_STATE_GUEST_PANICKED`, `QEMU_RUN_STATE_INTERNAL_ERROR`, and `QEMU_RUN_STATE_IO_ERROR` map to `INTERNAL_ERROR`.
403
+ // - Any other states default to `UNKNOWN`.
404
+ //
405
+ // This method returns `OK` (code 0) and populates the `VmRunState` reply with the current VM state.
406
+ rpc getVmState(google.protobuf.Empty) returns (VmRunState) {}
407
+
408
+ // Atomically changes the current multi-display configuration. This operation applies
409
+ // the provided `DisplayConfigurations`, with special handling for secondary displays.
410
+ // Display ID 0 (the primary display) cannot be modified via this RPC.
411
+ //
412
+ // Preconditions:
413
+ // - The `android::featurecontrol::MultiDisplay` feature must be enabled.
414
+ //
415
+ // Input Validation:
416
+ // - `INVALID_ARGUMENT` (code 3): If duplicate `display` IDs are found in the request.
417
+ // - `INVALID_ARGUMENT` (code 3): If any `DisplayConfiguration` (width, height, dpi, flags)
418
+ // is outside valid ranges as determined by `multiDisplayParamValidate`.
419
+ // - `INVALID_ARGUMENT` (code 3): If any `display` ID is outside the configurable range
420
+ // `[1, userConfigurable]`.
421
+ //
422
+ // Atomic Update and Rollback:
423
+ // The system attempts to apply each display configuration. If any update fails
424
+ // (e.g., after multiple retries for transient pipe errors), a rollback mechanism
425
+ // is initiated: successfully updated displays are reverted to their previous state,
426
+ // and newly added displays are deleted. In such cases, an `INTERNAL` error is returned.
427
+ //
428
+ // Deletion of Unrequested Displays:
429
+ // Any displays that were active before this call but are not present in the new
430
+ // `request.displays` (and are not display ID 0) will be deleted.
431
+ //
432
+ // Notifications:
433
+ // Upon successful completion, `notifyDisplayChanges()` is called to inform
434
+ // third-party subscribers.
435
+ //
436
+ // Returns the following gRPC error codes:
437
+ // - `OK` (code 0): Upon successful application of all configurations, returning the final active `DisplayConfigurations`.
438
+ // - `FAILED_PRECONDITION` (code 9): If the multi-display feature is not available.
439
+ // - `INTERNAL` (code 13): If an internal emulator failure occurs during display modification or rollback.
440
+ rpc setDisplayConfigurations(DisplayConfigurations)
441
+ returns (DisplayConfigurations) {}
442
+
443
+ // Returns all currently valid logical displays configured in the emulator. This is a synchronous operation.
444
+ //
445
+ // Preconditions:
446
+ // - The `android::featurecontrol::MultiDisplay` feature must be enabled.
447
+ //
448
+ // The `DisplayConfigurations` reply contains:
449
+ // - `displays`: A repeated field of `DisplayConfiguration` objects, each detailing
450
+ // the width, height, DPI, flags, and ID of an active display.
451
+ // For Pixel Fold devices, only the main display configuration might be relevant.
452
+ // - `userConfigurable`: The maximum number of user-configurable displays (IDs from 1 up to this value).
453
+ // - `maxDisplays`: The total maximum number of displays the emulator supports.
454
+ //
455
+ // This method returns:
456
+ // - `OK` (code 0) and the current `DisplayConfigurations` upon success.
457
+ // - `FAILED_PRECONDITION` (code 9): If the AVD does not support the multi-display feature.
458
+ rpc getDisplayConfigurations(google.protobuf.Empty)
459
+ returns (DisplayConfigurations) {}
460
+
461
+ // Notifies the client of various emulator state changes in real-time. This is a server-side streaming RPC.
462
+ // Upon subscription, the current states of virtual scene camera, foldable posture, boot completion,
463
+ // and XR options are immediately sent. The stream then continuously delivers new notifications
464
+ // when relevant events occur. `UniqueEventStreamWriter` ensures that only distinct state changes are streamed.
465
+ //
466
+ // Notifications include:
467
+ // - `CameraNotification`: Reports virtual scene camera activation/deactivation and associated display.
468
+ // - `DisplayConfigurationsChangedNotification`: Triggered when display configurations are modified via the extended UI. Does not fire for changes made through console or gRPC.
469
+ // - `Posture`: Reports changes in the device's foldable posture.
470
+ // - `BootCompletedNotification`: Indicates when the emulator has finished booting.
471
+ // - `BrightnessValue`: Reports changes in backlight brightness (LCD, keyboard, or button).
472
+ // - `TextViewFocus`: Sent when a text view gains or loses focus, or immediately on subscription.
473
+ // - `XrOptions`: Reports changes in XR-related settings (environment, passthrough coefficient), or immediately on subscription.
474
+ // - `MicrophoneState` : Reports changes in the microphone state (currently whether host microphone access is allowed)
475
+ //
476
+ // This method returns a server-side streaming reactor.
477
+ rpc streamNotification(google.protobuf.Empty)
478
+ returns (stream Notification) {}
479
+
480
+ // Rotates the virtual scene camera relative to its current orientation. This operation is asynchronous
481
+ // and executed on the main looper.
482
+ //
483
+ // The `RotationRadian` message specifies angles in radians around the x, y, and z axes. The z component of rotation is currently unused.
484
+ // The coordinate system is right-handed: x-axis points right, y-axis points up, and z-axis points towards the viewer.
485
+ // This operation only succeeds if the virtual scene camera is actively connected.
486
+ //
487
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
488
+ rpc rotateVirtualSceneCamera(RotationRadian)
489
+ returns (google.protobuf.Empty) {}
490
+ // Sets the absolute velocity of the virtual scene camera. This operation is asynchronous
491
+ // and executed on the main looper.
492
+ //
493
+ // The `Velocity` message specifies components in meters per second along the x, y, and z axes.
494
+ // The coordinate system is right-handed: x-axis points right, y-axis points up, and z-axis points towards the viewer.
495
+ // The transition to these target velocity values may be smoothed over time by the implementation.
496
+ // This operation only succeeds if the virtual scene camera is actively connected.
497
+ //
498
+ // This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
499
+ rpc setVirtualSceneCameraVelocity(Velocity)
500
+ returns (google.protobuf.Empty) {}
501
+ // Sets the foldable posture of the device. This operation is asynchronous
502
+ // and executed on the main looper.
503
+ //
504
+ // The `Posture` message contains a `PostureValue` enum, defining the desired
505
+ // physical configuration of the foldable device.
506
+ //
507
+ // Returns the following gRPC error codes:
508
+ // - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
509
+ // - `FAILED_PRECONDITION` (code 9): If the emulator is unable to set the specified posture.
510
+ rpc setPosture(Posture) returns (google.protobuf.Empty) {}
511
+
512
+ // Retrieves the current backlight brightness for a specified light type. This is a synchronous operation.
513
+ //
514
+ // The `BrightnessValue.target` field (e.g., `LCD`, `KEYBOARD`, `BUTTON`) determines which light's brightness is queried.
515
+ // Internal mapping converts these to string names like "lcd_backlight".
516
+ //
517
+ // Returns the following gRPC error codes:
518
+ // - `OK` (code 0): Upon successful retrieval, populating the `BrightnessValue` reply with the `target` and current `value`.
519
+ // - `FAILED_PRECONDITION` (code 9): If the AVD does not support the `hw-control` agent or its `getBrightness` function is unavailable.
520
+ rpc getBrightness(BrightnessValue) returns (BrightnessValue) {}
521
+
522
+ // Sets the backlight brightness for a specified light type. This operation is asynchronous
523
+ // and executed on the main looper.
524
+ //
525
+ // The `BrightnessValue.target` field (e.g., `LCD`, `KEYBOARD`, `BUTTON`) determines which light's brightness is set.
526
+ // The `BrightnessValue.value` specifies the desired intensity, ranging from 0 to 255.
527
+ // Internal mapping converts `LightType` to string names like "lcd_backlight".
528
+ //
529
+ // Returns the following gRPC error codes:
530
+ // - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
531
+ // - `FAILED_PRECONDITION` (code 9): If the AVD does not support the `hw-control` agent or its `setBrightness` function is unavailable.
532
+ // - `INVALID_ARGUMENT` (code 3): If the `brightness` value exceeds the valid range (0-255).
533
+ rpc setBrightness(BrightnessValue) returns (google.protobuf.Empty) {}
534
+
535
+ // Returns the current mode of the primary display of a resizable AVD. This is a synchronous operation.
536
+ //
537
+ // Preconditions:
538
+ // - The AVD must be configured to support resizable displays (`resizableEnabled()` must be true).
539
+ //
540
+ // The `DisplayMode.value` field will be populated with the current `DisplayModeValue`,
541
+ // derived from the `getResizableActiveConfigId()`.
542
+ //
543
+ // Returns the following gRPC error codes:
544
+ // - `OK` (code 0): Upon successful retrieval of the display mode.
545
+ // - `FAILED_PRECONDITION` (code 9): If the AVD is not resizable.
546
+ rpc getDisplayMode(google.protobuf.Empty) returns (DisplayMode) {}
547
+
548
+ // Sets the size of the primary display of a resizable AVD to the specified `DisplayModeValue`. This operation is asynchronous
549
+ // and executed on the main looper.
550
+ //
551
+ // Preconditions:
552
+ // - The AVD must be configured to support resizable displays (`resizableEnabled()` must be true).
553
+ // - The emulator's `changeResizableDisplay` agent function must be available.
554
+ //
555
+ // The `DisplayMode.value` field specifies the desired display configuration (e.g., `PHONE`, `FOLDABLE`, `TABLET`, `DESKTOP`).
556
+ //
557
+ // Returns the following gRPC error codes:
558
+ // - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
559
+ // - `FAILED_PRECONDITION` (code 9): If the AVD is not resizable.
560
+ // - `INTERNAL` (code 13): If the internal window agent function `changeResizableDisplay` is not available.
561
+ rpc setDisplayMode(DisplayMode) returns (google.protobuf.Empty) {}
562
+
563
+ // Changes the XR-related settings of the emulator. This operation is asynchronous
564
+ // and executed on the main looper.
565
+ //
566
+ // The `XrOptions` message specifies the `environment` (e.g., `LIVING_ROOM_DAY`, `LIVING_ROOM_NIGHT`)
567
+ // and `passthrough_coefficient` (a float between 0.0 and 1.0 for real/artificial environment visibility).
568
+ // Values for `passthrough_coefficient` outside [0.0, 1.0] are ignored.
569
+ //
570
+ // Returns the following gRPC error codes:
571
+ // - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
572
+ // - `FAILED_PRECONDITION` (code 9): If the `setXrOptions` agent function fails (e.g., if XR is not supported).
573
+ rpc setXrOptions(XrOptions) returns (google.protobuf.Empty) {}
574
+
575
+ // Retrieves the current state of XR-related settings from the emulator. This is a synchronous operation.
576
+ //
577
+ // Preconditions:
578
+ // - XR mode must be supported in the current AVD (`isXrGuestOs()` must be true).
579
+ // (Note: Current implementation of `isXrGuestOs()` always returns true).
580
+ //
581
+ // The `XrOptions` reply contains the current `environment` and `passthrough_coefficient`.
582
+ //
583
+ // Returns the following gRPC error codes:
584
+ // - `OK` (code 0): Upon successful retrieval of the XR options.
585
+ // - `FAILED_PRECONDITION` (code 9): If XR mode is not supported in the current AVD or if the `getXrOptions` agent function fails.
586
+ rpc getXrOptions(google.protobuf.Empty) returns (XrOptions) {}
587
+
588
+ // Sets the environment background for AI glasses.
589
+ rpc setEnvironment(Environment) returns (google.protobuf.Empty) {}
590
+ }
591
+
592
+ // A Run State that describes the state of the Virtual Machine.
593
+ message VmRunState {
594
+ enum RunState {
595
+ // The emulator is in an unknown state. You cannot transition to this
596
+ // state.
597
+ UNKNOWN = 0;
598
+ // Guest is actively running. You can transition to this state from the
599
+ // paused state.
600
+ RUNNING = 1;
601
+ // Guest is paused to load a snapshot. You cannot transition to this
602
+ // state.
603
+ RESTORE_VM = 2;
604
+ // Guest has been paused. Transitioning to this state will pause the
605
+ // emulator the guest will not be consuming any cpu cycles.
606
+ PAUSED = 3;
607
+ // Guest is paused to take or export a snapshot. You cannot
608
+ // transition to this state.
609
+ SAVE_VM = 4;
610
+ // System shutdown, note that it is similar to power off. It tries to
611
+ // set the system status and notify guest. The system is likely going to
612
+ // disappear soon and do proper cleanup of resources, possibly taking
613
+ // a snapshot. This is the same behavior as closing the emulator by
614
+ // clicking the X (close) in the user interface.
615
+ SHUTDOWN = 5;
616
+ // Immediately terminate the emulator. No resource cleanup will take
617
+ // place. There is a good change to corrupt the system.
618
+ TERMINATE = 7;
619
+ // Will cause the emulator to reset. This is not a state you can
620
+ // observe.
621
+ RESET = 9;
622
+ // Guest experienced some error state, you cannot transition to this
623
+ // state.
624
+ INTERNAL_ERROR = 10;
625
+ // Completely restart the emulator.
626
+ RESTART = 11;
627
+ // Resume a stopped emulator
628
+ START = 12;
629
+ // Stop (pause) a running emulator
630
+ STOP = 13;
631
+ }
632
+
633
+ RunState state = 1;
634
+ }
635
+
636
+ message ParameterValue {
637
+ repeated float data = 1 [packed = true];
638
+ }
639
+
640
+ message PhysicalModelValue {
641
+ enum State {
642
+ OK = 0;
643
+ NO_SERVICE = -3; // qemud service is not available/initiated.
644
+ DISABLED = -2; // Sensor is disabled.
645
+ UNKNOWN = -1; // Unknown sensor (should not happen)
646
+ }
647
+
648
+ // Details on the sensors documentation can be found here:
649
+ // https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_
650
+ // The types must follow the order defined in
651
+ // "external/qemu/android/hw-sensors.h"
652
+ enum PhysicalType {
653
+ POSITION = 0;
654
+
655
+ // All values are angles in degrees.
656
+ // values = [x,y,z]
657
+ ROTATION = 1;
658
+
659
+ MAGNETIC_FIELD = 2;
660
+
661
+ // Temperature in °C
662
+ TEMPERATURE = 3;
663
+
664
+ // Proximity sensor distance measured in centimeters
665
+ PROXIMITY = 4;
666
+
667
+ // Ambient light level in SI lux units
668
+ LIGHT = 5;
669
+
670
+ // Atmospheric pressure in hPa (millibar)
671
+ PRESSURE = 6;
672
+
673
+ // Relative ambient air humidity in percent
674
+ HUMIDITY = 7;
675
+
676
+ VELOCITY = 8;
677
+ AMBIENT_MOTION = 9;
678
+
679
+ // Describing a hinge angle sensor in degrees.
680
+ HINGE_ANGLE0 = 10;
681
+ HINGE_ANGLE1 = 11;
682
+ HINGE_ANGLE2 = 12;
683
+
684
+ ROLLABLE0 = 13;
685
+ ROLLABLE1 = 14;
686
+ ROLLABLE2 = 15;
687
+
688
+ // Describing the device posture; the value should be an enum defined
689
+ // in Posture::PostureValue.
690
+ POSTURE = 16;
691
+
692
+ // Heart rate in bpm
693
+ HEART_RATE = 17;
694
+
695
+ // Ambient RGBC light intensity. Values are in order (Red, Green, Blue,
696
+ // Clear).
697
+ RGBC_LIGHT = 18;
698
+
699
+ // Wrist tilt gesture (1 = gaze, 0 = ungaze)
700
+ WRIST_TILT = 19;
701
+ }
702
+ PhysicalType target = 1;
703
+
704
+ // [Output Only]
705
+ State status = 2;
706
+
707
+ // Value interpretation depends on sensor.
708
+ ParameterValue value = 3;
709
+
710
+ enum Interpolation {
711
+ SMOOTH = 0;
712
+ STEP = 1;
713
+ }
714
+
715
+ // [Input Only] How to transition to the target value.
716
+ Interpolation interpolation = 4;
717
+ }
718
+
719
+ // A single sensor value.
720
+ message SensorValue {
721
+ enum State {
722
+ OK = 0;
723
+ NO_SERVICE = -3; // qemud service is not available/initiated.
724
+ DISABLED = -2; // Sensor is disabled.
725
+ UNKNOWN = -1; // Unknown sensor (should not happen)
726
+ }
727
+
728
+ // These are the various sensors that can be available in an emulated
729
+ // devices.
730
+ enum SensorType {
731
+ // Measures the acceleration force in m/s2 that is applied to a device
732
+ // on all three physical axes (x, y, and z), including the force of
733
+ // gravity.
734
+ ACCELERATION = 0;
735
+ // Measures a device's rate of rotation in rad/s around each of the
736
+ // three physical axes (x, y, and z).
737
+ GYROSCOPE = 1;
738
+ // Measures the ambient geomagnetic field for all three physical axes
739
+ // (x, y, z) in μT.
740
+ MAGNETIC_FIELD = 2;
741
+ // Measures degrees of rotation that a device makes around all three
742
+ // physical axes (x, y, z)
743
+ ORIENTATION = 3;
744
+ // Measures the temperature of the device in degrees Celsius (°C).
745
+ TEMPERATURE = 4;
746
+ // Measures the proximity of an object in cm relative to the view screen
747
+ // of a device. This sensor is typically used to determine whether a
748
+ // handset is being held up to a person's ear.
749
+ PROXIMITY = 5;
750
+ // Measures the ambient light level (illumination) in lx.
751
+ LIGHT = 6;
752
+ // Measures the ambient air pressure in hPa or mbar.
753
+ PRESSURE = 7;
754
+ // Measures the relative ambient humidity in percent (%).
755
+ HUMIDITY = 8;
756
+ MAGNETIC_FIELD_UNCALIBRATED = 9;
757
+ GYROSCOPE_UNCALIBRATED = 10;
758
+
759
+ // HINGE_ANGLE0 (11), HINGE_ANGLE1 (12), HINGE_ANGLE2 (13) are
760
+ // skipped; clients should use get/setPhysicalModel() instead for these
761
+ // "sensors".
762
+
763
+ // Measures the heart rate in bpm.
764
+ HEART_RATE = 14;
765
+ // Measures the ambient RGBC light intensity.
766
+ // Values are in order (Red, Green, Blue, Clear).
767
+ RGBC_LIGHT = 15;
768
+ // WIRST_TILT (16) is skipped; clients should use get/setPhysicalModel()
769
+ // instead.
770
+ // Measures acceleration force and provides bias data.
771
+ ACCELERATION_UNCALIBRATED = 17;
772
+ // A sensor of this type measures the direction in which the device is
773
+ // pointing relative to true north in degrees.
774
+ HEADING = 18;
775
+ }
776
+
777
+ // Type of sensor
778
+ SensorType target = 1;
779
+
780
+ // [Output Only]
781
+ State status = 2;
782
+
783
+ // Value interpretation depends on sensor enum.
784
+ ParameterValue value = 3;
785
+ }
786
+
787
+ // A single backlight brightness value.
788
+ message BrightnessValue {
789
+ enum LightType {
790
+ // Display backlight. This will affect all displays.
791
+ LCD = 0;
792
+ KEYBOARD = 1;
793
+ BUTTON = 2;
794
+ }
795
+
796
+ // Type of light
797
+ LightType target = 1;
798
+
799
+ // Light intensity, ranges from 0-255.
800
+ uint32 value = 2;
801
+ }
802
+
803
+ // in line with android/emulation/resizable_display_config.h
804
+ enum DisplayModeValue {
805
+ PHONE = 0;
806
+ FOLDABLE = 1;
807
+ TABLET = 2;
808
+ DESKTOP = 3;
809
+ }
810
+
811
+ message DisplayMode {
812
+ DisplayModeValue value = 1;
813
+ }
814
+
815
+ message XrOptions {
816
+ enum Environment {
817
+ LIVING_ROOM_DAY = 0;
818
+ LIVING_ROOM_NIGHT = 1;
819
+ // More environments may be added later.
820
+ }
821
+
822
+ // The currently active artificial surrounding environment (a.k.a.
823
+ // passthrough environment).
824
+ Environment environment = 1;
825
+
826
+ // A value of 0.0 means that the real or artificial surrounding environment
827
+ // (a.k.a. passthrough environment) is not visible. A value of 1.0 means
828
+ // that the passthrough environment is fully visible. Any value outside of
829
+ // the range [0.0-1.0] is ignored and leaves the state of passthrough
830
+ // unchanged. For simplicity of the implementation, this number may be
831
+ // rounded to an integer before applying.
832
+ float passthrough_coefficient = 2;
833
+
834
+ float dimming_value = 4;
835
+ }
836
+
837
+ message LogMessage {
838
+ // [Output Only] The contents of the log output.
839
+ string contents = 1;
840
+ // The starting byte position of the output that was returned. This
841
+ // should match the start parameter sent with the request. If the serial
842
+ // console output exceeds the size of the buffer, older output will be
843
+ // overwritten by newer content and the start values will be mismatched.
844
+ int64 start = 2 [deprecated = true];
845
+ //[Output Only] The position of the next byte of content from the serial
846
+ // console output. Use this value in the next request as the start
847
+ // parameter.
848
+ int64 next = 3 [deprecated = true];
849
+
850
+ // Set the sort of response you are interested it in.
851
+ // It the type is "Parsed" the entries field will contain the parsed
852
+ // results. otherwise the contents field will be set.
853
+ LogType sort = 4;
854
+
855
+ // [Output Only] The parsed logcat entries so far. Only set if sort is
856
+ // set to Parsed
857
+ repeated LogcatEntry entries = 5;
858
+
859
+ enum LogType {
860
+ Text = 0;
861
+ Parsed = 1;
862
+ }
863
+ }
864
+
865
+ // A parsed logcat entry.
866
+ message LogcatEntry {
867
+ // The possible log levels.
868
+ enum LogLevel {
869
+ UNKNOWN = 0;
870
+ DEFAULT = 1;
871
+ VERBOSE = 2;
872
+ DEBUG = 3;
873
+ INFO = 4;
874
+ WARN = 5;
875
+ ERR = 6;
876
+ FATAL = 7;
877
+ SILENT = 8;
878
+ }
879
+
880
+ // A Unix timestamps in milliseconds (The number of milliseconds that
881
+ // have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
882
+ // leap seconds)
883
+ uint64 timestamp = 1;
884
+
885
+ // Process id.
886
+ uint32 pid = 2;
887
+
888
+ // Thread id.
889
+ uint32 tid = 3;
890
+ LogLevel level = 4;
891
+ string tag = 5;
892
+ string msg = 6;
893
+ }
894
+
895
+ // Information about the hypervisor that is currently in use.
896
+ message VmConfiguration {
897
+ enum VmHypervisorType {
898
+ // An unknown hypervisor
899
+ UNKNOWN = 0;
900
+
901
+ // No hypervisor is in use. This usually means that the guest is
902
+ // running on a different CPU than the host, or you are using a
903
+ // platform where no hypervisor is available.
904
+ NONE = 1;
905
+
906
+ // The Kernel based Virtual Machine
907
+ // (https://www.linux-kvm.org/page/Main_Page)
908
+ KVM = 2;
909
+
910
+ // Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
911
+ HAXM = 3 [deprecated = true];
912
+
913
+ // Hypervisor Framework.
914
+ // https://developer.apple.com/documentation/hypervisor
915
+ HVF = 4;
916
+
917
+ // Window Hypervisor Platform
918
+ // https://docs.microsoft.com/en-us/virtualization/api/
919
+ WHPX = 5;
920
+
921
+ AEHD = 6;
922
+ }
923
+
924
+ VmHypervisorType hypervisorType = 1;
925
+ int32 numberOfCpuCores = 2;
926
+ int64 ramSizeBytes = 3;
927
+ }
928
+
929
+ // Representation of a clipped data object on the clipboard.
930
+ message ClipData {
931
+ // UTF-8 Encoded text.
932
+ string text = 1;
933
+ }
934
+
935
+ // The Touch interface represents a single contact point on a
936
+ // touch-sensitive device. The contact point is commonly a finger or stylus
937
+ // and the device may be a touchscreen or trackpad.
938
+ message Touch {
939
+ // The horizontal coordinate. This is the physical location on the
940
+ // screen For example 0 indicates the leftmost coordinate.
941
+ int32 x = 1;
942
+
943
+ // The vertical coordinate. This is the physical location on the screen
944
+ // For example 0 indicates the top left coordinate.
945
+ int32 y = 2;
946
+
947
+ // The identifier is an arbitrary non-negative integer that is used to
948
+ // identify and track each tool independently when multiple tools are
949
+ // active. For example, when multiple fingers are touching the device,
950
+ // each finger should be assigned a distinct tracking id that is used as
951
+ // long as the finger remains in contact. Tracking ids may be reused
952
+ // when their associated tools move out of range.
953
+ //
954
+ // The emulator currently supports up to 10 concurrent touch events. The
955
+ // identifier can be any uninque value and will be mapped to the next
956
+ // available internal identifier.
957
+ int32 identifier = 3;
958
+
959
+ // Reports the physical pressure applied to the tip of the tool or the
960
+ // signal strength of the touch contact.
961
+ //
962
+ // The values reported must be non-zero when the tool is touching the
963
+ // device and zero otherwise to indicate that the touch event is
964
+ // completed.
965
+ //
966
+ // Make sure to deliver a pressure of 0 for the given identifier when
967
+ // the touch event is completed, otherwise the touch identifier will not
968
+ // be unregistered!
969
+ int32 pressure = 4;
970
+
971
+ // Optionally reports the cross-sectional area of the touch contact, or
972
+ // the length of the longer dimension of the touch contact.
973
+ int32 touch_major = 5;
974
+
975
+ // Optionally reports the length of the shorter dimension of the touch
976
+ // contact. This axis will be ignored if touch_major is reporting an
977
+ // area measurement greater than 0.
978
+ int32 touch_minor = 6;
979
+
980
+ enum EventExpiration {
981
+ // The system will use the default time of 120s to track
982
+ // the touch event with the given identifier. If no update happens
983
+ // within this timeframe the identifier is considered expired
984
+ // and can be made available for re-use. This means that a touch event
985
+ // with pressure 0 for this identifier will be send to the emulator.
986
+ EVENT_EXPIRATION_UNSPECIFIED = 0;
987
+
988
+ // Never expire the given slot. You must *ALWAYS* close the identifier
989
+ // by sending a touch event with 0 pressure.
990
+ NEVER_EXPIRE = 1;
991
+ }
992
+
993
+ EventExpiration expiration = 7;
994
+
995
+ // The orientation of the contact, if any.
996
+ int32 orientation = 8;
997
+ }
998
+
999
+ // A Pen is similar to a touch, with the addition
1000
+ // of button and rubber information.
1001
+ message Pen {
1002
+ Touch location = 1;
1003
+
1004
+ // True if the button is pressed or not
1005
+ bool button_pressed = 2;
1006
+
1007
+ // True if it is a rubber pointer.
1008
+ bool rubber_pointer = 3;
1009
+ }
1010
+
1011
+ // A TouchEvent contains a list of Touch objects that are in contact with
1012
+ // the touch surface.
1013
+ //
1014
+ // Touch events are delivered in sequence as specified in the touchList.
1015
+ //
1016
+ // TouchEvents are delivered to the emulated devices using ["Protocol
1017
+ // B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
1018
+ message TouchEvent {
1019
+ // The list of Touch objects, note that these do not need to be unique
1020
+ repeated Touch touches = 1;
1021
+
1022
+ // The display device where the touch event occurred.
1023
+ // Omitting or using the value 0 indicates the main display.
1024
+ int32 display = 2;
1025
+ }
1026
+
1027
+ // A TouchpadEvent contains a list of Touch objects that are in contact with
1028
+ // the touchpad surface.
1029
+ //
1030
+ // Touchpad events are delivered in sequence as specified in the touchList.
1031
+ //
1032
+ // TouchpadEvents are delivered to the emulated devices using ["Protocol
1033
+ // B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
1034
+ message TouchpadEvent {
1035
+ // The list of Touch objects, note that these do not need to be unique
1036
+ repeated Touch touches = 1;
1037
+
1038
+ // The touchpad device where the touch event occurred.
1039
+ // Omitting or using the value 0 indicates the main touchpad.
1040
+ int32 touchpad = 2;
1041
+ }
1042
+
1043
+ message PenEvent {
1044
+ // The list of Pen objects, note that these do not need to be unique
1045
+ repeated Pen events = 1;
1046
+
1047
+ // The display device where the pen event occurred.
1048
+ // Omitting or using the value 0 indicates the main display.
1049
+ int32 display = 2;
1050
+ }
1051
+
1052
+ // The MouseEvent interface represents events that occur due to the user
1053
+ // interacting with a pointing device (such as a mouse).
1054
+ message MouseEvent {
1055
+ // The horizontal coordinate. This is the physical location on the
1056
+ // screen, where 0 indicates the leftmost coordinate.
1057
+ int32 x = 1;
1058
+
1059
+ // The vertical coordinate. This is the physical location on the screen,
1060
+ // where 0 indicates the topmost coordinate.
1061
+ int32 y = 2;
1062
+
1063
+ // Indicates which buttons are pressed.
1064
+ // 0: No button was pressed
1065
+ // 1: Primary button (left)
1066
+ // 2: Secondary button (right)
1067
+ int32 buttons = 3;
1068
+
1069
+ // The display device where the mouse event occurred.
1070
+ // Omitting or using the value 0 indicates the main display.
1071
+ int32 display = 4;
1072
+ }
1073
+
1074
+ message WheelEvent {
1075
+ // The value indicating how much the mouse wheel is rotated. Scaled so that
1076
+ // 120 equals to 1 wheel click. (120 is chosen as a multiplier often used to
1077
+ // represent wheel movements less than 1 wheel click. e.g.
1078
+ // https://doc.qt.io/qt-5/qwheelevent.html#angleDelta) Positive delta value
1079
+ // is assigned to dx when the top of wheel is moved to left. Similarly
1080
+ // positive delta value is assigned to dy when the top of wheel is moved
1081
+ // away from the user.
1082
+ int32 dx = 1;
1083
+ int32 dy = 2;
1084
+
1085
+ // The display device where the mouse event occurred.
1086
+ // Omitting or using the value 0 indicates the main display.
1087
+ int32 display = 3;
1088
+ }
1089
+
1090
+ // KeyboardEvent objects describe a user interaction with the keyboard; each
1091
+ // event describes a single interaction between the user and a key (or
1092
+ // combination of a key with modifier keys) on the keyboard.
1093
+ // This follows the pattern as set by
1094
+ // (javascript)[https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent]
1095
+ //
1096
+ // Note: that only keyCode, key, or text can be set and that the semantics
1097
+ // will slightly vary.
1098
+ message KeyboardEvent {
1099
+ // Code types that the emulator can receive. Note that the emulator
1100
+ // will do its best to translate the code to an evdev value that
1101
+ // will be send to the emulator. This translation is based on
1102
+ // the chromium translation tables. See
1103
+ // (this)[https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-grpc/android/emulation/control/keyboard/keycode_converter_data.inc]
1104
+ // for details on the translation.
1105
+ enum KeyCodeType {
1106
+ Usb = 0;
1107
+ Evdev = 1;
1108
+ XKB = 2;
1109
+ Win = 3;
1110
+ Mac = 4;
1111
+ }
1112
+
1113
+ enum KeyEventType {
1114
+ // Indicates that this keyevent should be send to the emulator
1115
+ // as a key down event. Meaning that the key event will be
1116
+ // translated to an EvDev event type and bit 11 (0x400) will be
1117
+ // set before it is sent to the emulator.
1118
+ keydown = 0;
1119
+
1120
+ // Indicates that the keyevent should be send to the emulator
1121
+ // as a key up event. Meaning that the key event will be
1122
+ // translated to an EvDev event type and
1123
+ // sent to the emulator.
1124
+ keyup = 1;
1125
+
1126
+ // Indicates that the keyevent will be send to the emulator
1127
+ // as e key down event and immediately followed by a keyup event.
1128
+ keypress = 2;
1129
+ }
1130
+
1131
+ // Type of keycode contained in the keyCode field.
1132
+ KeyCodeType codeType = 1;
1133
+
1134
+ // The type of keyboard event that should be sent to the emulator
1135
+ KeyEventType eventType = 2;
1136
+
1137
+ // This property represents a physical key on the keyboard (as opposed
1138
+ // to the character generated by pressing the key). In other words, this
1139
+ // property is a value which isn't altered by keyboard layout or the
1140
+ // state of the modifier keys. This value will be interpreted by the
1141
+ // emulator depending on the KeyCodeType. The incoming key code will be
1142
+ // translated to an evdev code type and send to the emulator.
1143
+ // The values in key and text will be ignored.
1144
+ int32 keyCode = 3;
1145
+
1146
+ // The value of the key pressed by the user, taking into consideration
1147
+ // the state of modifier keys such as Shift as well as the keyboard
1148
+ // locale and layout. This follows the w3c standard used in browsers.
1149
+ // You can find an accurate description of valid values
1150
+ // [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
1151
+ //
1152
+ // Note that some keys can result in multiple evdev events that are
1153
+ // delivered to the emulator. for example the Key "A" will result in a
1154
+ // sequence:
1155
+ // ["Shift", "a"] -> [0x2a, 0x1e] whereas "a" results in ["a"] -> [0x1e].
1156
+ //
1157
+ // Not all documented keys are understood by android, and only printable
1158
+ // ASCII [32-127) characters are properly translated.
1159
+ //
1160
+ // Keep in mind that there are a set of key values that result in android
1161
+ // specific behavior
1162
+ // [see](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#Phone_keys):
1163
+ //
1164
+ // - "AppSwitch": Behaves as the "Overview" button in android.
1165
+ // - "GoBack": The Back button.
1166
+ // - "GoHome": The Home button, which takes the user to the phone's main
1167
+ // screen (usually an application launcher).
1168
+ // - "Power": The Power button.
1169
+ string key = 4;
1170
+
1171
+ // Series of utf8 encoded characters to send to the emulator. An attempt
1172
+ // will be made to translate every character will an EvDev event type and
1173
+ // send to the emulator as a keypress event. The values in keyCode,
1174
+ // eventType, codeType and key will be ignored.
1175
+ //
1176
+ // Note that most printable ASCII characters (range [32-127) can be send
1177
+ // individually with the "key" param. Do not expect arbitrary UTF symbols to
1178
+ // arrive in the emulator (most will be ignored).
1179
+ //
1180
+ // Note that it is possible to overrun the keyboard buffer by slamming this
1181
+ // endpoint with large quantities of text (>1kb). The clipboard api is
1182
+ // better suited for transferring large quantities of text.
1183
+ string text = 5;
1184
+ }
1185
+
1186
+ message XrCommand {
1187
+ enum Action {
1188
+ // Recenter the viewport position and rotation.
1189
+ RECENTER = 0;
1190
+ }
1191
+
1192
+ Action action = 1;
1193
+ }
1194
+
1195
+ // An input event that can be delivered to the emulator.
1196
+ message InputEvent {
1197
+ oneof type {
1198
+ KeyboardEvent key_event = 1;
1199
+ TouchEvent touch_event = 2;
1200
+ MouseEvent mouse_event = 3;
1201
+ AndroidEvent android_event = 4;
1202
+ PenEvent pen_event = 5;
1203
+ WheelEvent wheel_event = 6;
1204
+ MouseEvent xr_hand_event = 7;
1205
+ MouseEvent xr_eye_event = 8;
1206
+ XrCommand xr_command = 9;
1207
+ RotationRadian xr_head_rotation_event = 10;
1208
+ Translation xr_head_movement_event = 11;
1209
+ AngularVelocity xr_head_angular_velocity_event = 12;
1210
+ Velocity xr_head_velocity_event = 13;
1211
+ TouchpadEvent touchpad_event = 14;
1212
+ }
1213
+ };
1214
+
1215
+ // The android input event system is a framework for handling input from a
1216
+ // variety of devices by generating events that describe changes in the
1217
+ // state of the devices and forwarding them to user space applications.
1218
+ //
1219
+ // An AndroidEvents will be delivered directly to the kernel as is.
1220
+ message AndroidEvent {
1221
+ // The type of the event. The types of the event are specified
1222
+ // by the android kernel. Some examples are:
1223
+ // EV_SYN, EV_KEY, EV_SW, etc..
1224
+ // The exact definitions can be found in the input.h header file.
1225
+ int32 type = 1;
1226
+
1227
+ // The actual code to be send to the kernel. The actual meaning
1228
+ // of the code depends on the type definition.
1229
+ int32 code = 2;
1230
+
1231
+ // The actual value of the event.
1232
+ int32 value = 3;
1233
+
1234
+ // The display id associated with this input event.
1235
+ int32 display = 4;
1236
+ };
1237
+
1238
+ message Fingerprint {
1239
+ // True when the fingprint is touched.
1240
+ bool isTouching = 1;
1241
+
1242
+ // The identifier of the registered fingerprint.
1243
+ int32 touchId = 2;
1244
+ }
1245
+
1246
+ message GpsState {
1247
+ // Setting this to false will disable auto updating from the LocationUI,
1248
+ // otherwise the location UI will override the location at a frequency of
1249
+ // 1hz.
1250
+ //
1251
+ // - This is unused if the emulator is launched with -no-window, or when he
1252
+ // location ui is disabled.
1253
+ // - This will BREAK the location ui experience if it is set to false. For
1254
+ // example routing will no longer function.
1255
+ bool passiveUpdate = 1;
1256
+
1257
+ // The latitude, in degrees.
1258
+ double latitude = 2;
1259
+
1260
+ // The longitude, in degrees.
1261
+ double longitude = 3;
1262
+
1263
+ // The speed if it is available, in meters/second over ground
1264
+ double speed = 4;
1265
+
1266
+ // gets the horizontal direction of travel of this device, and is not
1267
+ // related to the device orientation. It is guaranteed to be in the
1268
+ // range [0.0, 360.0] if the device has a bearing. 0=North, 90=East,
1269
+ // 180=South, etc..
1270
+ double bearing = 5;
1271
+
1272
+ // The altitude if available, in meters above the WGS 84 reference
1273
+ // ellipsoid.
1274
+ double altitude = 6;
1275
+
1276
+ // The number of satellites used to derive the fix
1277
+ int32 satellites = 7;
1278
+ }
1279
+
1280
+ message BatteryState {
1281
+ enum BatteryStatus {
1282
+ UNKNOWN = 0;
1283
+ CHARGING = 1;
1284
+ DISCHARGING = 2;
1285
+ NOT_CHARGING = 3;
1286
+ FULL = 4;
1287
+ }
1288
+
1289
+ enum BatteryCharger {
1290
+ NONE = 0;
1291
+ AC = 1;
1292
+ USB = 2;
1293
+ WIRELESS = 3;
1294
+ }
1295
+
1296
+ enum BatteryHealth {
1297
+ GOOD = 0;
1298
+ FAILED = 1;
1299
+ DEAD = 2;
1300
+ OVERVOLTAGE = 3;
1301
+ OVERHEATED = 4;
1302
+ }
1303
+
1304
+ bool hasBattery = 1;
1305
+ bool isPresent = 2;
1306
+ BatteryCharger charger = 3;
1307
+ int32 chargeLevel = 4;
1308
+ BatteryHealth health = 5;
1309
+ BatteryStatus status = 6;
1310
+ }
1311
+
1312
+ // An ImageTransport allows for specifying a side channel for
1313
+ // delivering image frames versus using the standard bytes array that is
1314
+ // returned with the gRPC request.
1315
+ message ImageTransport {
1316
+ enum TransportChannel {
1317
+ // Return full frames over the gRPC transport
1318
+ TRANSPORT_CHANNEL_UNSPECIFIED = 0;
1319
+
1320
+ // Write images to the a file/shared memory handle.
1321
+ MMAP = 1;
1322
+ }
1323
+
1324
+ // The desired transport channel used for delivering image frames. Only
1325
+ // relevant when streaming screenshots.
1326
+ TransportChannel channel = 1;
1327
+
1328
+ // Handle used for writing image frames if transport is mmap. The client
1329
+ // sets and owns this handle. It can be either a shm region, or a mmap. A
1330
+ // mmap should be a url that starts with `file:///` Note: the mmap can
1331
+ // result in tearing.
1332
+ string handle = 2;
1333
+ }
1334
+
1335
+ // The aspect ratio (width/height) will be different from the one
1336
+ // where the device is unfolded.
1337
+ message FoldedDisplay {
1338
+ uint32 width = 1;
1339
+ uint32 height = 2;
1340
+ // It is possible for the screen to be folded in different ways depending
1341
+ // on which surface is shown to the user. So xOffset and yOffset indicate
1342
+ // the top left corner of the folded screen within the original unfolded
1343
+ // screen.
1344
+ uint32 xOffset = 3;
1345
+ uint32 yOffset = 4;
1346
+ }
1347
+
1348
+ message ImageFormat {
1349
+ enum ImgFormat {
1350
+ // Portable Network Graphics format
1351
+ // (https://en.wikipedia.org/wiki/Portable_Network_Graphics)
1352
+ PNG = 0;
1353
+
1354
+ // Three-channel RGB color model supplemented with a fourth alpha
1355
+ // channel. https://en.wikipedia.org/wiki/RGBA_color_model
1356
+ // Each pixel consists of 4 bytes.
1357
+ RGBA8888 = 1;
1358
+
1359
+ // Three-channel RGB color model, each pixel consists of 3 bytes
1360
+ RGB888 = 2;
1361
+ }
1362
+
1363
+ // The (desired) format of the resulting bytes.
1364
+ ImgFormat format = 1;
1365
+
1366
+ // [Output Only] The rotation of the image. The image will be rotated
1367
+ // based upon the coarse grained orientation of the device.
1368
+ Rotation rotation = 2;
1369
+
1370
+ // The (desired) width of the image. When passed as input
1371
+ // the image will be scaled to match the given
1372
+ // width, while maintaining the aspect ratio of the device.
1373
+ // The returned image will never exceed the given width, but can be less.
1374
+ // Omitting this value (or passing in 0) will result in no scaling,
1375
+ // and the width of the actual device will be used.
1376
+ uint32 width = 3;
1377
+
1378
+ // The (desired) height of the image. When passed as input
1379
+ // the image will be scaled to match the given
1380
+ // height, while maintaining the aspect ratio of the device.
1381
+ // The returned image will never exceed the given height, but can be less.
1382
+ // Omitting this value (or passing in 0) will result in no scaling,
1383
+ // and the height of the actual device will be used.
1384
+ uint32 height = 4;
1385
+
1386
+ // The (desired) display id of the device. Setting this to 0 (or omitting)
1387
+ // indicates the main display.
1388
+ uint32 display = 5;
1389
+
1390
+ // Set this if you wish to use a different transport channel to deliver
1391
+ // image frames.
1392
+ ImageTransport transport = 6;
1393
+
1394
+ // [Output Only] Display configuration when screen is folded. The value is
1395
+ // the original configuration before scaling.
1396
+ FoldedDisplay foldedDisplay = 7;
1397
+
1398
+ // [Output Only] Display mode when AVD is resizable.
1399
+ DisplayModeValue displayMode = 8;
1400
+ }
1401
+
1402
+ message Image {
1403
+ ImageFormat format = 1;
1404
+
1405
+ uint32 width = 2 [deprecated = true]; // width is contained in format.
1406
+ uint32 height = 3 [deprecated = true]; // height is contained in format.
1407
+
1408
+ // The organization of the pixels in the image buffer is from left to
1409
+ // right and bottom up. This will be empty if an alternative image transport
1410
+ // is requested in the image format. In that case the side channel should
1411
+ // be used to obtain the image data.
1412
+ bytes image = 4;
1413
+
1414
+ // [Output Only] Monotonically increasing sequence number in a stream of
1415
+ // screenshots. The first screenshot will have a sequence of 0. A single
1416
+ // screenshot will always have a sequence number of 0. The sequence is not
1417
+ // necessarily contiguous, and can be used to detect how many frames were
1418
+ // dropped. An example sequence could be: [0, 3, 5, 7, 9, 11].
1419
+ uint32 seq = 5;
1420
+
1421
+ // [Output Only] Unix timestamp in microseconds when the emulator estimates
1422
+ // the frame was generated. The timestamp is before the actual frame is
1423
+ // copied and transformed. This can be used to calculate variance between
1424
+ // frame production time, and frame depiction time.
1425
+ uint64 timestampUs = 6;
1426
+ }
1427
+
1428
+ message Rotation {
1429
+ enum SkinRotation {
1430
+ PORTRAIT = 0; // 0 degrees
1431
+ LANDSCAPE = 1; // 90 degrees
1432
+ REVERSE_PORTRAIT = 2; // -180 degrees
1433
+ REVERSE_LANDSCAPE = 3; // -90 degrees
1434
+ }
1435
+
1436
+ // The rotation of the device, derived from the sensor state
1437
+ // of the emulator. The derivation reflects how android observes
1438
+ // the rotation state.
1439
+ SkinRotation rotation = 1;
1440
+
1441
+ // Specifies the angle of rotation, in degrees [-180, 180]
1442
+ double xAxis = 2;
1443
+ double yAxis = 3;
1444
+ double zAxis = 4;
1445
+ }
1446
+
1447
+ message PhoneCall {
1448
+ enum Operation {
1449
+ InitCall = 0;
1450
+ AcceptCall = 1;
1451
+ RejectCallExplicit = 2;
1452
+ RejectCallBusy = 3;
1453
+ DisconnectCall = 4;
1454
+ PlaceCallOnHold = 5;
1455
+ TakeCallOffHold = 6;
1456
+ }
1457
+ Operation operation = 1;
1458
+ string number = 2;
1459
+ }
1460
+
1461
+ message PhoneResponse {
1462
+ enum Response {
1463
+ OK = 0;
1464
+ BadOperation = 1; // Enum out of range
1465
+ BadNumber = 2; // Mal-formed telephone number
1466
+ InvalidAction = 3; // E.g., disconnect when no call is in progress
1467
+ ActionFailed = 4; // Internal error
1468
+ RadioOff = 5; // Radio power off
1469
+ }
1470
+ Response response = 1;
1471
+ }
1472
+
1473
+ message Entry {
1474
+ string key = 1;
1475
+ string value = 2;
1476
+ }
1477
+
1478
+ message EntryList {
1479
+ repeated Entry entry = 1;
1480
+ }
1481
+
1482
+ message EmulatorStatus {
1483
+ // The emulator version string.
1484
+ string version = 1;
1485
+
1486
+ // The time the emulator has been active in .ms
1487
+ uint64 uptime = 2;
1488
+
1489
+ // True if the device has completed booting.
1490
+ // For P and later this information will accurate,
1491
+ // for older images we rely on adb.
1492
+ bool booted = 3;
1493
+
1494
+ // The current vm configuration
1495
+ VmConfiguration vmConfig = 4;
1496
+
1497
+ // Use platformConfig instead
1498
+ EntryList hardwareConfig = 5 [deprecated = true];
1499
+
1500
+ // Some guests will produce a heart beat, that can be used to
1501
+ // detect if the guest is active.
1502
+ // This is a monotonically increasing number that gets incremented
1503
+ // around once a second.
1504
+ uint64 heartbeat = 6;
1505
+
1506
+ // The configuration of services in the guest, this map
1507
+ // contains key value pairs that are specific to the image
1508
+ // used by the guest.
1509
+ map<string, string> guestConfig = 7;
1510
+
1511
+ // Configuration of the emulator hardware
1512
+ map<string, string> platformConfig = 8;
1513
+ }
1514
+
1515
+ message AudioFormat {
1516
+ enum SampleFormat {
1517
+ AUD_FMT_U8 = 0; // Unsigned 8 bit
1518
+ AUD_FMT_S16 = 1; // Signed 16 bit (little endian)
1519
+ }
1520
+
1521
+ enum Channels {
1522
+ Mono = 0;
1523
+ Stereo = 1;
1524
+ }
1525
+
1526
+ enum DeliveryMode {
1527
+ // The audio queue will block and wait until the emulator requests
1528
+ // packets. The client does not have to throttle and can push packets at
1529
+ // will. This can result in the client falling behind.
1530
+ MODE_UNSPECIFIED = 0;
1531
+ // Audio packets will be delivered in real time (when possible). The
1532
+ // audio queue will be overwritten with incoming data if data is made
1533
+ // available. This means the client needs to control timing properly, or
1534
+ // packets will get overwritten.
1535
+ MODE_REAL_TIME = 1; //
1536
+ }
1537
+ // Sampling rate to use, defaulting to 44100 if this is not set.
1538
+ // Note, that android devices typically will not use a sampling
1539
+ // rate higher than 48kHz. See
1540
+ // https://developer.android.com/ndk/guides/audio.
1541
+ uint64 samplingRate = 1;
1542
+ Channels channels = 2;
1543
+ SampleFormat format = 3;
1544
+
1545
+ // [Input Only]
1546
+ // The mode used when delivering audio packets.
1547
+ DeliveryMode mode = 4;
1548
+ }
1549
+
1550
+ message AudioPacket {
1551
+ AudioFormat format = 1;
1552
+
1553
+ // Unix epoch in us when this frame was captured.
1554
+ uint64 timestamp = 2;
1555
+
1556
+ // Contains a sample in the given audio format.
1557
+ bytes audio = 3;
1558
+ }
1559
+
1560
+ message MicrophoneState {
1561
+ // Whether or not host microphone access is enabled
1562
+ bool realAudioEnabled = 1;
1563
+ }
1564
+
1565
+ message SmsMessage {
1566
+ // The source address where this message came from.
1567
+ //
1568
+ // The address should be a valid GSM-formatted address as specified by
1569
+ // 3GPP 23.040 Sec 9.1.2.5.
1570
+ //
1571
+ // For example: +3106225412 or (650) 555-1221
1572
+ string srcAddress = 1;
1573
+
1574
+ // A utf8 encoded text message that should be delivered.
1575
+ string text = 2;
1576
+ }
1577
+
1578
+ // A DisplayConfiguration describes a primary or secondary
1579
+ // display available to the emulator. The screen aspect ratio
1580
+ // cannot be longer (or wider) than 21:9 (or 9:21). Screen sizes
1581
+ // larger than 4k will be rejected.
1582
+ //
1583
+ // Common configurations (w x h) are:
1584
+ // - 480p (480x720) 142 dpi
1585
+ // - 720p (720x1280) 213 dpi
1586
+ // - 1080p (1080x1920) 320 dpi
1587
+ // - 4K (2160x3840) 320 dpi
1588
+ // - 4K (2160x3840) 640 dpi (upscaled)
1589
+ //
1590
+ // The behavior of the virtual display depends on the flags that are provided to
1591
+ // this method. By default, virtual displays are created to be private,
1592
+ // non-presentation and unsecure.
1593
+ message DisplayConfiguration {
1594
+ // These are the set of known android flags and their respective values.
1595
+ // you can combine the int values to (de)construct the flags field below.
1596
+ enum DisplayFlags {
1597
+ DISPLAYFLAGS_UNSPECIFIED = 0;
1598
+
1599
+ // When this flag is set, the virtual display is public.
1600
+ // A public virtual display behaves just like most any other display
1601
+ // that is connected to the system such as an external or wireless
1602
+ // display. Applications can open windows on the display and the system
1603
+ // may mirror the contents of other displays onto it. see:
1604
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PUBLIC
1605
+ VIRTUAL_DISPLAY_FLAG_PUBLIC = 1;
1606
+
1607
+ // When this flag is set, the virtual display is registered as a
1608
+ // presentation display in the presentation display category.
1609
+ // Applications may automatically project their content to presentation
1610
+ // displays to provide richer second screen experiences.
1611
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PRESENTATION
1612
+ VIRTUAL_DISPLAY_FLAG_PRESENTATION = 2;
1613
+
1614
+ // When this flag is set, the virtual display is considered secure as
1615
+ // defined by the Display#FLAG_SECURE display flag. The caller promises
1616
+ // to take reasonable measures, such as over-the-air encryption, to
1617
+ // prevent the contents of the display from being intercepted or
1618
+ // recorded on a persistent medium.
1619
+ // see:
1620
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_SECURE
1621
+ VIRTUAL_DISPLAY_FLAG_SECURE = 4;
1622
+
1623
+ // This flag is used in conjunction with VIRTUAL_DISPLAY_FLAG_PUBLIC.
1624
+ // Ordinarily public virtual displays will automatically mirror the
1625
+ // content of the default display if they have no windows of their own.
1626
+ // When this flag is specified, the virtual display will only ever show
1627
+ // its own content and will be blanked instead if it has no windows. See
1628
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
1629
+ VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY = 8;
1630
+
1631
+ // Allows content to be mirrored on private displays when no content is
1632
+ // being shown.
1633
+ // This flag is mutually exclusive with
1634
+ // VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY. If both flags are specified
1635
+ // then the own-content only behavior will be applied.
1636
+ // see:
1637
+ // https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR)
1638
+ VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR = 16;
1639
+ }
1640
+
1641
+ // The width of the display, restricted to:
1642
+ // 320 * (dpi / 160) <= width
1643
+ uint32 width = 1;
1644
+
1645
+ // The heigh of the display, restricted to:
1646
+ // * 320 * (dpi / 160) <= height
1647
+ uint32 height = 2;
1648
+
1649
+ // The pixel density (dpi).
1650
+ // See https://developer.android.com/training/multiscreen/screendensities
1651
+ // for details. This value should be in the range [120, ..., 640]
1652
+ uint32 dpi = 3;
1653
+
1654
+ // A combination of virtual display flags. These flags can be constructed
1655
+ // by combining the DisplayFlags enum described above.
1656
+ //
1657
+ // The behavior of the virtual display depends on the flags. By default
1658
+ // virtual displays are created to be private, non-presentation and
1659
+ // unsecure.
1660
+ uint32 flags = 4;
1661
+
1662
+ // The id of the display.
1663
+ // The primary (default) display has the display ID of 0.
1664
+ // A secondary display has a display ID not 0.
1665
+ //
1666
+ // A display with the id in the range [1, userConfigurable]
1667
+ // can be modified. See DisplayConfigurations below for details.
1668
+ //
1669
+ // The id can be used to get or stream a screenshot.
1670
+ uint32 display = 5;
1671
+ }
1672
+ // Provides information about all the displays that can be attached
1673
+ // to the emulator. The emulator will always have at least one display.
1674
+ //
1675
+ // The emulator usually has the following display configurations:
1676
+ // 0: The default display.
1677
+ // 1 - 3: User configurable displays. These can be added/removed.
1678
+ // For example the standalone emulator allows you to modify these
1679
+ // in the extended controls.
1680
+ // 6 - 11: Fixed external displays. For example Android Auto uses fixed
1681
+ // displays in this range.
1682
+ message DisplayConfigurations {
1683
+ repeated DisplayConfiguration displays = 1;
1684
+
1685
+ // Display configurations with id [1, userConfigurable] are
1686
+ // user configurable, that is they can be added, removed or
1687
+ // updated.
1688
+ uint32 userConfigurable = 2;
1689
+
1690
+ // The maximum number of attached displays this emulator supports.
1691
+ // This is the total number of displays that can be attached to
1692
+ // the emulator.
1693
+ //
1694
+ // Note: A display with an id that is larger than userConfigurable cannot
1695
+ // be modified.
1696
+ uint32 maxDisplays = 3;
1697
+ }
1698
+
1699
+ message Notification {
1700
+ // Detailed notification information.
1701
+ oneof type {
1702
+ CameraNotification cameraNotification = 2;
1703
+ DisplayConfigurationsChangedNotification
1704
+ displayConfigurationsChangedNotification = 3;
1705
+ Posture posture = 4;
1706
+ BootCompletedNotification booted = 5;
1707
+ BrightnessValue brightness = 6;
1708
+
1709
+ // This notification is sent when a TextView receives or loses focus.
1710
+ // It is also sent immediately in response to the streamNotification
1711
+ // call.
1712
+ TextViewFocus textViewFocus = 7;
1713
+ // This notification is sent when XrOptions change.
1714
+ // It is also sent immediately in response to the streamNotification
1715
+ // call.
1716
+ XrOptions xrOptions = 8;
1717
+ MicrophoneState microphoneState = 9;
1718
+ }
1719
+ }
1720
+
1721
+ message BootCompletedNotification {
1722
+ // The time in milliseconds it took for the boot to complete.
1723
+ // Note that this value can be 0 when you are loading from a snapshot.
1724
+ int32 time = 1;
1725
+ }
1726
+
1727
+ // Fired when the virtual scene camera is activated or deactivated and also in
1728
+ // response to the streamNotification call.
1729
+ message CameraNotification {
1730
+ // Indicates whether the camera app was activated or deactivated.
1731
+ bool active = 1;
1732
+ // The display the camera app is associated with.
1733
+ int32 display = 2;
1734
+ }
1735
+
1736
+ message TextViewFocus {
1737
+ // Indicates whether a text view currently has focus.
1738
+ bool textViewHasFocus = 1;
1739
+
1740
+ // If a text view has focus, the display where the text view is located.
1741
+ // Otherwise, unset.
1742
+ int32 display = 2;
1743
+ }
1744
+
1745
+ // Fired when an update to a display event has been fired through the extended
1746
+ // ui. This does not fire events when the display is changed through the console
1747
+ // or the gRPC endpoint.
1748
+ message DisplayConfigurationsChangedNotification {
1749
+ DisplayConfigurations displayConfigurations = 1;
1750
+ }
1751
+
1752
+ message RotationRadian {
1753
+ // Components of the rotation vector in radians.
1754
+ // Rotation angles are relative to the current orientation.
1755
+ float x = 1; // Angle of rotation around the x axis in right-handed direction.
1756
+ float y = 2; // Angle of rotation around the y axis in right-handed direction.
1757
+ float z = 3; // Angle of rotation around the z axis in right-handed direction.
1758
+ }
1759
+
1760
+ message Translation {
1761
+ // Components of the translation vector in meters.
1762
+ float delta_x = 1;
1763
+ float delta_y = 2;
1764
+ float delta_z = 3;
1765
+ }
1766
+
1767
+ message AngularVelocity {
1768
+ // Components of the target angular velocity vector in radians per second.
1769
+ // Transition to these values is implementation dependent, and may be
1770
+ // smoothed over time.
1771
+ float omega_x = 1;
1772
+ float omega_y = 2;
1773
+ float omega_z = 3;
1774
+ }
1775
+
1776
+ message Velocity {
1777
+ // Components of the target velocity vector in meters per second.
1778
+ // Transition to these values is implementation dependent, and may be
1779
+ // smoothed over time.
1780
+ float x = 1;
1781
+ float y = 2;
1782
+ float z = 3;
1783
+ }
1784
+
1785
+ // Must follow the definition in "external/qemu/android/hw-sensors.h"
1786
+ message Posture {
1787
+ enum PostureValue {
1788
+ POSTURE_UNKNOWN = 0;
1789
+ POSTURE_CLOSED = 1;
1790
+ POSTURE_HALF_OPENED = 2;
1791
+ POSTURE_OPENED = 3;
1792
+ POSTURE_FLIPPED = 4;
1793
+ POSTURE_TENT = 5;
1794
+ POSTURE_MAX = 6;
1795
+ }
1796
+ PostureValue value = 3;
1797
+ }
1798
+
1799
+ message PhoneNumber {
1800
+ //
1801
+ // The phone number should be a valid GSM-formatted number as specified by
1802
+ // 3GPP 23.040 Sec 9.1.2.5.
1803
+ //
1804
+ // For example: +3106225412 or (650) 555-1221
1805
+ string number = 1;
1806
+ }
1807
+
1808
+ // Specifies environment background for AI glasses.
1809
+ message Environment {
1810
+ // Key/value pairs corresponing to the contents of the environment.ini file.
1811
+ // An empty map means no environment.
1812
+ map<string, string> environment = 1;
1813
+ }