android-emulator-webrtc 1.0.18 → 2.0.1
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.
- package/README.md +93 -204
- package/dist/components/emulator/emulator.d.ts +64 -0
- package/dist/components/emulator/emulator.js +161 -173
- package/dist/components/emulator/net/emulator_status.d.ts +45 -0
- package/dist/components/emulator/net/emulator_status.js +35 -42
- package/dist/components/emulator/net/logcat.js +37 -54
- package/dist/components/emulator/net/logger.d.ts +7 -0
- package/dist/components/emulator/net/logger.js +20 -0
- package/dist/components/emulator/net/ws_jsep_protocol_driver.d.ts +213 -0
- package/dist/components/emulator/net/ws_jsep_protocol_driver.js +640 -0
- package/dist/components/emulator/views/event_handler.d.ts +37 -0
- package/dist/components/emulator/views/event_handler.js +274 -260
- package/dist/components/emulator/views/webrtc_view.d.ts +27 -0
- package/dist/components/emulator/views/webrtc_view.js +42 -20
- package/dist/index.d.ts +8 -0
- package/dist/index.js +0 -7
- package/dist/proto/emulator_controller_pb.d.ts +1 -0
- package/dist/proto/emulator_controller_pb.js +146 -287
- package/dist/src/components/emulator/emulator.d.ts +64 -0
- package/dist/src/components/emulator/net/emulator_status.d.ts +45 -0
- package/dist/src/components/emulator/net/logger.d.ts +7 -0
- package/dist/src/components/emulator/net/ws_jsep_protocol_driver.d.ts +213 -0
- package/dist/src/components/emulator/views/event_handler.d.ts +37 -0
- package/dist/src/components/emulator/views/webrtc_view.d.ts +27 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/proto/emulator_controller_pb.d.ts +1 -0
- package/package.json +17 -17
- package/proto/emulator_controller.proto +746 -181
- package/.vscode/launch.json +0 -21
- package/.vscode/settings.json +0 -3
- package/CONTRIBUTING.md +0 -28
- package/Makefile +0 -123
- package/android-emulator-webrtc.code-workspace +0 -7
- package/api_descriptor.pb +0 -0
- package/babel.config.js +0 -16
- package/cloudbuild.yaml +0 -41
- package/cloudbuilders/.gcloudignore +0 -1
- package/cloudbuilders/Dockerfile +0 -20
- package/cloudbuilders/README.md +0 -29
- package/cloudbuilders/cloudbuild.yaml +0 -19
- package/dist/components/emulator/net/jsep_protocol_driver.js +0 -365
- package/dist/components/emulator/views/simple_png_view.js +0 -110
- package/dist/proto/emulator_controller_grpc_web_pb.js +0 -1601
- package/dist/proto/emulator_web_client.js +0 -176
- package/dist/proto/rtc_service_grpc_web_pb.js +0 -231
- package/dist/proto/rtc_service_pb.js +0 -338
- package/emulator/index.js +0 -1
- package/eslint_prefix.py +0 -37
- package/gen_md_doc.js +0 -40
- package/npmrc.enc +0 -0
- package/proto/rtc_service.proto +0 -117
- package/protoc-plugin/Makefile +0 -31
- package/protoc-plugin/grpc_generator.cc +0 -1755
- package/src/components/emulator/emulator.js +0 -217
- package/src/components/emulator/net/emulator_status.js +0 -94
- package/src/components/emulator/net/jsep_protocol_driver.js +0 -364
- package/src/components/emulator/net/logcat.js +0 -155
- package/src/components/emulator/views/event_handler.js +0 -268
- package/src/components/emulator/views/simple_png_view.js +0 -105
- package/src/components/emulator/views/webrtc_view.js +0 -142
- package/src/index.js +0 -20
- package/src/proto/emulator_web_client.js +0 -140
- package/test/cloudbuild.yaml +0 -41
- package/test/emulator.test.js +0 -125
- package/test/event_handler.test.js +0 -91
- package/test/fake_events.js +0 -50
- package/test/jsep_protocol_driver.test.js +0 -228
- package/test/simple_png_view.test.js +0 -145
- package/test/touch_event_handler.test.js +0 -118
|
@@ -45,255 +45,606 @@ import "google/protobuf/empty.proto";
|
|
|
45
45
|
// android usually responds to these events.
|
|
46
46
|
service EmulatorController {
|
|
47
47
|
// set/get/stream the sensor data
|
|
48
|
+
// This RPC is not implemented in EmulatorController and will return an unimplemented error.
|
|
48
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.
|
|
49
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.
|
|
50
68
|
rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
|
|
51
69
|
|
|
52
70
|
// set/get/stream the physical model, this is likely the one you are
|
|
53
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.
|
|
54
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.
|
|
55
85
|
rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
|
|
86
|
+
// This RPC is not implemented in EmulatorController and will return an unimplemented error.
|
|
56
87
|
rpc streamPhysicalModel(PhysicalModelValue)
|
|
57
88
|
returns (stream PhysicalModelValue) {}
|
|
58
89
|
|
|
59
|
-
// Atomically
|
|
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.
|
|
60
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.
|
|
61
99
|
rpc getClipboard(google.protobuf.Empty) returns (ClipData) {}
|
|
62
100
|
|
|
63
|
-
// Streams
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
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.
|
|
69
111
|
rpc streamClipboard(google.protobuf.Empty) returns (stream ClipData) {}
|
|
70
112
|
|
|
71
|
-
//
|
|
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.
|
|
72
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.
|
|
73
125
|
rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
|
|
74
126
|
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
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.
|
|
79
136
|
rpc setGps(GpsState) returns (google.protobuf.Empty) {}
|
|
80
137
|
|
|
81
|
-
// Gets the latest
|
|
82
|
-
// if active.
|
|
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.
|
|
83
141
|
//
|
|
84
|
-
// Note:
|
|
85
|
-
// time
|
|
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.
|
|
86
148
|
rpc getGps(google.protobuf.Empty) returns (GpsState) {}
|
|
87
149
|
|
|
88
|
-
//
|
|
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.
|
|
89
159
|
rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
|
|
90
160
|
|
|
91
|
-
//
|
|
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.
|
|
92
172
|
rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
//
|
|
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.
|
|
96
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.
|
|
97
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.
|
|
98
196
|
rpc injectWheel(stream WheelEvent) returns (google.protobuf.Empty) {}
|
|
99
197
|
|
|
100
|
-
//
|
|
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.
|
|
101
235
|
rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
|
|
102
236
|
|
|
103
|
-
// Sends an
|
|
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`.
|
|
104
249
|
rpc sendSms(SmsMessage) returns (PhoneResponse) {}
|
|
105
250
|
|
|
106
|
-
//
|
|
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.
|
|
107
260
|
rpc setPhoneNumber(PhoneNumber) returns (PhoneResponse) {}
|
|
108
261
|
|
|
109
|
-
//
|
|
110
|
-
//
|
|
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.
|
|
111
278
|
rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
|
|
112
279
|
|
|
113
|
-
//
|
|
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.
|
|
114
285
|
//
|
|
115
|
-
// The
|
|
116
|
-
// the
|
|
117
|
-
//
|
|
118
|
-
// result in using the display width and height.
|
|
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.
|
|
119
289
|
//
|
|
120
|
-
// The
|
|
121
|
-
//
|
|
122
|
-
// 1080x1920 screen and is in landscape mode and called with no width or
|
|
123
|
-
// height parameter, it will return a 1920x1080 image.
|
|
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.
|
|
124
292
|
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
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).
|
|
129
298
|
//
|
|
130
|
-
// This method will return an
|
|
299
|
+
// This method will return an image with width 0 and height 0 if the display is not visible.
|
|
131
300
|
rpc getScreenshot(ImageFormat) returns (Image) {}
|
|
132
301
|
|
|
133
|
-
// Streams a series of screenshots in the desired format.
|
|
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.
|
|
134
308
|
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
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.
|
|
139
313
|
//
|
|
140
|
-
//
|
|
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.
|
|
141
318
|
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
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.
|
|
145
323
|
rpc streamScreenshot(ImageFormat) returns (stream Image) {}
|
|
146
324
|
|
|
147
|
-
// Streams a series of audio packets in the desired format.
|
|
148
|
-
// A new frame
|
|
149
|
-
//
|
|
150
|
-
//
|
|
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.
|
|
151
330
|
//
|
|
152
|
-
//
|
|
153
|
-
// produce any audio whatsoever!
|
|
331
|
+
// This method returns `OK` (code 0) upon successful streaming initiation.
|
|
154
332
|
rpc streamAudio(AudioFormat) returns (stream AudioPacket) {}
|
|
155
333
|
|
|
156
|
-
// Injects a series of audio packets
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
// that the emulator is requesting frames. Audio will be stored in a
|
|
160
|
-
// temporary buffer that can hold 300ms of audio.
|
|
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.
|
|
161
337
|
//
|
|
162
338
|
// Notes:
|
|
163
|
-
// - Only the first
|
|
164
|
-
//
|
|
165
|
-
// -
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
// - FAILED_PRECONDITION (code 9) If there was a microphone registered
|
|
173
|
-
// already.
|
|
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.
|
|
174
348
|
rpc injectAudio(stream AudioPacket) returns (google.protobuf.Empty) {}
|
|
175
349
|
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
// it is possible that the logcat buffer gets overwritten, or falls behind.
|
|
179
|
-
rpc getLogcat(LogMessage) returns (LogMessage) {}
|
|
350
|
+
// Retrieves the current settings for the microphone
|
|
351
|
+
rpc getMicrophoneState(google.protobuf.Empty) returns (MicrophoneState) {}
|
|
180
352
|
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
//
|
|
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.
|
|
185
374
|
rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
|
|
186
375
|
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
//
|
|
376
|
+
// Transitions the virtual machine to the desired state. This operation is scheduled
|
|
377
|
+
// asynchronously.
|
|
378
|
+
//
|
|
379
|
+
// Transition commands:
|
|
380
|
+
// - `RUNNING` or `START`: Starts or resumes execution of the virtual machine.
|
|
381
|
+
// - `PAUSED` or `STOP`: Pauses execution of the virtual machine, halting CPU cycles.
|
|
382
|
+
// - `RESET` or `RESTART`: Performs a warm reset of the virtual machine.
|
|
383
|
+
// - `SHUTDOWN`: Initiates a graceful shutdown of the emulator.
|
|
384
|
+
// - `TERMINATE`: Forcefully terminates the emulator process immediately without cleanup.
|
|
385
|
+
// This can cause data corruption and must be used with caution.
|
|
386
|
+
//
|
|
387
|
+
// Note that write-only actions (`START`, `STOP`, `RESET`, `RESTART`) perform the
|
|
388
|
+
// transition but are not observed as states in `getVmState`. Purely observable states
|
|
389
|
+
// (`UNKNOWN`, `RESTORE_VM`, `SAVE_VM`, `INTERNAL_ERROR`) cannot be set directly.
|
|
390
|
+
//
|
|
391
|
+
// Returns once the operation has been scheduled.
|
|
392
|
+
// Note: The call may not return when the state is set to `TERMINATE` or `SHUTDOWN`.
|
|
190
393
|
rpc setVmState(VmRunState) returns (google.protobuf.Empty) {}
|
|
191
394
|
|
|
192
|
-
//
|
|
395
|
+
// Retrieves the current execution state of the virtual machine.
|
|
396
|
+
//
|
|
397
|
+
// The returned `VmRunState` represents the current condition of the VM:
|
|
398
|
+
// - `RUNNING`: The virtual machine is actively executing.
|
|
399
|
+
// - `PAUSED`: Execution is suspended (CPUs are halted).
|
|
400
|
+
// - `SHUTDOWN`: The guest operating system has initiated a shutdown.
|
|
401
|
+
// - `RESTORE_VM`: The virtual machine is paused while restoring its state (e.g., loading a snapshot).
|
|
402
|
+
// - `SAVE_VM`: The virtual machine is paused while saving its state (e.g., taking a snapshot).
|
|
403
|
+
// - `INTERNAL_ERROR`: Execution has stopped due to a guest panic, I/O error, or hypervisor failure.
|
|
404
|
+
// - `UNKNOWN`: The virtual machine is in an unmapped or transient state.
|
|
405
|
+
//
|
|
406
|
+
// This is a synchronous query operation.
|
|
193
407
|
rpc getVmState(google.protobuf.Empty) returns (VmRunState) {}
|
|
194
408
|
|
|
195
|
-
// Atomically changes the current multi-display configuration.
|
|
196
|
-
//
|
|
197
|
-
//
|
|
409
|
+
// Atomically changes the current multi-display configuration. This operation applies
|
|
410
|
+
// the provided `DisplayConfigurations`, with special handling for secondary displays.
|
|
411
|
+
// Display ID 0 (the primary display) cannot be modified via this RPC.
|
|
198
412
|
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
413
|
+
// Preconditions:
|
|
414
|
+
// - The `android::featurecontrol::MultiDisplay` feature must be enabled.
|
|
201
415
|
//
|
|
202
|
-
//
|
|
203
|
-
// -
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
// -
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
//
|
|
210
|
-
//
|
|
416
|
+
// Input Validation:
|
|
417
|
+
// - `INVALID_ARGUMENT` (code 3): If duplicate `display` IDs are found in the request.
|
|
418
|
+
// - `INVALID_ARGUMENT` (code 3): If any `DisplayConfiguration` (width, height, dpi, flags)
|
|
419
|
+
// is outside valid ranges as determined by `multiDisplayParamValidate`.
|
|
420
|
+
// - `INVALID_ARGUMENT` (code 3): If any `display` ID is outside the configurable range
|
|
421
|
+
// `[1, userConfigurable]`.
|
|
422
|
+
//
|
|
423
|
+
// Atomic Update and Rollback:
|
|
424
|
+
// The system attempts to apply each display configuration. If any update fails
|
|
425
|
+
// (e.g., after multiple retries for transient pipe errors), a rollback mechanism
|
|
426
|
+
// is initiated: successfully updated displays are reverted to their previous state,
|
|
427
|
+
// and newly added displays are deleted. In such cases, an `INTERNAL` error is returned.
|
|
428
|
+
//
|
|
429
|
+
// Deletion of Unrequested Displays:
|
|
430
|
+
// Any displays that were active before this call but are not present in the new
|
|
431
|
+
// `request.displays` (and are not display ID 0) will be deleted.
|
|
432
|
+
//
|
|
433
|
+
// Notifications:
|
|
434
|
+
// Upon successful completion, `notifyDisplayChanges()` is called to inform
|
|
435
|
+
// third-party subscribers.
|
|
436
|
+
//
|
|
437
|
+
// Returns the following gRPC error codes:
|
|
438
|
+
// - `OK` (code 0): Upon successful application of all configurations, returning the final active `DisplayConfigurations`.
|
|
439
|
+
// - `FAILED_PRECONDITION` (code 9): If the multi-display feature is not available.
|
|
440
|
+
// - `INTERNAL` (code 13): If an internal emulator failure occurs during display modification or rollback.
|
|
211
441
|
rpc setDisplayConfigurations(DisplayConfigurations)
|
|
212
442
|
returns (DisplayConfigurations) {}
|
|
213
443
|
|
|
214
|
-
// Returns all currently valid logical displays.
|
|
444
|
+
// Returns all currently valid logical displays configured in the emulator. This is a synchronous operation.
|
|
445
|
+
//
|
|
446
|
+
// Preconditions:
|
|
447
|
+
// - The `android::featurecontrol::MultiDisplay` feature must be enabled.
|
|
448
|
+
//
|
|
449
|
+
// The `DisplayConfigurations` reply contains:
|
|
450
|
+
// - `displays`: A repeated field of `DisplayConfiguration` objects, each detailing
|
|
451
|
+
// the width, height, DPI, flags, and ID of an active display.
|
|
452
|
+
// For Pixel Fold devices, only the main display configuration might be relevant.
|
|
453
|
+
// - `userConfigurable`: The maximum number of user-configurable displays (IDs from 1 up to this value).
|
|
454
|
+
// - `maxDisplays`: The total maximum number of displays the emulator supports.
|
|
215
455
|
//
|
|
216
|
-
//
|
|
217
|
-
//
|
|
456
|
+
// This method returns:
|
|
457
|
+
// - `OK` (code 0) and the current `DisplayConfigurations` upon success.
|
|
458
|
+
// - `FAILED_PRECONDITION` (code 9): If the AVD does not support the multi-display feature.
|
|
218
459
|
rpc getDisplayConfigurations(google.protobuf.Empty)
|
|
219
460
|
returns (DisplayConfigurations) {}
|
|
220
461
|
|
|
221
|
-
// Notifies client of
|
|
462
|
+
// Notifies the client of various emulator state changes in real-time. This is a server-side streaming RPC.
|
|
463
|
+
// Upon subscription, the current states of virtual scene camera, foldable posture, boot completion,
|
|
464
|
+
// and XR options are immediately sent. The stream then continuously delivers new notifications
|
|
465
|
+
// when relevant events occur. `UniqueEventStreamWriter` ensures that only distinct state changes are streamed.
|
|
222
466
|
//
|
|
223
|
-
//
|
|
224
|
-
// -
|
|
225
|
-
//
|
|
226
|
-
//
|
|
467
|
+
// Notifications include:
|
|
468
|
+
// - `CameraNotification`: Reports virtual scene camera activation/deactivation and associated display.
|
|
469
|
+
// - `DisplayConfigurationsChangedNotification`: Triggered when display configurations are modified via the extended UI. Does not fire for changes made through console or gRPC.
|
|
470
|
+
// - `Posture`: Reports changes in the device's foldable posture.
|
|
471
|
+
// - `BootCompletedNotification`: Indicates when the emulator has finished booting.
|
|
472
|
+
// - `BrightnessValue`: Reports changes in backlight brightness (LCD, keyboard, or button).
|
|
473
|
+
// - `TextViewFocus`: Sent when a text view gains or loses focus, or immediately on subscription.
|
|
474
|
+
// - `XrOptions`: Reports changes in XR-related settings (environment, passthrough coefficient), or immediately on subscription.
|
|
475
|
+
// - `MicrophoneState` : Reports changes in the microphone state (currently whether host microphone access is allowed)
|
|
476
|
+
// - `LedIndicator`: Reports changes in AI Glasses XR LED light state on subscription.
|
|
227
477
|
//
|
|
228
|
-
//
|
|
229
|
-
// immediately.
|
|
478
|
+
// This method returns a server-side streaming reactor.
|
|
230
479
|
rpc streamNotification(google.protobuf.Empty)
|
|
231
480
|
returns (stream Notification) {}
|
|
232
481
|
|
|
233
|
-
//
|
|
482
|
+
// Rotates the virtual scene camera relative to its current orientation. This operation is asynchronous
|
|
483
|
+
// and executed on the main looper.
|
|
484
|
+
//
|
|
485
|
+
// The `RotationRadian` message specifies angles in radians around the x, y, and z axes. The z component of rotation is currently unused.
|
|
486
|
+
// The coordinate system is right-handed: x-axis points right, y-axis points up, and z-axis points towards the viewer.
|
|
487
|
+
// This operation only succeeds if the virtual scene camera is actively connected.
|
|
488
|
+
//
|
|
489
|
+
// This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
|
|
234
490
|
rpc rotateVirtualSceneCamera(RotationRadian)
|
|
235
491
|
returns (google.protobuf.Empty) {}
|
|
236
|
-
//
|
|
492
|
+
// Sets the absolute velocity of the virtual scene camera. This operation is asynchronous
|
|
493
|
+
// and executed on the main looper.
|
|
494
|
+
//
|
|
495
|
+
// The `Velocity` message specifies components in meters per second along the x, y, and z axes.
|
|
496
|
+
// The coordinate system is right-handed: x-axis points right, y-axis points up, and z-axis points towards the viewer.
|
|
497
|
+
// The transition to these target velocity values may be smoothed over time by the implementation.
|
|
498
|
+
// This operation only succeeds if the virtual scene camera is actively connected.
|
|
499
|
+
//
|
|
500
|
+
// This method returns `OK` (code 0) upon successful asynchronous scheduling of the operation.
|
|
237
501
|
rpc setVirtualSceneCameraVelocity(Velocity)
|
|
238
502
|
returns (google.protobuf.Empty) {}
|
|
239
|
-
//
|
|
503
|
+
// Sets the foldable posture of the device. This operation is asynchronous
|
|
504
|
+
// and executed on the main looper.
|
|
505
|
+
//
|
|
506
|
+
// The `Posture` message contains a `PostureValue` enum, defining the desired
|
|
507
|
+
// physical configuration of the foldable device.
|
|
508
|
+
//
|
|
509
|
+
// Returns the following gRPC error codes:
|
|
510
|
+
// - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
|
|
511
|
+
// - `FAILED_PRECONDITION` (code 9): If the emulator is unable to set the specified posture.
|
|
240
512
|
rpc setPosture(Posture) returns (google.protobuf.Empty) {}
|
|
241
513
|
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
//
|
|
514
|
+
// Retrieves the current backlight brightness for a specified light type. This is a synchronous operation.
|
|
515
|
+
//
|
|
516
|
+
// The `BrightnessValue.target` field (e.g., `LCD`, `KEYBOARD`, `BUTTON`) determines which light's brightness is queried.
|
|
517
|
+
// Internal mapping converts these to string names like "lcd_backlight".
|
|
518
|
+
//
|
|
519
|
+
// Returns the following gRPC error codes:
|
|
520
|
+
// - `OK` (code 0): Upon successful retrieval, populating the `BrightnessValue` reply with the `target` and current `value`.
|
|
521
|
+
// - `FAILED_PRECONDITION` (code 9): If the AVD does not support the `hw-control` agent or its `getBrightness` function is unavailable.
|
|
245
522
|
rpc getBrightness(BrightnessValue) returns (BrightnessValue) {}
|
|
246
523
|
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
//
|
|
524
|
+
// Sets the backlight brightness for a specified light type. This operation is asynchronous
|
|
525
|
+
// and executed on the main looper.
|
|
526
|
+
//
|
|
527
|
+
// The `BrightnessValue.target` field (e.g., `LCD`, `KEYBOARD`, `BUTTON`) determines which light's brightness is set.
|
|
528
|
+
// The `BrightnessValue.value` specifies the desired intensity, ranging from 0 to 255.
|
|
529
|
+
// Internal mapping converts `LightType` to string names like "lcd_backlight".
|
|
530
|
+
//
|
|
531
|
+
// Returns the following gRPC error codes:
|
|
532
|
+
// - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
|
|
533
|
+
// - `FAILED_PRECONDITION` (code 9): If the AVD does not support the `hw-control` agent or its `setBrightness` function is unavailable.
|
|
534
|
+
// - `INVALID_ARGUMENT` (code 3): If the `brightness` value exceeds the valid range (0-255).
|
|
251
535
|
rpc setBrightness(BrightnessValue) returns (google.protobuf.Empty) {}
|
|
252
536
|
|
|
253
|
-
// Returns the current mode of the primary display of a resizable AVD.
|
|
254
|
-
//
|
|
255
|
-
//
|
|
537
|
+
// Returns the current mode of the primary display of a resizable AVD. This is a synchronous operation.
|
|
538
|
+
//
|
|
539
|
+
// Preconditions:
|
|
540
|
+
// - The AVD must be configured to support resizable displays (`resizableEnabled()` must be true).
|
|
541
|
+
//
|
|
542
|
+
// The `DisplayMode.value` field will be populated with the current `DisplayModeValue`,
|
|
543
|
+
// derived from the `getResizableActiveConfigId()`.
|
|
544
|
+
//
|
|
545
|
+
// Returns the following gRPC error codes:
|
|
546
|
+
// - `OK` (code 0): Upon successful retrieval of the display mode.
|
|
547
|
+
// - `FAILED_PRECONDITION` (code 9): If the AVD is not resizable.
|
|
256
548
|
rpc getDisplayMode(google.protobuf.Empty) returns (DisplayMode) {}
|
|
257
549
|
|
|
258
|
-
// Sets the size of the primary display of a resizable AVD
|
|
259
|
-
//
|
|
260
|
-
//
|
|
550
|
+
// Sets the size of the primary display of a resizable AVD to the specified `DisplayModeValue`. This operation is asynchronous
|
|
551
|
+
// and executed on the main looper.
|
|
552
|
+
//
|
|
553
|
+
// Preconditions:
|
|
554
|
+
// - The AVD must be configured to support resizable displays (`resizableEnabled()` must be true).
|
|
555
|
+
// - The emulator's `changeResizableDisplay` agent function must be available.
|
|
556
|
+
//
|
|
557
|
+
// The `DisplayMode.value` field specifies the desired display configuration (e.g., `PHONE`, `FOLDABLE`, `TABLET`, `DESKTOP`).
|
|
558
|
+
//
|
|
559
|
+
// Returns the following gRPC error codes:
|
|
560
|
+
// - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
|
|
561
|
+
// - `FAILED_PRECONDITION` (code 9): If the AVD is not resizable.
|
|
562
|
+
// - `INTERNAL` (code 13): If the internal window agent function `changeResizableDisplay` is not available.
|
|
261
563
|
rpc setDisplayMode(DisplayMode) returns (google.protobuf.Empty) {}
|
|
564
|
+
|
|
565
|
+
// Changes the XR-related settings of the emulator. This operation is asynchronous
|
|
566
|
+
// and executed on the main looper.
|
|
567
|
+
//
|
|
568
|
+
// The `XrOptions` message specifies the `environment` (e.g., `LIVING_ROOM_DAY`, `LIVING_ROOM_NIGHT`)
|
|
569
|
+
// and `passthrough_coefficient` (a float between 0.0 and 1.0 for real/artificial environment visibility).
|
|
570
|
+
// Values for `passthrough_coefficient` outside [0.0, 1.0] are ignored.
|
|
571
|
+
//
|
|
572
|
+
// Returns the following gRPC error codes:
|
|
573
|
+
// - `OK` (code 0): Upon successful asynchronous scheduling of the operation.
|
|
574
|
+
// - `FAILED_PRECONDITION` (code 9): If the `setXrOptions` agent function fails (e.g., if XR is not supported).
|
|
575
|
+
rpc setXrOptions(XrOptions) returns (google.protobuf.Empty) {}
|
|
576
|
+
|
|
577
|
+
// Retrieves the current state of XR-related settings from the emulator. This is a synchronous operation.
|
|
578
|
+
//
|
|
579
|
+
// Preconditions:
|
|
580
|
+
// - XR mode must be supported in the current AVD (`isXrGuestOs()` must be true).
|
|
581
|
+
// (Note: Current implementation of `isXrGuestOs()` always returns true).
|
|
582
|
+
//
|
|
583
|
+
// The `XrOptions` reply contains the current `environment` and `passthrough_coefficient`.
|
|
584
|
+
//
|
|
585
|
+
// Returns the following gRPC error codes:
|
|
586
|
+
// - `OK` (code 0): Upon successful retrieval of the XR options.
|
|
587
|
+
// - `FAILED_PRECONDITION` (code 9): If XR mode is not supported in the current AVD or if the `getXrOptions` agent function fails.
|
|
588
|
+
rpc getXrOptions(google.protobuf.Empty) returns (XrOptions) {}
|
|
589
|
+
|
|
590
|
+
// Sets the environment background for AI glasses.
|
|
591
|
+
rpc setEnvironment(Environment) returns (google.protobuf.Empty) {}
|
|
592
|
+
|
|
593
|
+
// Gets the current environment configuration for AI glasses. Values that are not set in environment.ini
|
|
594
|
+
// will be set to default values.
|
|
595
|
+
rpc getEnvironment(google.protobuf.Empty) returns (Environment) {}
|
|
596
|
+
|
|
597
|
+
// Returns the list of video cameras connected to the host machine.
|
|
598
|
+
rpc getHostCameras(google.protobuf.Empty) returns (CameraList) {}
|
|
262
599
|
}
|
|
263
600
|
|
|
264
|
-
//
|
|
601
|
+
// Represents the execution state of the virtual machine, used for both querying the
|
|
602
|
+
// current status and requesting state transitions.
|
|
265
603
|
message VmRunState {
|
|
266
604
|
enum RunState {
|
|
267
|
-
// The
|
|
268
|
-
//
|
|
605
|
+
// Purely observable state. The virtual machine is in an unmapped or transient state.
|
|
606
|
+
// Cannot be set directly.
|
|
269
607
|
UNKNOWN = 0;
|
|
270
|
-
|
|
271
|
-
//
|
|
608
|
+
|
|
609
|
+
// Active execution state. Setting this state resumes the virtual machine.
|
|
272
610
|
RUNNING = 1;
|
|
273
|
-
|
|
274
|
-
// state.
|
|
611
|
+
|
|
612
|
+
// Purely observable state. The virtual machine is paused while restoring its state
|
|
613
|
+
// (e.g., loading a snapshot). Cannot be set directly.
|
|
275
614
|
RESTORE_VM = 2;
|
|
276
|
-
|
|
277
|
-
//
|
|
615
|
+
|
|
616
|
+
// Suspended execution state. Setting this state pauses the virtual machine and halts
|
|
617
|
+
// CPU cycles.
|
|
278
618
|
PAUSED = 3;
|
|
279
|
-
|
|
280
|
-
//
|
|
619
|
+
|
|
620
|
+
// Purely observable state. The virtual machine is paused while saving its state
|
|
621
|
+
// (e.g., taking a snapshot). Cannot be set directly.
|
|
281
622
|
SAVE_VM = 4;
|
|
282
|
-
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
// a snapshot. This is the same behavior as closing the emulator by
|
|
286
|
-
// clicking the X (close) in the user interface.
|
|
623
|
+
|
|
624
|
+
// Graceful shutdown state. Setting this state initiates a clean shutdown of the
|
|
625
|
+
// virtual machine.
|
|
287
626
|
SHUTDOWN = 5;
|
|
288
|
-
|
|
289
|
-
//
|
|
627
|
+
|
|
628
|
+
// Write-only command. Immediately terminates the emulator process without cleanup.
|
|
629
|
+
// Can cause data corruption and must be used with caution.
|
|
290
630
|
TERMINATE = 7;
|
|
291
|
-
|
|
292
|
-
//
|
|
631
|
+
|
|
632
|
+
// Write-only command. Triggers a warm reset of the virtual machine.
|
|
293
633
|
RESET = 9;
|
|
294
|
-
|
|
295
|
-
// state.
|
|
634
|
+
|
|
635
|
+
// Purely observable state. The virtual machine has stopped execution due to a guest
|
|
636
|
+
// panic, internal error, or I/O failure. Cannot be set directly.
|
|
296
637
|
INTERNAL_ERROR = 10;
|
|
638
|
+
|
|
639
|
+
// Write-only command. Triggers a warm reset of the virtual machine (equivalent to `RESET`).
|
|
640
|
+
RESTART = 11;
|
|
641
|
+
|
|
642
|
+
// Write-only command. Starts or resumes execution of the virtual machine (equivalent
|
|
643
|
+
// to `RUNNING`).
|
|
644
|
+
START = 12;
|
|
645
|
+
|
|
646
|
+
// Write-only command. Stops execution of the virtual machine (equivalent to `PAUSED`).
|
|
647
|
+
STOP = 13;
|
|
297
648
|
}
|
|
298
649
|
|
|
299
650
|
RunState state = 1;
|
|
@@ -372,6 +723,14 @@ message PhysicalModelValue {
|
|
|
372
723
|
|
|
373
724
|
// Value interpretation depends on sensor.
|
|
374
725
|
ParameterValue value = 3;
|
|
726
|
+
|
|
727
|
+
enum Interpolation {
|
|
728
|
+
SMOOTH = 0;
|
|
729
|
+
STEP = 1;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// [Input Only] How to transition to the target value.
|
|
733
|
+
Interpolation interpolation = 4;
|
|
375
734
|
}
|
|
376
735
|
|
|
377
736
|
// A single sensor value.
|
|
@@ -427,6 +786,9 @@ message SensorValue {
|
|
|
427
786
|
// instead.
|
|
428
787
|
// Measures acceleration force and provides bias data.
|
|
429
788
|
ACCELERATION_UNCALIBRATED = 17;
|
|
789
|
+
// A sensor of this type measures the direction in which the device is
|
|
790
|
+
// pointing relative to true north in degrees.
|
|
791
|
+
HEADING = 18;
|
|
430
792
|
}
|
|
431
793
|
|
|
432
794
|
// Type of sensor
|
|
@@ -467,6 +829,50 @@ message DisplayMode {
|
|
|
467
829
|
DisplayModeValue value = 1;
|
|
468
830
|
}
|
|
469
831
|
|
|
832
|
+
message XrOptions {
|
|
833
|
+
enum Environment {
|
|
834
|
+
LIVING_ROOM_DAY = 0;
|
|
835
|
+
LIVING_ROOM_NIGHT = 1;
|
|
836
|
+
// More environments may be added later.
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// The currently active artificial surrounding environment (a.k.a.
|
|
840
|
+
// passthrough environment).
|
|
841
|
+
Environment environment = 1;
|
|
842
|
+
|
|
843
|
+
// A value of 0.0 means that the real or artificial surrounding environment
|
|
844
|
+
// (a.k.a. passthrough environment) is not visible. A value of 1.0 means
|
|
845
|
+
// that the passthrough environment is fully visible. Any value outside of
|
|
846
|
+
// the range [0.0-1.0] is ignored and leaves the state of passthrough
|
|
847
|
+
// unchanged. For simplicity of the implementation, this number may be
|
|
848
|
+
// rounded to an integer before applying.
|
|
849
|
+
float passthrough_coefficient = 2;
|
|
850
|
+
|
|
851
|
+
float dimming_value = 4;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// The state of one LED indicator of AI glasses.
|
|
855
|
+
message LedIndicator {
|
|
856
|
+
enum Facing {
|
|
857
|
+
INSIDE = 0;
|
|
858
|
+
OUTSIDE = 1;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
enum State {
|
|
862
|
+
OFF = 0;
|
|
863
|
+
ON = 1;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// The indicator's identifier.
|
|
867
|
+
optional uint32 id = 1;
|
|
868
|
+
// Determines whether the indicator is inside or outside of the glasses frames.
|
|
869
|
+
optional Facing facing = 2;
|
|
870
|
+
// Determines whether the indicator is on or off.
|
|
871
|
+
optional State state = 3;
|
|
872
|
+
// Color in RGB format.
|
|
873
|
+
optional uint32 color = 4;
|
|
874
|
+
}
|
|
875
|
+
|
|
470
876
|
message LogMessage {
|
|
471
877
|
// [Output Only] The contents of the log output.
|
|
472
878
|
string contents = 1;
|
|
@@ -474,11 +880,11 @@ message LogMessage {
|
|
|
474
880
|
// should match the start parameter sent with the request. If the serial
|
|
475
881
|
// console output exceeds the size of the buffer, older output will be
|
|
476
882
|
// overwritten by newer content and the start values will be mismatched.
|
|
477
|
-
int64 start = 2;
|
|
883
|
+
int64 start = 2 [deprecated = true];
|
|
478
884
|
//[Output Only] The position of the next byte of content from the serial
|
|
479
885
|
// console output. Use this value in the next request as the start
|
|
480
886
|
// parameter.
|
|
481
|
-
int64 next = 3;
|
|
887
|
+
int64 next = 3 [deprecated = true];
|
|
482
888
|
|
|
483
889
|
// Set the sort of response you are interested it in.
|
|
484
890
|
// It the type is "Parsed" the entries field will contain the parsed
|
|
@@ -541,8 +947,7 @@ message VmConfiguration {
|
|
|
541
947
|
KVM = 2;
|
|
542
948
|
|
|
543
949
|
// Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
|
|
544
|
-
|
|
545
|
-
HAXM = 3;
|
|
950
|
+
HAXM = 3 [deprecated = true];
|
|
546
951
|
|
|
547
952
|
// Hypervisor Framework.
|
|
548
953
|
// https://developer.apple.com/documentation/hypervisor
|
|
@@ -625,6 +1030,21 @@ message Touch {
|
|
|
625
1030
|
}
|
|
626
1031
|
|
|
627
1032
|
EventExpiration expiration = 7;
|
|
1033
|
+
|
|
1034
|
+
// The orientation of the contact, if any.
|
|
1035
|
+
int32 orientation = 8;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// A Pen is similar to a touch, with the addition
|
|
1039
|
+
// of button and rubber information.
|
|
1040
|
+
message Pen {
|
|
1041
|
+
Touch location = 1;
|
|
1042
|
+
|
|
1043
|
+
// True if the button is pressed or not
|
|
1044
|
+
bool button_pressed = 2;
|
|
1045
|
+
|
|
1046
|
+
// True if it is a rubber pointer.
|
|
1047
|
+
bool rubber_pointer = 3;
|
|
628
1048
|
}
|
|
629
1049
|
|
|
630
1050
|
// A TouchEvent contains a list of Touch objects that are in contact with
|
|
@@ -640,9 +1060,31 @@ message TouchEvent {
|
|
|
640
1060
|
|
|
641
1061
|
// The display device where the touch event occurred.
|
|
642
1062
|
// Omitting or using the value 0 indicates the main display.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
1063
|
+
int32 display = 2;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// A TouchpadEvent contains a list of Touch objects that are in contact with
|
|
1067
|
+
// the touchpad surface.
|
|
1068
|
+
//
|
|
1069
|
+
// Touchpad events are delivered in sequence as specified in the touchList.
|
|
1070
|
+
//
|
|
1071
|
+
// TouchpadEvents are delivered to the emulated devices using ["Protocol
|
|
1072
|
+
// B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
|
|
1073
|
+
message TouchpadEvent {
|
|
1074
|
+
// The list of Touch objects, note that these do not need to be unique
|
|
1075
|
+
repeated Touch touches = 1;
|
|
1076
|
+
|
|
1077
|
+
// The touchpad device where the touch event occurred.
|
|
1078
|
+
// Omitting or using the value 0 indicates the main touchpad.
|
|
1079
|
+
int32 touchpad = 2;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
message PenEvent {
|
|
1083
|
+
// The list of Pen objects, note that these do not need to be unique
|
|
1084
|
+
repeated Pen events = 1;
|
|
1085
|
+
|
|
1086
|
+
// The display device where the pen event occurred.
|
|
1087
|
+
// Omitting or using the value 0 indicates the main display.
|
|
646
1088
|
int32 display = 2;
|
|
647
1089
|
}
|
|
648
1090
|
|
|
@@ -650,11 +1092,11 @@ message TouchEvent {
|
|
|
650
1092
|
// interacting with a pointing device (such as a mouse).
|
|
651
1093
|
message MouseEvent {
|
|
652
1094
|
// The horizontal coordinate. This is the physical location on the
|
|
653
|
-
// screen
|
|
1095
|
+
// screen, where 0 indicates the leftmost coordinate.
|
|
654
1096
|
int32 x = 1;
|
|
655
1097
|
|
|
656
|
-
// The vertical coordinate. This is the physical location on the screen
|
|
657
|
-
//
|
|
1098
|
+
// The vertical coordinate. This is the physical location on the screen,
|
|
1099
|
+
// where 0 indicates the topmost coordinate.
|
|
658
1100
|
int32 y = 2;
|
|
659
1101
|
|
|
660
1102
|
// Indicates which buttons are pressed.
|
|
@@ -780,6 +1222,58 @@ message KeyboardEvent {
|
|
|
780
1222
|
string text = 5;
|
|
781
1223
|
}
|
|
782
1224
|
|
|
1225
|
+
message XrCommand {
|
|
1226
|
+
enum Action {
|
|
1227
|
+
// Recenter the viewport position and rotation.
|
|
1228
|
+
RECENTER = 0;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
Action action = 1;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
// An input event that can be delivered to the emulator.
|
|
1235
|
+
message InputEvent {
|
|
1236
|
+
oneof type {
|
|
1237
|
+
KeyboardEvent key_event = 1;
|
|
1238
|
+
TouchEvent touch_event = 2;
|
|
1239
|
+
MouseEvent mouse_event = 3;
|
|
1240
|
+
AndroidEvent android_event = 4;
|
|
1241
|
+
PenEvent pen_event = 5;
|
|
1242
|
+
WheelEvent wheel_event = 6;
|
|
1243
|
+
MouseEvent xr_hand_event = 7;
|
|
1244
|
+
MouseEvent xr_eye_event = 8;
|
|
1245
|
+
XrCommand xr_command = 9;
|
|
1246
|
+
RotationRadian xr_head_rotation_event = 10;
|
|
1247
|
+
Translation xr_head_movement_event = 11;
|
|
1248
|
+
AngularVelocity xr_head_angular_velocity_event = 12;
|
|
1249
|
+
Velocity xr_head_velocity_event = 13;
|
|
1250
|
+
TouchpadEvent touchpad_event = 14;
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
// The android input event system is a framework for handling input from a
|
|
1255
|
+
// variety of devices by generating events that describe changes in the
|
|
1256
|
+
// state of the devices and forwarding them to user space applications.
|
|
1257
|
+
//
|
|
1258
|
+
// An AndroidEvents will be delivered directly to the kernel as is.
|
|
1259
|
+
message AndroidEvent {
|
|
1260
|
+
// The type of the event. The types of the event are specified
|
|
1261
|
+
// by the android kernel. Some examples are:
|
|
1262
|
+
// EV_SYN, EV_KEY, EV_SW, etc..
|
|
1263
|
+
// The exact definitions can be found in the input.h header file.
|
|
1264
|
+
int32 type = 1;
|
|
1265
|
+
|
|
1266
|
+
// The actual code to be send to the kernel. The actual meaning
|
|
1267
|
+
// of the code depends on the type definition.
|
|
1268
|
+
int32 code = 2;
|
|
1269
|
+
|
|
1270
|
+
// The actual value of the event.
|
|
1271
|
+
int32 value = 3;
|
|
1272
|
+
|
|
1273
|
+
// The display id associated with this input event.
|
|
1274
|
+
int32 display = 4;
|
|
1275
|
+
};
|
|
1276
|
+
|
|
783
1277
|
message Fingerprint {
|
|
784
1278
|
// True when the fingprint is touched.
|
|
785
1279
|
bool isTouching = 1;
|
|
@@ -1039,9 +1533,22 @@ message EmulatorStatus {
|
|
|
1039
1533
|
// The current vm configuration
|
|
1040
1534
|
VmConfiguration vmConfig = 4;
|
|
1041
1535
|
|
|
1042
|
-
//
|
|
1043
|
-
|
|
1044
|
-
|
|
1536
|
+
// Use platformConfig instead
|
|
1537
|
+
EntryList hardwareConfig = 5 [deprecated = true];
|
|
1538
|
+
|
|
1539
|
+
// Some guests will produce a heart beat, that can be used to
|
|
1540
|
+
// detect if the guest is active.
|
|
1541
|
+
// This is a monotonically increasing number that gets incremented
|
|
1542
|
+
// around once a second.
|
|
1543
|
+
uint64 heartbeat = 6;
|
|
1544
|
+
|
|
1545
|
+
// The configuration of services in the guest, this map
|
|
1546
|
+
// contains key value pairs that are specific to the image
|
|
1547
|
+
// used by the guest.
|
|
1548
|
+
map<string, string> guestConfig = 7;
|
|
1549
|
+
|
|
1550
|
+
// Configuration of the emulator hardware
|
|
1551
|
+
map<string, string> platformConfig = 8;
|
|
1045
1552
|
}
|
|
1046
1553
|
|
|
1047
1554
|
message AudioFormat {
|
|
@@ -1089,6 +1596,11 @@ message AudioPacket {
|
|
|
1089
1596
|
bytes audio = 3;
|
|
1090
1597
|
}
|
|
1091
1598
|
|
|
1599
|
+
message MicrophoneState {
|
|
1600
|
+
// Whether or not host microphone access is enabled
|
|
1601
|
+
bool realAudioEnabled = 1;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1092
1604
|
message SmsMessage {
|
|
1093
1605
|
// The source address where this message came from.
|
|
1094
1606
|
//
|
|
@@ -1224,29 +1736,35 @@ message DisplayConfigurations {
|
|
|
1224
1736
|
}
|
|
1225
1737
|
|
|
1226
1738
|
message Notification {
|
|
1227
|
-
enum EventType {
|
|
1228
|
-
VIRTUAL_SCENE_CAMERA_INACTIVE = 0;
|
|
1229
|
-
VIRTUAL_SCENE_CAMERA_ACTIVE = 1;
|
|
1230
|
-
|
|
1231
|
-
// Fired when an update to a display event has been fired through
|
|
1232
|
-
// the extended ui. This does not fire events when the display
|
|
1233
|
-
// is changed through the console or gRPC endpoint.
|
|
1234
|
-
DISPLAY_CONFIGURATIONS_CHANGED_UI = 2;
|
|
1235
|
-
// Keep adding more for other event types
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
// Deprecated, use the type below to get detailed information
|
|
1239
|
-
// regarding the event.
|
|
1240
|
-
EventType event = 1 [deprecated = true];
|
|
1241
|
-
|
|
1242
1739
|
// Detailed notification information.
|
|
1243
1740
|
oneof type {
|
|
1244
1741
|
CameraNotification cameraNotification = 2;
|
|
1245
1742
|
DisplayConfigurationsChangedNotification
|
|
1246
1743
|
displayConfigurationsChangedNotification = 3;
|
|
1744
|
+
Posture posture = 4;
|
|
1745
|
+
BootCompletedNotification booted = 5;
|
|
1746
|
+
BrightnessValue brightness = 6;
|
|
1747
|
+
|
|
1748
|
+
// This notification is sent when a TextView receives or loses focus.
|
|
1749
|
+
// It is also sent immediately in response to the streamNotification
|
|
1750
|
+
// call.
|
|
1751
|
+
TextViewFocus textViewFocus = 7;
|
|
1752
|
+
// This notification is sent when XrOptions change.
|
|
1753
|
+
// It is also sent immediately in response to the streamNotification
|
|
1754
|
+
// call.
|
|
1755
|
+
XrOptions xrOptions = 8;
|
|
1756
|
+
MicrophoneState microphoneState = 9;
|
|
1757
|
+
// This notification is sent when AI glasses LED light status change.
|
|
1758
|
+
LedIndicator ledIndicator = 10;
|
|
1247
1759
|
}
|
|
1248
1760
|
}
|
|
1249
1761
|
|
|
1762
|
+
message BootCompletedNotification {
|
|
1763
|
+
// The time in milliseconds it took for the boot to complete.
|
|
1764
|
+
// Note that this value can be 0 when you are loading from a snapshot.
|
|
1765
|
+
int32 time = 1;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1250
1768
|
// Fired when the virtual scene camera is activated or deactivated and also in
|
|
1251
1769
|
// response to the streamNotification call.
|
|
1252
1770
|
message CameraNotification {
|
|
@@ -1256,6 +1774,15 @@ message CameraNotification {
|
|
|
1256
1774
|
int32 display = 2;
|
|
1257
1775
|
}
|
|
1258
1776
|
|
|
1777
|
+
message TextViewFocus {
|
|
1778
|
+
// Indicates whether a text view currently has focus.
|
|
1779
|
+
bool textViewHasFocus = 1;
|
|
1780
|
+
|
|
1781
|
+
// If a text view has focus, the display where the text view is located.
|
|
1782
|
+
// Otherwise, unset.
|
|
1783
|
+
int32 display = 2;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1259
1786
|
// Fired when an update to a display event has been fired through the extended
|
|
1260
1787
|
// ui. This does not fire events when the display is changed through the console
|
|
1261
1788
|
// or the gRPC endpoint.
|
|
@@ -1264,19 +1791,39 @@ message DisplayConfigurationsChangedNotification {
|
|
|
1264
1791
|
}
|
|
1265
1792
|
|
|
1266
1793
|
message RotationRadian {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
float
|
|
1270
|
-
|
|
1794
|
+
// Components of the rotation vector in radians.
|
|
1795
|
+
// Rotation angles are relative to the current orientation.
|
|
1796
|
+
float x = 1; // Angle of rotation around the x axis in right-handed direction.
|
|
1797
|
+
float y = 2; // Angle of rotation around the y axis in right-handed direction.
|
|
1798
|
+
float z = 3; // Angle of rotation around the z axis in right-handed direction.
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
message Translation {
|
|
1802
|
+
// Components of the translation vector in meters.
|
|
1803
|
+
float delta_x = 1;
|
|
1804
|
+
float delta_y = 2;
|
|
1805
|
+
float delta_z = 3;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
message AngularVelocity {
|
|
1809
|
+
// Components of the target angular velocity vector in radians per second.
|
|
1810
|
+
// Transition to these values is implementation dependent, and may be
|
|
1811
|
+
// smoothed over time.
|
|
1812
|
+
float omega_x = 1;
|
|
1813
|
+
float omega_y = 2;
|
|
1814
|
+
float omega_z = 3;
|
|
1271
1815
|
}
|
|
1272
1816
|
|
|
1273
1817
|
message Velocity {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1818
|
+
// Components of the target velocity vector in meters per second.
|
|
1819
|
+
// Transition to these values is implementation dependent, and may be
|
|
1820
|
+
// smoothed over time.
|
|
1821
|
+
float x = 1;
|
|
1822
|
+
float y = 2;
|
|
1823
|
+
float z = 3;
|
|
1277
1824
|
}
|
|
1278
1825
|
|
|
1279
|
-
//
|
|
1826
|
+
// Must follow the definition in "external/qemu/android/hw-sensors.h"
|
|
1280
1827
|
message Posture {
|
|
1281
1828
|
enum PostureValue {
|
|
1282
1829
|
POSTURE_UNKNOWN = 0;
|
|
@@ -1298,3 +1845,21 @@ message PhoneNumber {
|
|
|
1298
1845
|
// For example: +3106225412 or (650) 555-1221
|
|
1299
1846
|
string number = 1;
|
|
1300
1847
|
}
|
|
1848
|
+
|
|
1849
|
+
// Specifies environment background for AI glasses.
|
|
1850
|
+
message Environment {
|
|
1851
|
+
// Key/value pairs corresponing to the contents of the environment.ini file.
|
|
1852
|
+
// An empty map means no environment.
|
|
1853
|
+
map<string, string> environment = 1;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
message Camera {
|
|
1857
|
+
// Human-readable name for use with UI
|
|
1858
|
+
string display_name = 1;
|
|
1859
|
+
// Os Specific identifier
|
|
1860
|
+
string id = 2;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
message CameraList {
|
|
1864
|
+
repeated Camera cameras = 1;
|
|
1865
|
+
}
|