android_emulator/generated/android.emulation.control.rs
1// This file is @generated by prost-build.
2/// A Run State that describes the state of the Virtual Machine.
3#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct VmRunState {
5 #[prost(enumeration = "vm_run_state::RunState", tag = "1")]
6 pub state: i32,
7}
8/// Nested message and enum types in `VmRunState`.
9pub mod vm_run_state {
10 #[derive(
11 Clone,
12 Copy,
13 Debug,
14 PartialEq,
15 Eq,
16 Hash,
17 PartialOrd,
18 Ord,
19 ::prost::Enumeration
20 )]
21 #[repr(i32)]
22 pub enum RunState {
23 /// The emulator is in an unknown state. You cannot transition to this
24 /// state.
25 Unknown = 0,
26 /// Guest is actively running. You can transition to this state from the
27 /// paused state.
28 Running = 1,
29 /// Guest is paused to load a snapshot. You cannot transition to this
30 /// state.
31 RestoreVm = 2,
32 /// Guest has been paused. Transitioning to this state will pause the
33 /// emulator the guest will not be consuming any cpu cycles.
34 Paused = 3,
35 /// Guest is paused to take or export a snapshot. You cannot
36 /// transition to this state.
37 SaveVm = 4,
38 /// System shutdown, note that it is similar to power off. It tries to
39 /// set the system status and notify guest. The system is likely going to
40 /// disappear soon and do proper cleanup of resources, possibly taking
41 /// a snapshot. This is the same behavior as closing the emulator by
42 /// clicking the X (close) in the user interface.
43 Shutdown = 5,
44 /// Immediately terminate the emulator. No resource cleanup will take
45 /// place. There is a good change to corrupt the system.
46 Terminate = 7,
47 /// Will cause the emulator to reset. This is not a state you can
48 /// observe.
49 Reset = 9,
50 /// Guest experienced some error state, you cannot transition to this
51 /// state.
52 InternalError = 10,
53 /// Completely restart the emulator.
54 Restart = 11,
55 /// Resume a stopped emulator
56 Start = 12,
57 /// Stop (pause) a running emulator
58 Stop = 13,
59 }
60 impl RunState {
61 /// String value of the enum field names used in the ProtoBuf definition.
62 ///
63 /// The values are not transformed in any way and thus are considered stable
64 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
65 pub fn as_str_name(&self) -> &'static str {
66 match self {
67 Self::Unknown => "UNKNOWN",
68 Self::Running => "RUNNING",
69 Self::RestoreVm => "RESTORE_VM",
70 Self::Paused => "PAUSED",
71 Self::SaveVm => "SAVE_VM",
72 Self::Shutdown => "SHUTDOWN",
73 Self::Terminate => "TERMINATE",
74 Self::Reset => "RESET",
75 Self::InternalError => "INTERNAL_ERROR",
76 Self::Restart => "RESTART",
77 Self::Start => "START",
78 Self::Stop => "STOP",
79 }
80 }
81 /// Creates an enum from field names used in the ProtoBuf definition.
82 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
83 match value {
84 "UNKNOWN" => Some(Self::Unknown),
85 "RUNNING" => Some(Self::Running),
86 "RESTORE_VM" => Some(Self::RestoreVm),
87 "PAUSED" => Some(Self::Paused),
88 "SAVE_VM" => Some(Self::SaveVm),
89 "SHUTDOWN" => Some(Self::Shutdown),
90 "TERMINATE" => Some(Self::Terminate),
91 "RESET" => Some(Self::Reset),
92 "INTERNAL_ERROR" => Some(Self::InternalError),
93 "RESTART" => Some(Self::Restart),
94 "START" => Some(Self::Start),
95 "STOP" => Some(Self::Stop),
96 _ => None,
97 }
98 }
99 }
100}
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct ParameterValue {
103 #[prost(float, repeated, tag = "1")]
104 pub data: ::prost::alloc::vec::Vec<f32>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct PhysicalModelValue {
108 #[prost(enumeration = "physical_model_value::PhysicalType", tag = "1")]
109 pub target: i32,
110 /// \[Output Only\]
111 #[prost(enumeration = "physical_model_value::State", tag = "2")]
112 pub status: i32,
113 /// Value interpretation depends on sensor.
114 #[prost(message, optional, tag = "3")]
115 pub value: ::core::option::Option<ParameterValue>,
116}
117/// Nested message and enum types in `PhysicalModelValue`.
118pub mod physical_model_value {
119 #[derive(
120 Clone,
121 Copy,
122 Debug,
123 PartialEq,
124 Eq,
125 Hash,
126 PartialOrd,
127 Ord,
128 ::prost::Enumeration
129 )]
130 #[repr(i32)]
131 pub enum State {
132 Ok = 0,
133 /// qemud service is not available/initiated.
134 NoService = -3,
135 /// Sensor is disabled.
136 Disabled = -2,
137 /// Unknown sensor (should not happen)
138 Unknown = -1,
139 }
140 impl State {
141 /// String value of the enum field names used in the ProtoBuf definition.
142 ///
143 /// The values are not transformed in any way and thus are considered stable
144 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
145 pub fn as_str_name(&self) -> &'static str {
146 match self {
147 Self::Ok => "OK",
148 Self::NoService => "NO_SERVICE",
149 Self::Disabled => "DISABLED",
150 Self::Unknown => "UNKNOWN",
151 }
152 }
153 /// Creates an enum from field names used in the ProtoBuf definition.
154 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
155 match value {
156 "OK" => Some(Self::Ok),
157 "NO_SERVICE" => Some(Self::NoService),
158 "DISABLED" => Some(Self::Disabled),
159 "UNKNOWN" => Some(Self::Unknown),
160 _ => None,
161 }
162 }
163 }
164 /// Details on the sensors documentation can be found here:
165 /// <https://developer.android.com/reference/android/hardware/Sensor.html#TYPE\_>
166 /// The types must follow the order defined in
167 /// "external/qemu/android/hw-sensors.h"
168 #[derive(
169 Clone,
170 Copy,
171 Debug,
172 PartialEq,
173 Eq,
174 Hash,
175 PartialOrd,
176 Ord,
177 ::prost::Enumeration
178 )]
179 #[repr(i32)]
180 pub enum PhysicalType {
181 Position = 0,
182 /// All values are angles in degrees.
183 /// values = \[x,y,z\]
184 Rotation = 1,
185 MagneticField = 2,
186 /// Temperature in °C
187 Temperature = 3,
188 /// Proximity sensor distance measured in centimeters
189 Proximity = 4,
190 /// Ambient light level in SI lux units
191 Light = 5,
192 /// Atmospheric pressure in hPa (millibar)
193 Pressure = 6,
194 /// Relative ambient air humidity in percent
195 Humidity = 7,
196 Velocity = 8,
197 AmbientMotion = 9,
198 /// Describing a hinge angle sensor in degrees.
199 HingeAngle0 = 10,
200 HingeAngle1 = 11,
201 HingeAngle2 = 12,
202 Rollable0 = 13,
203 Rollable1 = 14,
204 Rollable2 = 15,
205 /// Describing the device posture; the value should be an enum defined
206 /// in Posture::PostureValue.
207 Posture = 16,
208 /// Heart rate in bpm
209 HeartRate = 17,
210 /// Ambient RGBC light intensity. Values are in order (Red, Green, Blue,
211 /// Clear).
212 RgbcLight = 18,
213 /// Wrist tilt gesture (1 = gaze, 0 = ungaze)
214 WristTilt = 19,
215 }
216 impl PhysicalType {
217 /// String value of the enum field names used in the ProtoBuf definition.
218 ///
219 /// The values are not transformed in any way and thus are considered stable
220 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
221 pub fn as_str_name(&self) -> &'static str {
222 match self {
223 Self::Position => "POSITION",
224 Self::Rotation => "ROTATION",
225 Self::MagneticField => "MAGNETIC_FIELD",
226 Self::Temperature => "TEMPERATURE",
227 Self::Proximity => "PROXIMITY",
228 Self::Light => "LIGHT",
229 Self::Pressure => "PRESSURE",
230 Self::Humidity => "HUMIDITY",
231 Self::Velocity => "VELOCITY",
232 Self::AmbientMotion => "AMBIENT_MOTION",
233 Self::HingeAngle0 => "HINGE_ANGLE0",
234 Self::HingeAngle1 => "HINGE_ANGLE1",
235 Self::HingeAngle2 => "HINGE_ANGLE2",
236 Self::Rollable0 => "ROLLABLE0",
237 Self::Rollable1 => "ROLLABLE1",
238 Self::Rollable2 => "ROLLABLE2",
239 Self::Posture => "POSTURE",
240 Self::HeartRate => "HEART_RATE",
241 Self::RgbcLight => "RGBC_LIGHT",
242 Self::WristTilt => "WRIST_TILT",
243 }
244 }
245 /// Creates an enum from field names used in the ProtoBuf definition.
246 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
247 match value {
248 "POSITION" => Some(Self::Position),
249 "ROTATION" => Some(Self::Rotation),
250 "MAGNETIC_FIELD" => Some(Self::MagneticField),
251 "TEMPERATURE" => Some(Self::Temperature),
252 "PROXIMITY" => Some(Self::Proximity),
253 "LIGHT" => Some(Self::Light),
254 "PRESSURE" => Some(Self::Pressure),
255 "HUMIDITY" => Some(Self::Humidity),
256 "VELOCITY" => Some(Self::Velocity),
257 "AMBIENT_MOTION" => Some(Self::AmbientMotion),
258 "HINGE_ANGLE0" => Some(Self::HingeAngle0),
259 "HINGE_ANGLE1" => Some(Self::HingeAngle1),
260 "HINGE_ANGLE2" => Some(Self::HingeAngle2),
261 "ROLLABLE0" => Some(Self::Rollable0),
262 "ROLLABLE1" => Some(Self::Rollable1),
263 "ROLLABLE2" => Some(Self::Rollable2),
264 "POSTURE" => Some(Self::Posture),
265 "HEART_RATE" => Some(Self::HeartRate),
266 "RGBC_LIGHT" => Some(Self::RgbcLight),
267 "WRIST_TILT" => Some(Self::WristTilt),
268 _ => None,
269 }
270 }
271 }
272}
273/// A single sensor value.
274#[derive(Clone, PartialEq, ::prost::Message)]
275pub struct SensorValue {
276 /// Type of sensor
277 #[prost(enumeration = "sensor_value::SensorType", tag = "1")]
278 pub target: i32,
279 /// \[Output Only\]
280 #[prost(enumeration = "sensor_value::State", tag = "2")]
281 pub status: i32,
282 /// Value interpretation depends on sensor enum.
283 #[prost(message, optional, tag = "3")]
284 pub value: ::core::option::Option<ParameterValue>,
285}
286/// Nested message and enum types in `SensorValue`.
287pub mod sensor_value {
288 #[derive(
289 Clone,
290 Copy,
291 Debug,
292 PartialEq,
293 Eq,
294 Hash,
295 PartialOrd,
296 Ord,
297 ::prost::Enumeration
298 )]
299 #[repr(i32)]
300 pub enum State {
301 Ok = 0,
302 /// qemud service is not available/initiated.
303 NoService = -3,
304 /// Sensor is disabled.
305 Disabled = -2,
306 /// Unknown sensor (should not happen)
307 Unknown = -1,
308 }
309 impl State {
310 /// String value of the enum field names used in the ProtoBuf definition.
311 ///
312 /// The values are not transformed in any way and thus are considered stable
313 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
314 pub fn as_str_name(&self) -> &'static str {
315 match self {
316 Self::Ok => "OK",
317 Self::NoService => "NO_SERVICE",
318 Self::Disabled => "DISABLED",
319 Self::Unknown => "UNKNOWN",
320 }
321 }
322 /// Creates an enum from field names used in the ProtoBuf definition.
323 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
324 match value {
325 "OK" => Some(Self::Ok),
326 "NO_SERVICE" => Some(Self::NoService),
327 "DISABLED" => Some(Self::Disabled),
328 "UNKNOWN" => Some(Self::Unknown),
329 _ => None,
330 }
331 }
332 }
333 /// These are the various sensors that can be available in an emulated
334 /// devices.
335 #[derive(
336 Clone,
337 Copy,
338 Debug,
339 PartialEq,
340 Eq,
341 Hash,
342 PartialOrd,
343 Ord,
344 ::prost::Enumeration
345 )]
346 #[repr(i32)]
347 pub enum SensorType {
348 /// Measures the acceleration force in m/s2 that is applied to a device
349 /// on all three physical axes (x, y, and z), including the force of
350 /// gravity.
351 Acceleration = 0,
352 /// Measures a device's rate of rotation in rad/s around each of the
353 /// three physical axes (x, y, and z).
354 Gyroscope = 1,
355 /// Measures the ambient geomagnetic field for all three physical axes
356 /// (x, y, z) in μT.
357 MagneticField = 2,
358 /// Measures degrees of rotation that a device makes around all three
359 /// physical axes (x, y, z)
360 Orientation = 3,
361 /// Measures the temperature of the device in degrees Celsius (°C).
362 Temperature = 4,
363 /// Measures the proximity of an object in cm relative to the view screen
364 /// of a device. This sensor is typically used to determine whether a
365 /// handset is being held up to a person's ear.
366 Proximity = 5,
367 /// Measures the ambient light level (illumination) in lx.
368 Light = 6,
369 /// Measures the ambient air pressure in hPa or mbar.
370 Pressure = 7,
371 /// Measures the relative ambient humidity in percent (%).
372 Humidity = 8,
373 MagneticFieldUncalibrated = 9,
374 GyroscopeUncalibrated = 10,
375 /// Measures the heart rate in bpm.
376 HeartRate = 14,
377 /// Measures the ambient RGBC light intensity.
378 /// Values are in order (Red, Green, Blue, Clear).
379 RgbcLight = 15,
380 /// WIRST_TILT (16) is skipped; clients should use get/setPhysicalModel()
381 /// instead.
382 /// Measures acceleration force and provides bias data.
383 AccelerationUncalibrated = 17,
384 }
385 impl SensorType {
386 /// String value of the enum field names used in the ProtoBuf definition.
387 ///
388 /// The values are not transformed in any way and thus are considered stable
389 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
390 pub fn as_str_name(&self) -> &'static str {
391 match self {
392 Self::Acceleration => "ACCELERATION",
393 Self::Gyroscope => "GYROSCOPE",
394 Self::MagneticField => "MAGNETIC_FIELD",
395 Self::Orientation => "ORIENTATION",
396 Self::Temperature => "TEMPERATURE",
397 Self::Proximity => "PROXIMITY",
398 Self::Light => "LIGHT",
399 Self::Pressure => "PRESSURE",
400 Self::Humidity => "HUMIDITY",
401 Self::MagneticFieldUncalibrated => "MAGNETIC_FIELD_UNCALIBRATED",
402 Self::GyroscopeUncalibrated => "GYROSCOPE_UNCALIBRATED",
403 Self::HeartRate => "HEART_RATE",
404 Self::RgbcLight => "RGBC_LIGHT",
405 Self::AccelerationUncalibrated => "ACCELERATION_UNCALIBRATED",
406 }
407 }
408 /// Creates an enum from field names used in the ProtoBuf definition.
409 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
410 match value {
411 "ACCELERATION" => Some(Self::Acceleration),
412 "GYROSCOPE" => Some(Self::Gyroscope),
413 "MAGNETIC_FIELD" => Some(Self::MagneticField),
414 "ORIENTATION" => Some(Self::Orientation),
415 "TEMPERATURE" => Some(Self::Temperature),
416 "PROXIMITY" => Some(Self::Proximity),
417 "LIGHT" => Some(Self::Light),
418 "PRESSURE" => Some(Self::Pressure),
419 "HUMIDITY" => Some(Self::Humidity),
420 "MAGNETIC_FIELD_UNCALIBRATED" => Some(Self::MagneticFieldUncalibrated),
421 "GYROSCOPE_UNCALIBRATED" => Some(Self::GyroscopeUncalibrated),
422 "HEART_RATE" => Some(Self::HeartRate),
423 "RGBC_LIGHT" => Some(Self::RgbcLight),
424 "ACCELERATION_UNCALIBRATED" => Some(Self::AccelerationUncalibrated),
425 _ => None,
426 }
427 }
428 }
429}
430/// A single backlight brightness value.
431#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
432pub struct BrightnessValue {
433 /// Type of light
434 #[prost(enumeration = "brightness_value::LightType", tag = "1")]
435 pub target: i32,
436 /// Light intensity, ranges from 0-255.
437 #[prost(uint32, tag = "2")]
438 pub value: u32,
439}
440/// Nested message and enum types in `BrightnessValue`.
441pub mod brightness_value {
442 #[derive(
443 Clone,
444 Copy,
445 Debug,
446 PartialEq,
447 Eq,
448 Hash,
449 PartialOrd,
450 Ord,
451 ::prost::Enumeration
452 )]
453 #[repr(i32)]
454 pub enum LightType {
455 /// Display backlight. This will affect all displays.
456 Lcd = 0,
457 Keyboard = 1,
458 Button = 2,
459 }
460 impl LightType {
461 /// String value of the enum field names used in the ProtoBuf definition.
462 ///
463 /// The values are not transformed in any way and thus are considered stable
464 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
465 pub fn as_str_name(&self) -> &'static str {
466 match self {
467 Self::Lcd => "LCD",
468 Self::Keyboard => "KEYBOARD",
469 Self::Button => "BUTTON",
470 }
471 }
472 /// Creates an enum from field names used in the ProtoBuf definition.
473 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
474 match value {
475 "LCD" => Some(Self::Lcd),
476 "KEYBOARD" => Some(Self::Keyboard),
477 "BUTTON" => Some(Self::Button),
478 _ => None,
479 }
480 }
481 }
482}
483#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
484pub struct DisplayMode {
485 #[prost(enumeration = "DisplayModeValue", tag = "1")]
486 pub value: i32,
487}
488#[derive(Clone, PartialEq, ::prost::Message)]
489pub struct LogMessage {
490 /// \[Output Only\] The contents of the log output.
491 #[prost(string, tag = "1")]
492 pub contents: ::prost::alloc::string::String,
493 /// The starting byte position of the output that was returned. This
494 /// should match the start parameter sent with the request. If the serial
495 /// console output exceeds the size of the buffer, older output will be
496 /// overwritten by newer content and the start values will be mismatched.
497 #[deprecated]
498 #[prost(int64, tag = "2")]
499 pub start: i64,
500 /// \[Output Only\] The position of the next byte of content from the serial
501 /// console output. Use this value in the next request as the start
502 /// parameter.
503 #[deprecated]
504 #[prost(int64, tag = "3")]
505 pub next: i64,
506 /// Set the sort of response you are interested it in.
507 /// It the type is "Parsed" the entries field will contain the parsed
508 /// results. otherwise the contents field will be set.
509 #[prost(enumeration = "log_message::LogType", tag = "4")]
510 pub sort: i32,
511 /// \[Output Only\] The parsed logcat entries so far. Only set if sort is
512 /// set to Parsed
513 #[prost(message, repeated, tag = "5")]
514 pub entries: ::prost::alloc::vec::Vec<LogcatEntry>,
515}
516/// Nested message and enum types in `LogMessage`.
517pub mod log_message {
518 #[derive(
519 Clone,
520 Copy,
521 Debug,
522 PartialEq,
523 Eq,
524 Hash,
525 PartialOrd,
526 Ord,
527 ::prost::Enumeration
528 )]
529 #[repr(i32)]
530 pub enum LogType {
531 Text = 0,
532 Parsed = 1,
533 }
534 impl LogType {
535 /// String value of the enum field names used in the ProtoBuf definition.
536 ///
537 /// The values are not transformed in any way and thus are considered stable
538 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
539 pub fn as_str_name(&self) -> &'static str {
540 match self {
541 Self::Text => "Text",
542 Self::Parsed => "Parsed",
543 }
544 }
545 /// Creates an enum from field names used in the ProtoBuf definition.
546 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
547 match value {
548 "Text" => Some(Self::Text),
549 "Parsed" => Some(Self::Parsed),
550 _ => None,
551 }
552 }
553 }
554}
555/// A parsed logcat entry.
556#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
557pub struct LogcatEntry {
558 /// A Unix timestamps in milliseconds (The number of milliseconds that
559 /// have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
560 /// leap seconds)
561 #[prost(uint64, tag = "1")]
562 pub timestamp: u64,
563 /// Process id.
564 #[prost(uint32, tag = "2")]
565 pub pid: u32,
566 /// Thread id.
567 #[prost(uint32, tag = "3")]
568 pub tid: u32,
569 #[prost(enumeration = "logcat_entry::LogLevel", tag = "4")]
570 pub level: i32,
571 #[prost(string, tag = "5")]
572 pub tag: ::prost::alloc::string::String,
573 #[prost(string, tag = "6")]
574 pub msg: ::prost::alloc::string::String,
575}
576/// Nested message and enum types in `LogcatEntry`.
577pub mod logcat_entry {
578 /// The possible log levels.
579 #[derive(
580 Clone,
581 Copy,
582 Debug,
583 PartialEq,
584 Eq,
585 Hash,
586 PartialOrd,
587 Ord,
588 ::prost::Enumeration
589 )]
590 #[repr(i32)]
591 pub enum LogLevel {
592 Unknown = 0,
593 Default = 1,
594 Verbose = 2,
595 Debug = 3,
596 Info = 4,
597 Warn = 5,
598 Err = 6,
599 Fatal = 7,
600 Silent = 8,
601 }
602 impl LogLevel {
603 /// String value of the enum field names used in the ProtoBuf definition.
604 ///
605 /// The values are not transformed in any way and thus are considered stable
606 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
607 pub fn as_str_name(&self) -> &'static str {
608 match self {
609 Self::Unknown => "UNKNOWN",
610 Self::Default => "DEFAULT",
611 Self::Verbose => "VERBOSE",
612 Self::Debug => "DEBUG",
613 Self::Info => "INFO",
614 Self::Warn => "WARN",
615 Self::Err => "ERR",
616 Self::Fatal => "FATAL",
617 Self::Silent => "SILENT",
618 }
619 }
620 /// Creates an enum from field names used in the ProtoBuf definition.
621 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
622 match value {
623 "UNKNOWN" => Some(Self::Unknown),
624 "DEFAULT" => Some(Self::Default),
625 "VERBOSE" => Some(Self::Verbose),
626 "DEBUG" => Some(Self::Debug),
627 "INFO" => Some(Self::Info),
628 "WARN" => Some(Self::Warn),
629 "ERR" => Some(Self::Err),
630 "FATAL" => Some(Self::Fatal),
631 "SILENT" => Some(Self::Silent),
632 _ => None,
633 }
634 }
635 }
636}
637/// Information about the hypervisor that is currently in use.
638#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
639pub struct VmConfiguration {
640 #[prost(enumeration = "vm_configuration::VmHypervisorType", tag = "1")]
641 pub hypervisor_type: i32,
642 #[prost(int32, tag = "2")]
643 pub number_of_cpu_cores: i32,
644 #[prost(int64, tag = "3")]
645 pub ram_size_bytes: i64,
646}
647/// Nested message and enum types in `VmConfiguration`.
648pub mod vm_configuration {
649 #[derive(
650 Clone,
651 Copy,
652 Debug,
653 PartialEq,
654 Eq,
655 Hash,
656 PartialOrd,
657 Ord,
658 ::prost::Enumeration
659 )]
660 #[repr(i32)]
661 pub enum VmHypervisorType {
662 /// An unknown hypervisor
663 Unknown = 0,
664 /// No hypervisor is in use. This usually means that the guest is
665 /// running on a different CPU than the host, or you are using a
666 /// platform where no hypervisor is available.
667 None = 1,
668 /// The Kernel based Virtual Machine
669 /// (<https://www.linux-kvm.org/page/Main_Page>)
670 Kvm = 2,
671 /// Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
672 /// <https://github.com/intel/haxm>
673 Haxm = 3,
674 /// Hypervisor Framework.
675 /// <https://developer.apple.com/documentation/hypervisor>
676 Hvf = 4,
677 /// Window Hypervisor Platform
678 /// <https://docs.microsoft.com/en-us/virtualization/api/>
679 Whpx = 5,
680 Aehd = 6,
681 }
682 impl VmHypervisorType {
683 /// String value of the enum field names used in the ProtoBuf definition.
684 ///
685 /// The values are not transformed in any way and thus are considered stable
686 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
687 pub fn as_str_name(&self) -> &'static str {
688 match self {
689 Self::Unknown => "UNKNOWN",
690 Self::None => "NONE",
691 Self::Kvm => "KVM",
692 Self::Haxm => "HAXM",
693 Self::Hvf => "HVF",
694 Self::Whpx => "WHPX",
695 Self::Aehd => "AEHD",
696 }
697 }
698 /// Creates an enum from field names used in the ProtoBuf definition.
699 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
700 match value {
701 "UNKNOWN" => Some(Self::Unknown),
702 "NONE" => Some(Self::None),
703 "KVM" => Some(Self::Kvm),
704 "HAXM" => Some(Self::Haxm),
705 "HVF" => Some(Self::Hvf),
706 "WHPX" => Some(Self::Whpx),
707 "AEHD" => Some(Self::Aehd),
708 _ => None,
709 }
710 }
711 }
712}
713/// Representation of a clipped data object on the clipboard.
714#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
715pub struct ClipData {
716 /// UTF-8 Encoded text.
717 #[prost(string, tag = "1")]
718 pub text: ::prost::alloc::string::String,
719}
720/// The Touch interface represents a single contact point on a
721/// touch-sensitive device. The contact point is commonly a finger or stylus
722/// and the device may be a touchscreen or trackpad.
723#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
724pub struct Touch {
725 /// The horizontal coordinate. This is the physical location on the
726 /// screen For example 0 indicates the leftmost coordinate.
727 #[prost(int32, tag = "1")]
728 pub x: i32,
729 /// The vertical coordinate. This is the physical location on the screen
730 /// For example 0 indicates the top left coordinate.
731 #[prost(int32, tag = "2")]
732 pub y: i32,
733 /// The identifier is an arbitrary non-negative integer that is used to
734 /// identify and track each tool independently when multiple tools are
735 /// active. For example, when multiple fingers are touching the device,
736 /// each finger should be assigned a distinct tracking id that is used as
737 /// long as the finger remains in contact. Tracking ids may be reused
738 /// when their associated tools move out of range.
739 ///
740 /// The emulator currently supports up to 10 concurrent touch events. The
741 /// identifier can be any uninque value and will be mapped to the next
742 /// available internal identifier.
743 #[prost(int32, tag = "3")]
744 pub identifier: i32,
745 /// Reports the physical pressure applied to the tip of the tool or the
746 /// signal strength of the touch contact.
747 ///
748 /// The values reported must be non-zero when the tool is touching the
749 /// device and zero otherwise to indicate that the touch event is
750 /// completed.
751 ///
752 /// Make sure to deliver a pressure of 0 for the given identifier when
753 /// the touch event is completed, otherwise the touch identifier will not
754 /// be unregistered!
755 #[prost(int32, tag = "4")]
756 pub pressure: i32,
757 /// Optionally reports the cross-sectional area of the touch contact, or
758 /// the length of the longer dimension of the touch contact.
759 #[prost(int32, tag = "5")]
760 pub touch_major: i32,
761 /// Optionally reports the length of the shorter dimension of the touch
762 /// contact. This axis will be ignored if touch_major is reporting an
763 /// area measurement greater than 0.
764 #[prost(int32, tag = "6")]
765 pub touch_minor: i32,
766 #[prost(enumeration = "touch::EventExpiration", tag = "7")]
767 pub expiration: i32,
768 /// The orientation of the contact, if any.
769 #[prost(int32, tag = "8")]
770 pub orientation: i32,
771}
772/// Nested message and enum types in `Touch`.
773pub mod touch {
774 #[derive(
775 Clone,
776 Copy,
777 Debug,
778 PartialEq,
779 Eq,
780 Hash,
781 PartialOrd,
782 Ord,
783 ::prost::Enumeration
784 )]
785 #[repr(i32)]
786 pub enum EventExpiration {
787 /// The system will use the default time of 120s to track
788 /// the touch event with the given identifier. If no update happens
789 /// within this timeframe the identifier is considered expired
790 /// and can be made available for re-use. This means that a touch event
791 /// with pressure 0 for this identifier will be send to the emulator.
792 Unspecified = 0,
793 /// Never expire the given slot. You must *ALWAYS* close the identifier
794 /// by sending a touch event with 0 pressure.
795 NeverExpire = 1,
796 }
797 impl EventExpiration {
798 /// String value of the enum field names used in the ProtoBuf definition.
799 ///
800 /// The values are not transformed in any way and thus are considered stable
801 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
802 pub fn as_str_name(&self) -> &'static str {
803 match self {
804 Self::Unspecified => "EVENT_EXPIRATION_UNSPECIFIED",
805 Self::NeverExpire => "NEVER_EXPIRE",
806 }
807 }
808 /// Creates an enum from field names used in the ProtoBuf definition.
809 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
810 match value {
811 "EVENT_EXPIRATION_UNSPECIFIED" => Some(Self::Unspecified),
812 "NEVER_EXPIRE" => Some(Self::NeverExpire),
813 _ => None,
814 }
815 }
816 }
817}
818/// A Pen is similar to a touch, with the addition
819/// of button and rubber information.
820#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
821pub struct Pen {
822 #[prost(message, optional, tag = "1")]
823 pub location: ::core::option::Option<Touch>,
824 /// True if the button is pressed or not
825 #[prost(bool, tag = "2")]
826 pub button_pressed: bool,
827 /// True if it is a rubber pointer.
828 #[prost(bool, tag = "3")]
829 pub rubber_pointer: bool,
830}
831/// A TouchEvent contains a list of Touch objects that are in contact with
832/// the touch surface.
833///
834/// Touch events are delivered in sequence as specified in the touchList.
835///
836/// TouchEvents are delivered to the emulated devices using ["Protocol
837/// B"](<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt>)
838#[derive(Clone, PartialEq, ::prost::Message)]
839pub struct TouchEvent {
840 /// The list of Touch objects, note that these do not need to be unique
841 #[prost(message, repeated, tag = "1")]
842 pub touches: ::prost::alloc::vec::Vec<Touch>,
843 /// The display device where the touch event occurred.
844 /// Omitting or using the value 0 indicates the main display.
845 #[prost(int32, tag = "2")]
846 pub display: i32,
847}
848#[derive(Clone, PartialEq, ::prost::Message)]
849pub struct PenEvent {
850 /// The list of Pen objects, note that these do not need to be unique
851 #[prost(message, repeated, tag = "1")]
852 pub events: ::prost::alloc::vec::Vec<Pen>,
853 /// The display device where the pen event occurred.
854 /// Omitting or using the value 0 indicates the main display.
855 #[prost(int32, tag = "2")]
856 pub display: i32,
857}
858/// The MouseEvent interface represents events that occur due to the user
859/// interacting with a pointing device (such as a mouse).
860#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
861pub struct MouseEvent {
862 /// The horizontal coordinate. This is the physical location on the
863 /// screen For example 0 indicates the leftmost coordinate.
864 #[prost(int32, tag = "1")]
865 pub x: i32,
866 /// The vertical coordinate. This is the physical location on the screen
867 /// For example 0 indicates the top left coordinate.
868 #[prost(int32, tag = "2")]
869 pub y: i32,
870 /// Indicates which buttons are pressed.
871 /// 0: No button was pressed
872 /// 1: Primary button (left)
873 /// 2: Secondary button (right)
874 #[prost(int32, tag = "3")]
875 pub buttons: i32,
876 /// The display device where the mouse event occurred.
877 /// Omitting or using the value 0 indicates the main display.
878 #[prost(int32, tag = "4")]
879 pub display: i32,
880}
881#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
882pub struct WheelEvent {
883 /// The value indicating how much the mouse wheel is rotated. Scaled so that
884 /// 120 equals to 1 wheel click. (120 is chosen as a multiplier often used to
885 /// represent wheel movements less than 1 wheel click. e.g.
886 /// <https://doc.qt.io/qt-5/qwheelevent.html#angleDelta>) Positive delta value
887 /// is assigned to dx when the top of wheel is moved to left. Similarly
888 /// positive delta value is assigned to dy when the top of wheel is moved
889 /// away from the user.
890 #[prost(int32, tag = "1")]
891 pub dx: i32,
892 #[prost(int32, tag = "2")]
893 pub dy: i32,
894 /// The display device where the mouse event occurred.
895 /// Omitting or using the value 0 indicates the main display.
896 #[prost(int32, tag = "3")]
897 pub display: i32,
898}
899/// KeyboardEvent objects describe a user interaction with the keyboard; each
900/// event describes a single interaction between the user and a key (or
901/// combination of a key with modifier keys) on the keyboard.
902/// This follows the pattern as set by
903/// (javascript)\[<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent\]>
904///
905/// Note: that only keyCode, key, or text can be set and that the semantics
906/// will slightly vary.
907#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
908pub struct KeyboardEvent {
909 /// Type of keycode contained in the keyCode field.
910 #[prost(enumeration = "keyboard_event::KeyCodeType", tag = "1")]
911 pub code_type: i32,
912 /// The type of keyboard event that should be sent to the emulator
913 #[prost(enumeration = "keyboard_event::KeyEventType", tag = "2")]
914 pub event_type: i32,
915 /// This property represents a physical key on the keyboard (as opposed
916 /// to the character generated by pressing the key). In other words, this
917 /// property is a value which isn't altered by keyboard layout or the
918 /// state of the modifier keys. This value will be interpreted by the
919 /// emulator depending on the KeyCodeType. The incoming key code will be
920 /// translated to an evdev code type and send to the emulator.
921 /// The values in key and text will be ignored.
922 #[prost(int32, tag = "3")]
923 pub key_code: i32,
924 /// The value of the key pressed by the user, taking into consideration
925 /// the state of modifier keys such as Shift as well as the keyboard
926 /// locale and layout. This follows the w3c standard used in browsers.
927 /// You can find an accurate description of valid values
928 /// [here](<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values>)
929 ///
930 /// Note that some keys can result in multiple evdev events that are
931 /// delivered to the emulator. for example the Key "A" will result in a
932 /// sequence:
933 /// \["Shift", "a"\] -> \[0x2a, 0x1e\] whereas "a" results in \["a"\] -> \[0x1e\].
934 ///
935 /// Not all documented keys are understood by android, and only printable
936 /// ASCII \[32-127) characters are properly translated.
937 ///
938 /// Keep in mind that there are a set of key values that result in android
939 /// specific behavior
940 /// [see](<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#Phone_keys>):
941 ///
942 /// * "AppSwitch": Behaves as the "Overview" button in android.
943 /// * "GoBack": The Back button.
944 /// * "GoHome": The Home button, which takes the user to the phone's main
945 /// screen (usually an application launcher).
946 /// * "Power": The Power button.
947 #[prost(string, tag = "4")]
948 pub key: ::prost::alloc::string::String,
949 /// Series of utf8 encoded characters to send to the emulator. An attempt
950 /// will be made to translate every character will an EvDev event type and
951 /// send to the emulator as a keypress event. The values in keyCode,
952 /// eventType, codeType and key will be ignored.
953 ///
954 /// Note that most printable ASCII characters (range \[32-127) can be send
955 /// individually with the "key" param. Do not expect arbitrary UTF symbols to
956 /// arrive in the emulator (most will be ignored).
957 ///
958 /// Note that it is possible to overrun the keyboard buffer by slamming this
959 /// endpoint with large quantities of text (>1kb). The clipboard api is
960 /// better suited for transferring large quantities of text.
961 #[prost(string, tag = "5")]
962 pub text: ::prost::alloc::string::String,
963}
964/// Nested message and enum types in `KeyboardEvent`.
965pub mod keyboard_event {
966 /// Code types that the emulator can receive. Note that the emulator
967 /// will do its best to translate the code to an evdev value that
968 /// will be send to the emulator. This translation is based on
969 /// the chromium translation tables. See
970 /// (this)\[<https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-grpc/android/emulation/control/keyboard/keycode_converter_data.inc\]>
971 /// for details on the translation.
972 #[derive(
973 Clone,
974 Copy,
975 Debug,
976 PartialEq,
977 Eq,
978 Hash,
979 PartialOrd,
980 Ord,
981 ::prost::Enumeration
982 )]
983 #[repr(i32)]
984 pub enum KeyCodeType {
985 Usb = 0,
986 Evdev = 1,
987 Xkb = 2,
988 Win = 3,
989 Mac = 4,
990 }
991 impl KeyCodeType {
992 /// String value of the enum field names used in the ProtoBuf definition.
993 ///
994 /// The values are not transformed in any way and thus are considered stable
995 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
996 pub fn as_str_name(&self) -> &'static str {
997 match self {
998 Self::Usb => "Usb",
999 Self::Evdev => "Evdev",
1000 Self::Xkb => "XKB",
1001 Self::Win => "Win",
1002 Self::Mac => "Mac",
1003 }
1004 }
1005 /// Creates an enum from field names used in the ProtoBuf definition.
1006 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1007 match value {
1008 "Usb" => Some(Self::Usb),
1009 "Evdev" => Some(Self::Evdev),
1010 "XKB" => Some(Self::Xkb),
1011 "Win" => Some(Self::Win),
1012 "Mac" => Some(Self::Mac),
1013 _ => None,
1014 }
1015 }
1016 }
1017 #[derive(
1018 Clone,
1019 Copy,
1020 Debug,
1021 PartialEq,
1022 Eq,
1023 Hash,
1024 PartialOrd,
1025 Ord,
1026 ::prost::Enumeration
1027 )]
1028 #[repr(i32)]
1029 pub enum KeyEventType {
1030 /// Indicates that this keyevent should be send to the emulator
1031 /// as a key down event. Meaning that the key event will be
1032 /// translated to an EvDev event type and bit 11 (0x400) will be
1033 /// set before it is sent to the emulator.
1034 Keydown = 0,
1035 /// Indicates that the keyevent should be send to the emulator
1036 /// as a key up event. Meaning that the key event will be
1037 /// translated to an EvDev event type and
1038 /// sent to the emulator.
1039 Keyup = 1,
1040 /// Indicates that the keyevent will be send to the emulator
1041 /// as e key down event and immediately followed by a keyup event.
1042 Keypress = 2,
1043 }
1044 impl KeyEventType {
1045 /// String value of the enum field names used in the ProtoBuf definition.
1046 ///
1047 /// The values are not transformed in any way and thus are considered stable
1048 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1049 pub fn as_str_name(&self) -> &'static str {
1050 match self {
1051 Self::Keydown => "keydown",
1052 Self::Keyup => "keyup",
1053 Self::Keypress => "keypress",
1054 }
1055 }
1056 /// Creates an enum from field names used in the ProtoBuf definition.
1057 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1058 match value {
1059 "keydown" => Some(Self::Keydown),
1060 "keyup" => Some(Self::Keyup),
1061 "keypress" => Some(Self::Keypress),
1062 _ => None,
1063 }
1064 }
1065 }
1066}
1067/// An input event that can be delivered to the emulator.
1068#[derive(Clone, PartialEq, ::prost::Message)]
1069pub struct InputEvent {
1070 #[prost(oneof = "input_event::Type", tags = "1, 2, 3, 4, 5, 6")]
1071 pub r#type: ::core::option::Option<input_event::Type>,
1072}
1073/// Nested message and enum types in `InputEvent`.
1074pub mod input_event {
1075 #[derive(Clone, PartialEq, ::prost::Oneof)]
1076 pub enum Type {
1077 #[prost(message, tag = "1")]
1078 KeyEvent(super::KeyboardEvent),
1079 #[prost(message, tag = "2")]
1080 TouchEvent(super::TouchEvent),
1081 #[prost(message, tag = "3")]
1082 MouseEvent(super::MouseEvent),
1083 #[prost(message, tag = "4")]
1084 AndroidEvent(super::AndroidEvent),
1085 #[prost(message, tag = "5")]
1086 PenEvent(super::PenEvent),
1087 #[prost(message, tag = "6")]
1088 WheelEvent(super::WheelEvent),
1089 }
1090}
1091/// The android input event system is a framework for handling input from a
1092/// variety of devices by generating events that describe changes in the
1093/// state of the devices and forwarding them to user space applications.
1094///
1095/// An AndroidEvents will be delivered directly to the kernel as is.
1096#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1097pub struct AndroidEvent {
1098 /// The type of the event. The types of the event are specified
1099 /// by the android kernel. Some examples are:
1100 /// EV_SYN, EV_KEY, EV_SW, etc..
1101 /// The exact definitions can be found in the input.h header file.
1102 #[prost(int32, tag = "1")]
1103 pub r#type: i32,
1104 /// The actual code to be send to the kernel. The actual meaning
1105 /// of the code depends on the type definition.
1106 #[prost(int32, tag = "2")]
1107 pub code: i32,
1108 /// The actual value of the event.
1109 #[prost(int32, tag = "3")]
1110 pub value: i32,
1111 /// The display id associated with this input event.
1112 #[prost(int32, tag = "4")]
1113 pub display: i32,
1114}
1115#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1116pub struct Fingerprint {
1117 /// True when the fingprint is touched.
1118 #[prost(bool, tag = "1")]
1119 pub is_touching: bool,
1120 /// The identifier of the registered fingerprint.
1121 #[prost(int32, tag = "2")]
1122 pub touch_id: i32,
1123}
1124#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1125pub struct GpsState {
1126 /// Setting this to false will disable auto updating from the LocationUI,
1127 /// otherwise the location UI will override the location at a frequency of
1128 /// 1hz.
1129 ///
1130 /// * This is unused if the emulator is launched with -no-window, or when he
1131 /// location ui is disabled.
1132 /// * This will BREAK the location ui experience if it is set to false. For
1133 /// example routing will no longer function.
1134 #[prost(bool, tag = "1")]
1135 pub passive_update: bool,
1136 /// The latitude, in degrees.
1137 #[prost(double, tag = "2")]
1138 pub latitude: f64,
1139 /// The longitude, in degrees.
1140 #[prost(double, tag = "3")]
1141 pub longitude: f64,
1142 /// The speed if it is available, in meters/second over ground
1143 #[prost(double, tag = "4")]
1144 pub speed: f64,
1145 /// gets the horizontal direction of travel of this device, and is not
1146 /// related to the device orientation. It is guaranteed to be in the
1147 /// range \[0.0, 360.0\] if the device has a bearing. 0=North, 90=East,
1148 /// 180=South, etc..
1149 #[prost(double, tag = "5")]
1150 pub bearing: f64,
1151 /// The altitude if available, in meters above the WGS 84 reference
1152 /// ellipsoid.
1153 #[prost(double, tag = "6")]
1154 pub altitude: f64,
1155 /// The number of satellites used to derive the fix
1156 #[prost(int32, tag = "7")]
1157 pub satellites: i32,
1158}
1159#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1160pub struct BatteryState {
1161 #[prost(bool, tag = "1")]
1162 pub has_battery: bool,
1163 #[prost(bool, tag = "2")]
1164 pub is_present: bool,
1165 #[prost(enumeration = "battery_state::BatteryCharger", tag = "3")]
1166 pub charger: i32,
1167 #[prost(int32, tag = "4")]
1168 pub charge_level: i32,
1169 #[prost(enumeration = "battery_state::BatteryHealth", tag = "5")]
1170 pub health: i32,
1171 #[prost(enumeration = "battery_state::BatteryStatus", tag = "6")]
1172 pub status: i32,
1173}
1174/// Nested message and enum types in `BatteryState`.
1175pub mod battery_state {
1176 #[derive(
1177 Clone,
1178 Copy,
1179 Debug,
1180 PartialEq,
1181 Eq,
1182 Hash,
1183 PartialOrd,
1184 Ord,
1185 ::prost::Enumeration
1186 )]
1187 #[repr(i32)]
1188 pub enum BatteryStatus {
1189 Unknown = 0,
1190 Charging = 1,
1191 Discharging = 2,
1192 NotCharging = 3,
1193 Full = 4,
1194 }
1195 impl BatteryStatus {
1196 /// String value of the enum field names used in the ProtoBuf definition.
1197 ///
1198 /// The values are not transformed in any way and thus are considered stable
1199 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1200 pub fn as_str_name(&self) -> &'static str {
1201 match self {
1202 Self::Unknown => "UNKNOWN",
1203 Self::Charging => "CHARGING",
1204 Self::Discharging => "DISCHARGING",
1205 Self::NotCharging => "NOT_CHARGING",
1206 Self::Full => "FULL",
1207 }
1208 }
1209 /// Creates an enum from field names used in the ProtoBuf definition.
1210 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1211 match value {
1212 "UNKNOWN" => Some(Self::Unknown),
1213 "CHARGING" => Some(Self::Charging),
1214 "DISCHARGING" => Some(Self::Discharging),
1215 "NOT_CHARGING" => Some(Self::NotCharging),
1216 "FULL" => Some(Self::Full),
1217 _ => None,
1218 }
1219 }
1220 }
1221 #[derive(
1222 Clone,
1223 Copy,
1224 Debug,
1225 PartialEq,
1226 Eq,
1227 Hash,
1228 PartialOrd,
1229 Ord,
1230 ::prost::Enumeration
1231 )]
1232 #[repr(i32)]
1233 pub enum BatteryCharger {
1234 None = 0,
1235 Ac = 1,
1236 Usb = 2,
1237 Wireless = 3,
1238 }
1239 impl BatteryCharger {
1240 /// String value of the enum field names used in the ProtoBuf definition.
1241 ///
1242 /// The values are not transformed in any way and thus are considered stable
1243 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1244 pub fn as_str_name(&self) -> &'static str {
1245 match self {
1246 Self::None => "NONE",
1247 Self::Ac => "AC",
1248 Self::Usb => "USB",
1249 Self::Wireless => "WIRELESS",
1250 }
1251 }
1252 /// Creates an enum from field names used in the ProtoBuf definition.
1253 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1254 match value {
1255 "NONE" => Some(Self::None),
1256 "AC" => Some(Self::Ac),
1257 "USB" => Some(Self::Usb),
1258 "WIRELESS" => Some(Self::Wireless),
1259 _ => None,
1260 }
1261 }
1262 }
1263 #[derive(
1264 Clone,
1265 Copy,
1266 Debug,
1267 PartialEq,
1268 Eq,
1269 Hash,
1270 PartialOrd,
1271 Ord,
1272 ::prost::Enumeration
1273 )]
1274 #[repr(i32)]
1275 pub enum BatteryHealth {
1276 Good = 0,
1277 Failed = 1,
1278 Dead = 2,
1279 Overvoltage = 3,
1280 Overheated = 4,
1281 }
1282 impl BatteryHealth {
1283 /// String value of the enum field names used in the ProtoBuf definition.
1284 ///
1285 /// The values are not transformed in any way and thus are considered stable
1286 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1287 pub fn as_str_name(&self) -> &'static str {
1288 match self {
1289 Self::Good => "GOOD",
1290 Self::Failed => "FAILED",
1291 Self::Dead => "DEAD",
1292 Self::Overvoltage => "OVERVOLTAGE",
1293 Self::Overheated => "OVERHEATED",
1294 }
1295 }
1296 /// Creates an enum from field names used in the ProtoBuf definition.
1297 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1298 match value {
1299 "GOOD" => Some(Self::Good),
1300 "FAILED" => Some(Self::Failed),
1301 "DEAD" => Some(Self::Dead),
1302 "OVERVOLTAGE" => Some(Self::Overvoltage),
1303 "OVERHEATED" => Some(Self::Overheated),
1304 _ => None,
1305 }
1306 }
1307 }
1308}
1309/// An ImageTransport allows for specifying a side channel for
1310/// delivering image frames versus using the standard bytes array that is
1311/// returned with the gRPC request.
1312#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct ImageTransport {
1314 /// The desired transport channel used for delivering image frames. Only
1315 /// relevant when streaming screenshots.
1316 #[prost(enumeration = "image_transport::TransportChannel", tag = "1")]
1317 pub channel: i32,
1318 /// Handle used for writing image frames if transport is mmap. The client
1319 /// sets and owns this handle. It can be either a shm region, or a mmap. A
1320 /// mmap should be a url that starts with `file:///` Note: the mmap can
1321 /// result in tearing.
1322 #[prost(string, tag = "2")]
1323 pub handle: ::prost::alloc::string::String,
1324}
1325/// Nested message and enum types in `ImageTransport`.
1326pub mod image_transport {
1327 #[derive(
1328 Clone,
1329 Copy,
1330 Debug,
1331 PartialEq,
1332 Eq,
1333 Hash,
1334 PartialOrd,
1335 Ord,
1336 ::prost::Enumeration
1337 )]
1338 #[repr(i32)]
1339 pub enum TransportChannel {
1340 /// Return full frames over the gRPC transport
1341 Unspecified = 0,
1342 /// Write images to the a file/shared memory handle.
1343 Mmap = 1,
1344 }
1345 impl TransportChannel {
1346 /// String value of the enum field names used in the ProtoBuf definition.
1347 ///
1348 /// The values are not transformed in any way and thus are considered stable
1349 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1350 pub fn as_str_name(&self) -> &'static str {
1351 match self {
1352 Self::Unspecified => "TRANSPORT_CHANNEL_UNSPECIFIED",
1353 Self::Mmap => "MMAP",
1354 }
1355 }
1356 /// Creates an enum from field names used in the ProtoBuf definition.
1357 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1358 match value {
1359 "TRANSPORT_CHANNEL_UNSPECIFIED" => Some(Self::Unspecified),
1360 "MMAP" => Some(Self::Mmap),
1361 _ => None,
1362 }
1363 }
1364 }
1365}
1366/// The aspect ratio (width/height) will be different from the one
1367/// where the device is unfolded.
1368#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1369pub struct FoldedDisplay {
1370 #[prost(uint32, tag = "1")]
1371 pub width: u32,
1372 #[prost(uint32, tag = "2")]
1373 pub height: u32,
1374 /// It is possible for the screen to be folded in different ways depending
1375 /// on which surface is shown to the user. So xOffset and yOffset indicate
1376 /// the top left corner of the folded screen within the original unfolded
1377 /// screen.
1378 #[prost(uint32, tag = "3")]
1379 pub x_offset: u32,
1380 #[prost(uint32, tag = "4")]
1381 pub y_offset: u32,
1382}
1383#[derive(Clone, PartialEq, ::prost::Message)]
1384pub struct ImageFormat {
1385 /// The (desired) format of the resulting bytes.
1386 #[prost(enumeration = "image_format::ImgFormat", tag = "1")]
1387 pub format: i32,
1388 /// \[Output Only\] The rotation of the image. The image will be rotated
1389 /// based upon the coarse grained orientation of the device.
1390 #[prost(message, optional, tag = "2")]
1391 pub rotation: ::core::option::Option<Rotation>,
1392 /// The (desired) width of the image. When passed as input
1393 /// the image will be scaled to match the given
1394 /// width, while maintaining the aspect ratio of the device.
1395 /// The returned image will never exceed the given width, but can be less.
1396 /// Omitting this value (or passing in 0) will result in no scaling,
1397 /// and the width of the actual device will be used.
1398 #[prost(uint32, tag = "3")]
1399 pub width: u32,
1400 /// The (desired) height of the image. When passed as input
1401 /// the image will be scaled to match the given
1402 /// height, while maintaining the aspect ratio of the device.
1403 /// The returned image will never exceed the given height, but can be less.
1404 /// Omitting this value (or passing in 0) will result in no scaling,
1405 /// and the height of the actual device will be used.
1406 #[prost(uint32, tag = "4")]
1407 pub height: u32,
1408 /// The (desired) display id of the device. Setting this to 0 (or omitting)
1409 /// indicates the main display.
1410 #[prost(uint32, tag = "5")]
1411 pub display: u32,
1412 /// Set this if you wish to use a different transport channel to deliver
1413 /// image frames.
1414 #[prost(message, optional, tag = "6")]
1415 pub transport: ::core::option::Option<ImageTransport>,
1416 /// \[Output Only\] Display configuration when screen is folded. The value is
1417 /// the original configuration before scaling.
1418 #[prost(message, optional, tag = "7")]
1419 pub folded_display: ::core::option::Option<FoldedDisplay>,
1420 /// \[Output Only\] Display mode when AVD is resizable.
1421 #[prost(enumeration = "DisplayModeValue", tag = "8")]
1422 pub display_mode: i32,
1423}
1424/// Nested message and enum types in `ImageFormat`.
1425pub mod image_format {
1426 #[derive(
1427 Clone,
1428 Copy,
1429 Debug,
1430 PartialEq,
1431 Eq,
1432 Hash,
1433 PartialOrd,
1434 Ord,
1435 ::prost::Enumeration
1436 )]
1437 #[repr(i32)]
1438 pub enum ImgFormat {
1439 /// Portable Network Graphics format
1440 /// (<https://en.wikipedia.org/wiki/Portable_Network_Graphics>)
1441 Png = 0,
1442 /// Three-channel RGB color model supplemented with a fourth alpha
1443 /// channel. <https://en.wikipedia.org/wiki/RGBA_color_model>
1444 /// Each pixel consists of 4 bytes.
1445 Rgba8888 = 1,
1446 /// Three-channel RGB color model, each pixel consists of 3 bytes
1447 Rgb888 = 2,
1448 }
1449 impl ImgFormat {
1450 /// String value of the enum field names used in the ProtoBuf definition.
1451 ///
1452 /// The values are not transformed in any way and thus are considered stable
1453 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1454 pub fn as_str_name(&self) -> &'static str {
1455 match self {
1456 Self::Png => "PNG",
1457 Self::Rgba8888 => "RGBA8888",
1458 Self::Rgb888 => "RGB888",
1459 }
1460 }
1461 /// Creates an enum from field names used in the ProtoBuf definition.
1462 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1463 match value {
1464 "PNG" => Some(Self::Png),
1465 "RGBA8888" => Some(Self::Rgba8888),
1466 "RGB888" => Some(Self::Rgb888),
1467 _ => None,
1468 }
1469 }
1470 }
1471}
1472#[derive(Clone, PartialEq, ::prost::Message)]
1473pub struct Image {
1474 #[prost(message, optional, tag = "1")]
1475 pub format: ::core::option::Option<ImageFormat>,
1476 /// width is contained in format.
1477 #[deprecated]
1478 #[prost(uint32, tag = "2")]
1479 pub width: u32,
1480 /// height is contained in format.
1481 #[deprecated]
1482 #[prost(uint32, tag = "3")]
1483 pub height: u32,
1484 /// The organization of the pixels in the image buffer is from left to
1485 /// right and bottom up. This will be empty if an alternative image transport
1486 /// is requested in the image format. In that case the side channel should
1487 /// be used to obtain the image data.
1488 #[prost(bytes = "vec", tag = "4")]
1489 pub image: ::prost::alloc::vec::Vec<u8>,
1490 /// \[Output Only\] Monotonically increasing sequence number in a stream of
1491 /// screenshots. The first screenshot will have a sequence of 0. A single
1492 /// screenshot will always have a sequence number of 0. The sequence is not
1493 /// necessarily contiguous, and can be used to detect how many frames were
1494 /// dropped. An example sequence could be: \[0, 3, 5, 7, 9, 11\].
1495 #[prost(uint32, tag = "5")]
1496 pub seq: u32,
1497 /// \[Output Only\] Unix timestamp in microseconds when the emulator estimates
1498 /// the frame was generated. The timestamp is before the actual frame is
1499 /// copied and transformed. This can be used to calculate variance between
1500 /// frame production time, and frame depiction time.
1501 #[prost(uint64, tag = "6")]
1502 pub timestamp_us: u64,
1503}
1504#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1505pub struct Rotation {
1506 /// The rotation of the device, derived from the sensor state
1507 /// of the emulator. The derivation reflects how android observes
1508 /// the rotation state.
1509 #[prost(enumeration = "rotation::SkinRotation", tag = "1")]
1510 pub rotation: i32,
1511 /// Specifies the angle of rotation, in degrees \[-180, 180\]
1512 #[prost(double, tag = "2")]
1513 pub x_axis: f64,
1514 #[prost(double, tag = "3")]
1515 pub y_axis: f64,
1516 #[prost(double, tag = "4")]
1517 pub z_axis: f64,
1518}
1519/// Nested message and enum types in `Rotation`.
1520pub mod rotation {
1521 #[derive(
1522 Clone,
1523 Copy,
1524 Debug,
1525 PartialEq,
1526 Eq,
1527 Hash,
1528 PartialOrd,
1529 Ord,
1530 ::prost::Enumeration
1531 )]
1532 #[repr(i32)]
1533 pub enum SkinRotation {
1534 /// 0 degrees
1535 Portrait = 0,
1536 /// 90 degrees
1537 Landscape = 1,
1538 /// -180 degrees
1539 ReversePortrait = 2,
1540 /// -90 degrees
1541 ReverseLandscape = 3,
1542 }
1543 impl SkinRotation {
1544 /// String value of the enum field names used in the ProtoBuf definition.
1545 ///
1546 /// The values are not transformed in any way and thus are considered stable
1547 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1548 pub fn as_str_name(&self) -> &'static str {
1549 match self {
1550 Self::Portrait => "PORTRAIT",
1551 Self::Landscape => "LANDSCAPE",
1552 Self::ReversePortrait => "REVERSE_PORTRAIT",
1553 Self::ReverseLandscape => "REVERSE_LANDSCAPE",
1554 }
1555 }
1556 /// Creates an enum from field names used in the ProtoBuf definition.
1557 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1558 match value {
1559 "PORTRAIT" => Some(Self::Portrait),
1560 "LANDSCAPE" => Some(Self::Landscape),
1561 "REVERSE_PORTRAIT" => Some(Self::ReversePortrait),
1562 "REVERSE_LANDSCAPE" => Some(Self::ReverseLandscape),
1563 _ => None,
1564 }
1565 }
1566 }
1567}
1568#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1569pub struct PhoneCall {
1570 #[prost(enumeration = "phone_call::Operation", tag = "1")]
1571 pub operation: i32,
1572 #[prost(string, tag = "2")]
1573 pub number: ::prost::alloc::string::String,
1574}
1575/// Nested message and enum types in `PhoneCall`.
1576pub mod phone_call {
1577 #[derive(
1578 Clone,
1579 Copy,
1580 Debug,
1581 PartialEq,
1582 Eq,
1583 Hash,
1584 PartialOrd,
1585 Ord,
1586 ::prost::Enumeration
1587 )]
1588 #[repr(i32)]
1589 pub enum Operation {
1590 InitCall = 0,
1591 AcceptCall = 1,
1592 RejectCallExplicit = 2,
1593 RejectCallBusy = 3,
1594 DisconnectCall = 4,
1595 PlaceCallOnHold = 5,
1596 TakeCallOffHold = 6,
1597 }
1598 impl Operation {
1599 /// String value of the enum field names used in the ProtoBuf definition.
1600 ///
1601 /// The values are not transformed in any way and thus are considered stable
1602 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1603 pub fn as_str_name(&self) -> &'static str {
1604 match self {
1605 Self::InitCall => "InitCall",
1606 Self::AcceptCall => "AcceptCall",
1607 Self::RejectCallExplicit => "RejectCallExplicit",
1608 Self::RejectCallBusy => "RejectCallBusy",
1609 Self::DisconnectCall => "DisconnectCall",
1610 Self::PlaceCallOnHold => "PlaceCallOnHold",
1611 Self::TakeCallOffHold => "TakeCallOffHold",
1612 }
1613 }
1614 /// Creates an enum from field names used in the ProtoBuf definition.
1615 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1616 match value {
1617 "InitCall" => Some(Self::InitCall),
1618 "AcceptCall" => Some(Self::AcceptCall),
1619 "RejectCallExplicit" => Some(Self::RejectCallExplicit),
1620 "RejectCallBusy" => Some(Self::RejectCallBusy),
1621 "DisconnectCall" => Some(Self::DisconnectCall),
1622 "PlaceCallOnHold" => Some(Self::PlaceCallOnHold),
1623 "TakeCallOffHold" => Some(Self::TakeCallOffHold),
1624 _ => None,
1625 }
1626 }
1627 }
1628}
1629#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1630pub struct PhoneResponse {
1631 #[prost(enumeration = "phone_response::Response", tag = "1")]
1632 pub response: i32,
1633}
1634/// Nested message and enum types in `PhoneResponse`.
1635pub mod phone_response {
1636 #[derive(
1637 Clone,
1638 Copy,
1639 Debug,
1640 PartialEq,
1641 Eq,
1642 Hash,
1643 PartialOrd,
1644 Ord,
1645 ::prost::Enumeration
1646 )]
1647 #[repr(i32)]
1648 pub enum Response {
1649 Ok = 0,
1650 /// Enum out of range
1651 BadOperation = 1,
1652 /// Mal-formed telephone number
1653 BadNumber = 2,
1654 /// E.g., disconnect when no call is in progress
1655 InvalidAction = 3,
1656 /// Internal error
1657 ActionFailed = 4,
1658 /// Radio power off
1659 RadioOff = 5,
1660 }
1661 impl Response {
1662 /// String value of the enum field names used in the ProtoBuf definition.
1663 ///
1664 /// The values are not transformed in any way and thus are considered stable
1665 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1666 pub fn as_str_name(&self) -> &'static str {
1667 match self {
1668 Self::Ok => "OK",
1669 Self::BadOperation => "BadOperation",
1670 Self::BadNumber => "BadNumber",
1671 Self::InvalidAction => "InvalidAction",
1672 Self::ActionFailed => "ActionFailed",
1673 Self::RadioOff => "RadioOff",
1674 }
1675 }
1676 /// Creates an enum from field names used in the ProtoBuf definition.
1677 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1678 match value {
1679 "OK" => Some(Self::Ok),
1680 "BadOperation" => Some(Self::BadOperation),
1681 "BadNumber" => Some(Self::BadNumber),
1682 "InvalidAction" => Some(Self::InvalidAction),
1683 "ActionFailed" => Some(Self::ActionFailed),
1684 "RadioOff" => Some(Self::RadioOff),
1685 _ => None,
1686 }
1687 }
1688 }
1689}
1690#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1691pub struct Entry {
1692 #[prost(string, tag = "1")]
1693 pub key: ::prost::alloc::string::String,
1694 #[prost(string, tag = "2")]
1695 pub value: ::prost::alloc::string::String,
1696}
1697#[derive(Clone, PartialEq, ::prost::Message)]
1698pub struct EntryList {
1699 #[prost(message, repeated, tag = "1")]
1700 pub entry: ::prost::alloc::vec::Vec<Entry>,
1701}
1702#[derive(Clone, PartialEq, ::prost::Message)]
1703pub struct EmulatorStatus {
1704 /// The emulator version string.
1705 #[prost(string, tag = "1")]
1706 pub version: ::prost::alloc::string::String,
1707 /// The time the emulator has been active in .ms
1708 #[prost(uint64, tag = "2")]
1709 pub uptime: u64,
1710 /// True if the device has completed booting.
1711 /// For P and later this information will accurate,
1712 /// for older images we rely on adb.
1713 #[prost(bool, tag = "3")]
1714 pub booted: bool,
1715 /// The current vm configuration
1716 #[prost(message, optional, tag = "4")]
1717 pub vm_config: ::core::option::Option<VmConfiguration>,
1718 /// The hardware configuration of the running emulator as
1719 /// key valure pairs.
1720 #[prost(message, optional, tag = "5")]
1721 pub hardware_config: ::core::option::Option<EntryList>,
1722 /// Some guests will produce a heart beat, that can be used to
1723 /// detect if the guest is active.
1724 /// This is a monotonically increasing number that gets incremented
1725 /// around once a second.
1726 #[prost(uint64, tag = "6")]
1727 pub heartbeat: u64,
1728 /// The configuration of services in the guest, this map
1729 /// contains key value pairs that are specific to the image
1730 /// used by the guest.
1731 #[prost(map = "string, string", tag = "7")]
1732 pub guest_config: ::std::collections::HashMap<
1733 ::prost::alloc::string::String,
1734 ::prost::alloc::string::String,
1735 >,
1736}
1737#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1738pub struct AudioFormat {
1739 /// Sampling rate to use, defaulting to 44100 if this is not set.
1740 /// Note, that android devices typically will not use a sampling
1741 /// rate higher than 48kHz. See
1742 /// <https://developer.android.com/ndk/guides/audio.>
1743 #[prost(uint64, tag = "1")]
1744 pub sampling_rate: u64,
1745 #[prost(enumeration = "audio_format::Channels", tag = "2")]
1746 pub channels: i32,
1747 #[prost(enumeration = "audio_format::SampleFormat", tag = "3")]
1748 pub format: i32,
1749 /// \[Input Only\]
1750 /// The mode used when delivering audio packets.
1751 #[prost(enumeration = "audio_format::DeliveryMode", tag = "4")]
1752 pub mode: i32,
1753}
1754/// Nested message and enum types in `AudioFormat`.
1755pub mod audio_format {
1756 #[derive(
1757 Clone,
1758 Copy,
1759 Debug,
1760 PartialEq,
1761 Eq,
1762 Hash,
1763 PartialOrd,
1764 Ord,
1765 ::prost::Enumeration
1766 )]
1767 #[repr(i32)]
1768 pub enum SampleFormat {
1769 /// Unsigned 8 bit
1770 AudFmtU8 = 0,
1771 /// Signed 16 bit (little endian)
1772 AudFmtS16 = 1,
1773 }
1774 impl SampleFormat {
1775 /// String value of the enum field names used in the ProtoBuf definition.
1776 ///
1777 /// The values are not transformed in any way and thus are considered stable
1778 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1779 pub fn as_str_name(&self) -> &'static str {
1780 match self {
1781 Self::AudFmtU8 => "AUD_FMT_U8",
1782 Self::AudFmtS16 => "AUD_FMT_S16",
1783 }
1784 }
1785 /// Creates an enum from field names used in the ProtoBuf definition.
1786 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1787 match value {
1788 "AUD_FMT_U8" => Some(Self::AudFmtU8),
1789 "AUD_FMT_S16" => Some(Self::AudFmtS16),
1790 _ => None,
1791 }
1792 }
1793 }
1794 #[derive(
1795 Clone,
1796 Copy,
1797 Debug,
1798 PartialEq,
1799 Eq,
1800 Hash,
1801 PartialOrd,
1802 Ord,
1803 ::prost::Enumeration
1804 )]
1805 #[repr(i32)]
1806 pub enum Channels {
1807 Mono = 0,
1808 Stereo = 1,
1809 }
1810 impl Channels {
1811 /// String value of the enum field names used in the ProtoBuf definition.
1812 ///
1813 /// The values are not transformed in any way and thus are considered stable
1814 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1815 pub fn as_str_name(&self) -> &'static str {
1816 match self {
1817 Self::Mono => "Mono",
1818 Self::Stereo => "Stereo",
1819 }
1820 }
1821 /// Creates an enum from field names used in the ProtoBuf definition.
1822 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1823 match value {
1824 "Mono" => Some(Self::Mono),
1825 "Stereo" => Some(Self::Stereo),
1826 _ => None,
1827 }
1828 }
1829 }
1830 #[derive(
1831 Clone,
1832 Copy,
1833 Debug,
1834 PartialEq,
1835 Eq,
1836 Hash,
1837 PartialOrd,
1838 Ord,
1839 ::prost::Enumeration
1840 )]
1841 #[repr(i32)]
1842 pub enum DeliveryMode {
1843 /// The audio queue will block and wait until the emulator requests
1844 /// packets. The client does not have to throttle and can push packets at
1845 /// will. This can result in the client falling behind.
1846 ModeUnspecified = 0,
1847 /// Audio packets will be delivered in real time (when possible). The
1848 /// audio queue will be overwritten with incoming data if data is made
1849 /// available. This means the client needs to control timing properly, or
1850 /// packets will get overwritten.
1851 ModeRealTime = 1,
1852 }
1853 impl DeliveryMode {
1854 /// String value of the enum field names used in the ProtoBuf definition.
1855 ///
1856 /// The values are not transformed in any way and thus are considered stable
1857 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1858 pub fn as_str_name(&self) -> &'static str {
1859 match self {
1860 Self::ModeUnspecified => "MODE_UNSPECIFIED",
1861 Self::ModeRealTime => "MODE_REAL_TIME",
1862 }
1863 }
1864 /// Creates an enum from field names used in the ProtoBuf definition.
1865 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1866 match value {
1867 "MODE_UNSPECIFIED" => Some(Self::ModeUnspecified),
1868 "MODE_REAL_TIME" => Some(Self::ModeRealTime),
1869 _ => None,
1870 }
1871 }
1872 }
1873}
1874#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1875pub struct AudioPacket {
1876 #[prost(message, optional, tag = "1")]
1877 pub format: ::core::option::Option<AudioFormat>,
1878 /// Unix epoch in us when this frame was captured.
1879 #[prost(uint64, tag = "2")]
1880 pub timestamp: u64,
1881 /// Contains a sample in the given audio format.
1882 #[prost(bytes = "vec", tag = "3")]
1883 pub audio: ::prost::alloc::vec::Vec<u8>,
1884}
1885#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1886pub struct SmsMessage {
1887 /// The source address where this message came from.
1888 ///
1889 /// The address should be a valid GSM-formatted address as specified by
1890 /// 3GPP 23.040 Sec 9.1.2.5.
1891 ///
1892 /// For example: +3106225412 or (650) 555-1221
1893 #[prost(string, tag = "1")]
1894 pub src_address: ::prost::alloc::string::String,
1895 /// A utf8 encoded text message that should be delivered.
1896 #[prost(string, tag = "2")]
1897 pub text: ::prost::alloc::string::String,
1898}
1899/// A DisplayConfiguration describes a primary or secondary
1900/// display available to the emulator. The screen aspect ratio
1901/// cannot be longer (or wider) than 21:9 (or 9:21). Screen sizes
1902/// larger than 4k will be rejected.
1903///
1904/// Common configurations (w x h) are:
1905///
1906/// * 480p (480x720) 142 dpi
1907/// * 720p (720x1280) 213 dpi
1908/// * 1080p (1080x1920) 320 dpi
1909/// * 4K (2160x3840) 320 dpi
1910/// * 4K (2160x3840) 640 dpi (upscaled)
1911///
1912/// The behavior of the virtual display depends on the flags that are provided to
1913/// this method. By default, virtual displays are created to be private,
1914/// non-presentation and unsecure.
1915#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1916pub struct DisplayConfiguration {
1917 /// The width of the display, restricted to:
1918 /// 320 * (dpi / 160) \<= width
1919 #[prost(uint32, tag = "1")]
1920 pub width: u32,
1921 /// The heigh of the display, restricted to:
1922 ///
1923 /// * 320 * (dpi / 160) \<= height
1924 #[prost(uint32, tag = "2")]
1925 pub height: u32,
1926 /// The pixel density (dpi).
1927 /// See <https://developer.android.com/training/multiscreen/screendensities>
1928 /// for details. This value should be in the range \[120, ..., 640\]
1929 #[prost(uint32, tag = "3")]
1930 pub dpi: u32,
1931 /// A combination of virtual display flags. These flags can be constructed
1932 /// by combining the DisplayFlags enum described above.
1933 ///
1934 /// The behavior of the virtual display depends on the flags. By default
1935 /// virtual displays are created to be private, non-presentation and
1936 /// unsecure.
1937 #[prost(uint32, tag = "4")]
1938 pub flags: u32,
1939 /// The id of the display.
1940 /// The primary (default) display has the display ID of 0.
1941 /// A secondary display has a display ID not 0.
1942 ///
1943 /// A display with the id in the range \[1, userConfigurable\]
1944 /// can be modified. See DisplayConfigurations below for details.
1945 ///
1946 /// The id can be used to get or stream a screenshot.
1947 #[prost(uint32, tag = "5")]
1948 pub display: u32,
1949}
1950/// Nested message and enum types in `DisplayConfiguration`.
1951pub mod display_configuration {
1952 /// These are the set of known android flags and their respective values.
1953 /// you can combine the int values to (de)construct the flags field below.
1954 #[derive(
1955 Clone,
1956 Copy,
1957 Debug,
1958 PartialEq,
1959 Eq,
1960 Hash,
1961 PartialOrd,
1962 Ord,
1963 ::prost::Enumeration
1964 )]
1965 #[repr(i32)]
1966 pub enum DisplayFlags {
1967 DisplayflagsUnspecified = 0,
1968 /// When this flag is set, the virtual display is public.
1969 /// A public virtual display behaves just like most any other display
1970 /// that is connected to the system such as an external or wireless
1971 /// display. Applications can open windows on the display and the system
1972 /// may mirror the contents of other displays onto it. see:
1973 /// <https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PUBLIC>
1974 VirtualDisplayFlagPublic = 1,
1975 /// When this flag is set, the virtual display is registered as a
1976 /// presentation display in the presentation display category.
1977 /// Applications may automatically project their content to presentation
1978 /// displays to provide richer second screen experiences.
1979 /// <https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_PRESENTATION>
1980 VirtualDisplayFlagPresentation = 2,
1981 /// When this flag is set, the virtual display is considered secure as
1982 /// defined by the Display#FLAG_SECURE display flag. The caller promises
1983 /// to take reasonable measures, such as over-the-air encryption, to
1984 /// prevent the contents of the display from being intercepted or
1985 /// recorded on a persistent medium.
1986 /// see:
1987 /// <https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_SECURE>
1988 VirtualDisplayFlagSecure = 4,
1989 /// This flag is used in conjunction with VIRTUAL_DISPLAY_FLAG_PUBLIC.
1990 /// Ordinarily public virtual displays will automatically mirror the
1991 /// content of the default display if they have no windows of their own.
1992 /// When this flag is specified, the virtual display will only ever show
1993 /// its own content and will be blanked instead if it has no windows. See
1994 /// <https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY>
1995 VirtualDisplayFlagOwnContentOnly = 8,
1996 /// Allows content to be mirrored on private displays when no content is
1997 /// being shown.
1998 /// This flag is mutually exclusive with
1999 /// VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY. If both flags are specified
2000 /// then the own-content only behavior will be applied.
2001 /// see:
2002 /// <https://developer.android.com/reference/android/hardware/display/DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR>)
2003 VirtualDisplayFlagAutoMirror = 16,
2004 }
2005 impl DisplayFlags {
2006 /// String value of the enum field names used in the ProtoBuf definition.
2007 ///
2008 /// The values are not transformed in any way and thus are considered stable
2009 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2010 pub fn as_str_name(&self) -> &'static str {
2011 match self {
2012 Self::DisplayflagsUnspecified => "DISPLAYFLAGS_UNSPECIFIED",
2013 Self::VirtualDisplayFlagPublic => "VIRTUAL_DISPLAY_FLAG_PUBLIC",
2014 Self::VirtualDisplayFlagPresentation => {
2015 "VIRTUAL_DISPLAY_FLAG_PRESENTATION"
2016 }
2017 Self::VirtualDisplayFlagSecure => "VIRTUAL_DISPLAY_FLAG_SECURE",
2018 Self::VirtualDisplayFlagOwnContentOnly => {
2019 "VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY"
2020 }
2021 Self::VirtualDisplayFlagAutoMirror => "VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR",
2022 }
2023 }
2024 /// Creates an enum from field names used in the ProtoBuf definition.
2025 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2026 match value {
2027 "DISPLAYFLAGS_UNSPECIFIED" => Some(Self::DisplayflagsUnspecified),
2028 "VIRTUAL_DISPLAY_FLAG_PUBLIC" => Some(Self::VirtualDisplayFlagPublic),
2029 "VIRTUAL_DISPLAY_FLAG_PRESENTATION" => {
2030 Some(Self::VirtualDisplayFlagPresentation)
2031 }
2032 "VIRTUAL_DISPLAY_FLAG_SECURE" => Some(Self::VirtualDisplayFlagSecure),
2033 "VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY" => {
2034 Some(Self::VirtualDisplayFlagOwnContentOnly)
2035 }
2036 "VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR" => {
2037 Some(Self::VirtualDisplayFlagAutoMirror)
2038 }
2039 _ => None,
2040 }
2041 }
2042 }
2043}
2044/// Provides information about all the displays that can be attached
2045/// to the emulator. The emulator will always have at least one display.
2046///
2047/// The emulator usually has the following display configurations:
2048/// 0: The default display.
2049/// 1 - 3: User configurable displays. These can be added/removed.
2050/// For example the standalone emulator allows you to modify these
2051/// in the extended controls.
2052/// 6 - 11: Fixed external displays. For example Android Auto uses fixed
2053/// displays in this range.
2054#[derive(Clone, PartialEq, ::prost::Message)]
2055pub struct DisplayConfigurations {
2056 #[prost(message, repeated, tag = "1")]
2057 pub displays: ::prost::alloc::vec::Vec<DisplayConfiguration>,
2058 /// Display configurations with id \[1, userConfigurable\] are
2059 /// user configurable, that is they can be added, removed or
2060 /// updated.
2061 #[prost(uint32, tag = "2")]
2062 pub user_configurable: u32,
2063 /// The maximum number of attached displays this emulator supports.
2064 /// This is the total number of displays that can be attached to
2065 /// the emulator.
2066 ///
2067 /// Note: A display with an id that is larger than userConfigurable cannot
2068 /// be modified.
2069 #[prost(uint32, tag = "3")]
2070 pub max_displays: u32,
2071}
2072#[derive(Clone, PartialEq, ::prost::Message)]
2073pub struct Notification {
2074 /// Deprecated, use the type below to get detailed information
2075 /// regarding the event.
2076 #[deprecated]
2077 #[prost(enumeration = "notification::EventType", tag = "1")]
2078 pub event: i32,
2079 /// Detailed notification information.
2080 #[prost(oneof = "notification::Type", tags = "2, 3, 4, 5, 6")]
2081 pub r#type: ::core::option::Option<notification::Type>,
2082}
2083/// Nested message and enum types in `Notification`.
2084pub mod notification {
2085 #[derive(
2086 Clone,
2087 Copy,
2088 Debug,
2089 PartialEq,
2090 Eq,
2091 Hash,
2092 PartialOrd,
2093 Ord,
2094 ::prost::Enumeration
2095 )]
2096 #[repr(i32)]
2097 pub enum EventType {
2098 VirtualSceneCameraInactive = 0,
2099 VirtualSceneCameraActive = 1,
2100 /// Fired when an update to a display event has been fired through
2101 /// the extended ui. This does not fire events when the display
2102 /// is changed through the console or gRPC endpoint.
2103 DisplayConfigurationsChangedUi = 2,
2104 }
2105 impl EventType {
2106 /// String value of the enum field names used in the ProtoBuf definition.
2107 ///
2108 /// The values are not transformed in any way and thus are considered stable
2109 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2110 pub fn as_str_name(&self) -> &'static str {
2111 match self {
2112 Self::VirtualSceneCameraInactive => "VIRTUAL_SCENE_CAMERA_INACTIVE",
2113 Self::VirtualSceneCameraActive => "VIRTUAL_SCENE_CAMERA_ACTIVE",
2114 Self::DisplayConfigurationsChangedUi => {
2115 "DISPLAY_CONFIGURATIONS_CHANGED_UI"
2116 }
2117 }
2118 }
2119 /// Creates an enum from field names used in the ProtoBuf definition.
2120 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2121 match value {
2122 "VIRTUAL_SCENE_CAMERA_INACTIVE" => Some(Self::VirtualSceneCameraInactive),
2123 "VIRTUAL_SCENE_CAMERA_ACTIVE" => Some(Self::VirtualSceneCameraActive),
2124 "DISPLAY_CONFIGURATIONS_CHANGED_UI" => {
2125 Some(Self::DisplayConfigurationsChangedUi)
2126 }
2127 _ => None,
2128 }
2129 }
2130 }
2131 /// Detailed notification information.
2132 #[derive(Clone, PartialEq, ::prost::Oneof)]
2133 pub enum Type {
2134 #[prost(message, tag = "2")]
2135 CameraNotification(super::CameraNotification),
2136 #[prost(message, tag = "3")]
2137 DisplayConfigurationsChangedNotification(
2138 super::DisplayConfigurationsChangedNotification,
2139 ),
2140 #[prost(message, tag = "4")]
2141 Posture(super::Posture),
2142 #[prost(message, tag = "5")]
2143 Booted(super::BootCompletedNotification),
2144 #[prost(message, tag = "6")]
2145 Brightness(super::BrightnessValue),
2146 }
2147}
2148#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2149pub struct BootCompletedNotification {
2150 /// The time in milliseconds it took for the boot to complete.
2151 /// Note that this value can be 0 when you are loading from a snapshot.
2152 #[prost(int32, tag = "1")]
2153 pub time: i32,
2154}
2155/// Fired when the virtual scene camera is activated or deactivated and also in
2156/// response to the streamNotification call.
2157#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2158pub struct CameraNotification {
2159 /// Indicates whether the camera app was activated or deactivated.
2160 #[prost(bool, tag = "1")]
2161 pub active: bool,
2162 /// The display the camera app is associated with.
2163 #[prost(int32, tag = "2")]
2164 pub display: i32,
2165}
2166/// Fired when an update to a display event has been fired through the extended
2167/// ui. This does not fire events when the display is changed through the console
2168/// or the gRPC endpoint.
2169#[derive(Clone, PartialEq, ::prost::Message)]
2170pub struct DisplayConfigurationsChangedNotification {
2171 #[prost(message, optional, tag = "1")]
2172 pub display_configurations: ::core::option::Option<DisplayConfigurations>,
2173}
2174/// Rotation angles are relative to the current orientation.
2175#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2176pub struct RotationRadian {
2177 /// Angle of rotation around the x axis in right-handed direction.
2178 #[prost(float, tag = "1")]
2179 pub x: f32,
2180 /// Angle of rotation around the y axis in right-handed direction.
2181 #[prost(float, tag = "2")]
2182 pub y: f32,
2183 /// Angle of rotation around the z axis in right-handed direction.
2184 #[prost(float, tag = "3")]
2185 pub z: f32,
2186}
2187/// Velocity is measured in meters per second.
2188#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2189pub struct Velocity {
2190 #[prost(float, tag = "1")]
2191 pub x: f32,
2192 #[prost(float, tag = "2")]
2193 pub y: f32,
2194 #[prost(float, tag = "3")]
2195 pub z: f32,
2196}
2197/// Must follow the definition in "external/qemu/android/hw-sensors.h"
2198#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2199pub struct Posture {
2200 #[prost(enumeration = "posture::PostureValue", tag = "3")]
2201 pub value: i32,
2202}
2203/// Nested message and enum types in `Posture`.
2204pub mod posture {
2205 #[derive(
2206 Clone,
2207 Copy,
2208 Debug,
2209 PartialEq,
2210 Eq,
2211 Hash,
2212 PartialOrd,
2213 Ord,
2214 ::prost::Enumeration
2215 )]
2216 #[repr(i32)]
2217 pub enum PostureValue {
2218 PostureUnknown = 0,
2219 PostureClosed = 1,
2220 PostureHalfOpened = 2,
2221 PostureOpened = 3,
2222 PostureFlipped = 4,
2223 PostureTent = 5,
2224 PostureMax = 6,
2225 }
2226 impl PostureValue {
2227 /// String value of the enum field names used in the ProtoBuf definition.
2228 ///
2229 /// The values are not transformed in any way and thus are considered stable
2230 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2231 pub fn as_str_name(&self) -> &'static str {
2232 match self {
2233 Self::PostureUnknown => "POSTURE_UNKNOWN",
2234 Self::PostureClosed => "POSTURE_CLOSED",
2235 Self::PostureHalfOpened => "POSTURE_HALF_OPENED",
2236 Self::PostureOpened => "POSTURE_OPENED",
2237 Self::PostureFlipped => "POSTURE_FLIPPED",
2238 Self::PostureTent => "POSTURE_TENT",
2239 Self::PostureMax => "POSTURE_MAX",
2240 }
2241 }
2242 /// Creates an enum from field names used in the ProtoBuf definition.
2243 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2244 match value {
2245 "POSTURE_UNKNOWN" => Some(Self::PostureUnknown),
2246 "POSTURE_CLOSED" => Some(Self::PostureClosed),
2247 "POSTURE_HALF_OPENED" => Some(Self::PostureHalfOpened),
2248 "POSTURE_OPENED" => Some(Self::PostureOpened),
2249 "POSTURE_FLIPPED" => Some(Self::PostureFlipped),
2250 "POSTURE_TENT" => Some(Self::PostureTent),
2251 "POSTURE_MAX" => Some(Self::PostureMax),
2252 _ => None,
2253 }
2254 }
2255 }
2256}
2257#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2258pub struct PhoneNumber {
2259 /// The phone number should be a valid GSM-formatted number as specified by
2260 /// 3GPP 23.040 Sec 9.1.2.5.
2261 ///
2262 /// For example: +3106225412 or (650) 555-1221
2263 #[prost(string, tag = "1")]
2264 pub number: ::prost::alloc::string::String,
2265}
2266/// in line with android/emulation/resizable_display_config.h
2267#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2268#[repr(i32)]
2269pub enum DisplayModeValue {
2270 Phone = 0,
2271 Foldable = 1,
2272 Tablet = 2,
2273 Desktop = 3,
2274}
2275impl DisplayModeValue {
2276 /// String value of the enum field names used in the ProtoBuf definition.
2277 ///
2278 /// The values are not transformed in any way and thus are considered stable
2279 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2280 pub fn as_str_name(&self) -> &'static str {
2281 match self {
2282 Self::Phone => "PHONE",
2283 Self::Foldable => "FOLDABLE",
2284 Self::Tablet => "TABLET",
2285 Self::Desktop => "DESKTOP",
2286 }
2287 }
2288 /// Creates an enum from field names used in the ProtoBuf definition.
2289 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2290 match value {
2291 "PHONE" => Some(Self::Phone),
2292 "FOLDABLE" => Some(Self::Foldable),
2293 "TABLET" => Some(Self::Tablet),
2294 "DESKTOP" => Some(Self::Desktop),
2295 _ => None,
2296 }
2297 }
2298}
2299/// Generated client implementations.
2300pub mod emulator_controller_client {
2301 #![allow(
2302 unused_variables,
2303 dead_code,
2304 missing_docs,
2305 clippy::wildcard_imports,
2306 clippy::let_unit_value,
2307 )]
2308 use tonic::codegen::*;
2309 use tonic::codegen::http::Uri;
2310 /// An EmulatorController service lets you control the emulator.
2311 /// Note that this is currently an experimental feature, and that the
2312 /// service definition might change without notice. Use at your own risk!
2313 ///
2314 /// We use the following rough conventions:
2315 ///
2316 /// streamXXX --> streams values XXX (usually for emulator lifetime). Values
2317 /// are updated as soon as they become available.
2318 /// getXXX --> gets a single value XXX
2319 /// setXXX --> sets a single value XXX, does not returning state, these
2320 /// usually have an observable lasting side effect.
2321 /// sendXXX --> send a single event XXX, possibly returning state information.
2322 /// android usually responds to these events.
2323 #[derive(Debug, Clone)]
2324 pub struct EmulatorControllerClient<T> {
2325 inner: tonic::client::Grpc<T>,
2326 }
2327 impl EmulatorControllerClient<tonic::transport::Channel> {
2328 /// Attempt to create a new client by connecting to a given endpoint.
2329 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2330 where
2331 D: TryInto<tonic::transport::Endpoint>,
2332 D::Error: Into<StdError>,
2333 {
2334 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2335 Ok(Self::new(conn))
2336 }
2337 }
2338 impl<T> EmulatorControllerClient<T>
2339 where
2340 T: tonic::client::GrpcService<tonic::body::Body>,
2341 T::Error: Into<StdError>,
2342 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2343 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2344 {
2345 pub fn new(inner: T) -> Self {
2346 let inner = tonic::client::Grpc::new(inner);
2347 Self { inner }
2348 }
2349 pub fn with_origin(inner: T, origin: Uri) -> Self {
2350 let inner = tonic::client::Grpc::with_origin(inner, origin);
2351 Self { inner }
2352 }
2353 pub fn with_interceptor<F>(
2354 inner: T,
2355 interceptor: F,
2356 ) -> EmulatorControllerClient<InterceptedService<T, F>>
2357 where
2358 F: tonic::service::Interceptor,
2359 T::ResponseBody: Default,
2360 T: tonic::codegen::Service<
2361 http::Request<tonic::body::Body>,
2362 Response = http::Response<
2363 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2364 >,
2365 >,
2366 <T as tonic::codegen::Service<
2367 http::Request<tonic::body::Body>,
2368 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2369 {
2370 EmulatorControllerClient::new(InterceptedService::new(inner, interceptor))
2371 }
2372 /// Compress requests with the given encoding.
2373 ///
2374 /// This requires the server to support it otherwise it might respond with an
2375 /// error.
2376 #[must_use]
2377 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2378 self.inner = self.inner.send_compressed(encoding);
2379 self
2380 }
2381 /// Enable decompressing responses.
2382 #[must_use]
2383 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2384 self.inner = self.inner.accept_compressed(encoding);
2385 self
2386 }
2387 /// Limits the maximum size of a decoded message.
2388 ///
2389 /// Default: `4MB`
2390 #[must_use]
2391 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2392 self.inner = self.inner.max_decoding_message_size(limit);
2393 self
2394 }
2395 /// Limits the maximum size of an encoded message.
2396 ///
2397 /// Default: `usize::MAX`
2398 #[must_use]
2399 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2400 self.inner = self.inner.max_encoding_message_size(limit);
2401 self
2402 }
2403 /// set/get/stream the sensor data
2404 pub async fn stream_sensor(
2405 &mut self,
2406 request: impl tonic::IntoRequest<super::SensorValue>,
2407 ) -> std::result::Result<
2408 tonic::Response<tonic::codec::Streaming<super::SensorValue>>,
2409 tonic::Status,
2410 > {
2411 self.inner
2412 .ready()
2413 .await
2414 .map_err(|e| {
2415 tonic::Status::unknown(
2416 format!("Service was not ready: {}", e.into()),
2417 )
2418 })?;
2419 let codec = tonic_prost::ProstCodec::default();
2420 let path = http::uri::PathAndQuery::from_static(
2421 "/android.emulation.control.EmulatorController/streamSensor",
2422 );
2423 let mut req = request.into_request();
2424 req.extensions_mut()
2425 .insert(
2426 GrpcMethod::new(
2427 "android.emulation.control.EmulatorController",
2428 "streamSensor",
2429 ),
2430 );
2431 self.inner.server_streaming(req, path, codec).await
2432 }
2433 pub async fn get_sensor(
2434 &mut self,
2435 request: impl tonic::IntoRequest<super::SensorValue>,
2436 ) -> std::result::Result<tonic::Response<super::SensorValue>, tonic::Status> {
2437 self.inner
2438 .ready()
2439 .await
2440 .map_err(|e| {
2441 tonic::Status::unknown(
2442 format!("Service was not ready: {}", e.into()),
2443 )
2444 })?;
2445 let codec = tonic_prost::ProstCodec::default();
2446 let path = http::uri::PathAndQuery::from_static(
2447 "/android.emulation.control.EmulatorController/getSensor",
2448 );
2449 let mut req = request.into_request();
2450 req.extensions_mut()
2451 .insert(
2452 GrpcMethod::new(
2453 "android.emulation.control.EmulatorController",
2454 "getSensor",
2455 ),
2456 );
2457 self.inner.unary(req, path, codec).await
2458 }
2459 pub async fn set_sensor(
2460 &mut self,
2461 request: impl tonic::IntoRequest<super::SensorValue>,
2462 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2463 self.inner
2464 .ready()
2465 .await
2466 .map_err(|e| {
2467 tonic::Status::unknown(
2468 format!("Service was not ready: {}", e.into()),
2469 )
2470 })?;
2471 let codec = tonic_prost::ProstCodec::default();
2472 let path = http::uri::PathAndQuery::from_static(
2473 "/android.emulation.control.EmulatorController/setSensor",
2474 );
2475 let mut req = request.into_request();
2476 req.extensions_mut()
2477 .insert(
2478 GrpcMethod::new(
2479 "android.emulation.control.EmulatorController",
2480 "setSensor",
2481 ),
2482 );
2483 self.inner.unary(req, path, codec).await
2484 }
2485 /// set/get/stream the physical model, this is likely the one you are
2486 /// looking for when you wish to modify the device state.
2487 pub async fn set_physical_model(
2488 &mut self,
2489 request: impl tonic::IntoRequest<super::PhysicalModelValue>,
2490 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2491 self.inner
2492 .ready()
2493 .await
2494 .map_err(|e| {
2495 tonic::Status::unknown(
2496 format!("Service was not ready: {}", e.into()),
2497 )
2498 })?;
2499 let codec = tonic_prost::ProstCodec::default();
2500 let path = http::uri::PathAndQuery::from_static(
2501 "/android.emulation.control.EmulatorController/setPhysicalModel",
2502 );
2503 let mut req = request.into_request();
2504 req.extensions_mut()
2505 .insert(
2506 GrpcMethod::new(
2507 "android.emulation.control.EmulatorController",
2508 "setPhysicalModel",
2509 ),
2510 );
2511 self.inner.unary(req, path, codec).await
2512 }
2513 pub async fn get_physical_model(
2514 &mut self,
2515 request: impl tonic::IntoRequest<super::PhysicalModelValue>,
2516 ) -> std::result::Result<
2517 tonic::Response<super::PhysicalModelValue>,
2518 tonic::Status,
2519 > {
2520 self.inner
2521 .ready()
2522 .await
2523 .map_err(|e| {
2524 tonic::Status::unknown(
2525 format!("Service was not ready: {}", e.into()),
2526 )
2527 })?;
2528 let codec = tonic_prost::ProstCodec::default();
2529 let path = http::uri::PathAndQuery::from_static(
2530 "/android.emulation.control.EmulatorController/getPhysicalModel",
2531 );
2532 let mut req = request.into_request();
2533 req.extensions_mut()
2534 .insert(
2535 GrpcMethod::new(
2536 "android.emulation.control.EmulatorController",
2537 "getPhysicalModel",
2538 ),
2539 );
2540 self.inner.unary(req, path, codec).await
2541 }
2542 pub async fn stream_physical_model(
2543 &mut self,
2544 request: impl tonic::IntoRequest<super::PhysicalModelValue>,
2545 ) -> std::result::Result<
2546 tonic::Response<tonic::codec::Streaming<super::PhysicalModelValue>>,
2547 tonic::Status,
2548 > {
2549 self.inner
2550 .ready()
2551 .await
2552 .map_err(|e| {
2553 tonic::Status::unknown(
2554 format!("Service was not ready: {}", e.into()),
2555 )
2556 })?;
2557 let codec = tonic_prost::ProstCodec::default();
2558 let path = http::uri::PathAndQuery::from_static(
2559 "/android.emulation.control.EmulatorController/streamPhysicalModel",
2560 );
2561 let mut req = request.into_request();
2562 req.extensions_mut()
2563 .insert(
2564 GrpcMethod::new(
2565 "android.emulation.control.EmulatorController",
2566 "streamPhysicalModel",
2567 ),
2568 );
2569 self.inner.server_streaming(req, path, codec).await
2570 }
2571 /// Atomically set/get the current primary clipboard data.
2572 /// Note that a call to setClipboard will result in an immediate
2573 /// event for those who made a call to streamClipboard and are
2574 /// on a different channel than the one used to set the clipboard.
2575 pub async fn set_clipboard(
2576 &mut self,
2577 request: impl tonic::IntoRequest<super::ClipData>,
2578 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2579 self.inner
2580 .ready()
2581 .await
2582 .map_err(|e| {
2583 tonic::Status::unknown(
2584 format!("Service was not ready: {}", e.into()),
2585 )
2586 })?;
2587 let codec = tonic_prost::ProstCodec::default();
2588 let path = http::uri::PathAndQuery::from_static(
2589 "/android.emulation.control.EmulatorController/setClipboard",
2590 );
2591 let mut req = request.into_request();
2592 req.extensions_mut()
2593 .insert(
2594 GrpcMethod::new(
2595 "android.emulation.control.EmulatorController",
2596 "setClipboard",
2597 ),
2598 );
2599 self.inner.unary(req, path, codec).await
2600 }
2601 pub async fn get_clipboard(
2602 &mut self,
2603 request: impl tonic::IntoRequest<()>,
2604 ) -> std::result::Result<tonic::Response<super::ClipData>, tonic::Status> {
2605 self.inner
2606 .ready()
2607 .await
2608 .map_err(|e| {
2609 tonic::Status::unknown(
2610 format!("Service was not ready: {}", e.into()),
2611 )
2612 })?;
2613 let codec = tonic_prost::ProstCodec::default();
2614 let path = http::uri::PathAndQuery::from_static(
2615 "/android.emulation.control.EmulatorController/getClipboard",
2616 );
2617 let mut req = request.into_request();
2618 req.extensions_mut()
2619 .insert(
2620 GrpcMethod::new(
2621 "android.emulation.control.EmulatorController",
2622 "getClipboard",
2623 ),
2624 );
2625 self.inner.unary(req, path, codec).await
2626 }
2627 /// Streams the current data on the clipboard. This will immediately produce
2628 /// a result with the current state of the clipboard after which the stream
2629 /// will block and wait until a new clip event is available from the guest.
2630 /// Calling the setClipboard method above will not result in generating a
2631 /// clip event. It is possible to lose clipboard events if the clipboard
2632 /// updates very rapidly.
2633 pub async fn stream_clipboard(
2634 &mut self,
2635 request: impl tonic::IntoRequest<()>,
2636 ) -> std::result::Result<
2637 tonic::Response<tonic::codec::Streaming<super::ClipData>>,
2638 tonic::Status,
2639 > {
2640 self.inner
2641 .ready()
2642 .await
2643 .map_err(|e| {
2644 tonic::Status::unknown(
2645 format!("Service was not ready: {}", e.into()),
2646 )
2647 })?;
2648 let codec = tonic_prost::ProstCodec::default();
2649 let path = http::uri::PathAndQuery::from_static(
2650 "/android.emulation.control.EmulatorController/streamClipboard",
2651 );
2652 let mut req = request.into_request();
2653 req.extensions_mut()
2654 .insert(
2655 GrpcMethod::new(
2656 "android.emulation.control.EmulatorController",
2657 "streamClipboard",
2658 ),
2659 );
2660 self.inner.server_streaming(req, path, codec).await
2661 }
2662 /// Set/get the battery to the given state.
2663 pub async fn set_battery(
2664 &mut self,
2665 request: impl tonic::IntoRequest<super::BatteryState>,
2666 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2667 self.inner
2668 .ready()
2669 .await
2670 .map_err(|e| {
2671 tonic::Status::unknown(
2672 format!("Service was not ready: {}", e.into()),
2673 )
2674 })?;
2675 let codec = tonic_prost::ProstCodec::default();
2676 let path = http::uri::PathAndQuery::from_static(
2677 "/android.emulation.control.EmulatorController/setBattery",
2678 );
2679 let mut req = request.into_request();
2680 req.extensions_mut()
2681 .insert(
2682 GrpcMethod::new(
2683 "android.emulation.control.EmulatorController",
2684 "setBattery",
2685 ),
2686 );
2687 self.inner.unary(req, path, codec).await
2688 }
2689 pub async fn get_battery(
2690 &mut self,
2691 request: impl tonic::IntoRequest<()>,
2692 ) -> std::result::Result<tonic::Response<super::BatteryState>, tonic::Status> {
2693 self.inner
2694 .ready()
2695 .await
2696 .map_err(|e| {
2697 tonic::Status::unknown(
2698 format!("Service was not ready: {}", e.into()),
2699 )
2700 })?;
2701 let codec = tonic_prost::ProstCodec::default();
2702 let path = http::uri::PathAndQuery::from_static(
2703 "/android.emulation.control.EmulatorController/getBattery",
2704 );
2705 let mut req = request.into_request();
2706 req.extensions_mut()
2707 .insert(
2708 GrpcMethod::new(
2709 "android.emulation.control.EmulatorController",
2710 "getBattery",
2711 ),
2712 );
2713 self.inner.unary(req, path, codec).await
2714 }
2715 /// Set the state of the gps.
2716 /// Note: Setting the gps position will not be reflected in the user
2717 /// interface. Keep in mind that android usually only samples the gps at 1
2718 /// hz.
2719 pub async fn set_gps(
2720 &mut self,
2721 request: impl tonic::IntoRequest<super::GpsState>,
2722 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2723 self.inner
2724 .ready()
2725 .await
2726 .map_err(|e| {
2727 tonic::Status::unknown(
2728 format!("Service was not ready: {}", e.into()),
2729 )
2730 })?;
2731 let codec = tonic_prost::ProstCodec::default();
2732 let path = http::uri::PathAndQuery::from_static(
2733 "/android.emulation.control.EmulatorController/setGps",
2734 );
2735 let mut req = request.into_request();
2736 req.extensions_mut()
2737 .insert(
2738 GrpcMethod::new(
2739 "android.emulation.control.EmulatorController",
2740 "setGps",
2741 ),
2742 );
2743 self.inner.unary(req, path, codec).await
2744 }
2745 /// Gets the latest gps state as delivered by the setGps call, or location ui
2746 /// if active.
2747 ///
2748 /// Note: this is not necessarily the actual gps coordinate visible at the
2749 /// time, due to gps sample frequency (usually 1hz).
2750 pub async fn get_gps(
2751 &mut self,
2752 request: impl tonic::IntoRequest<()>,
2753 ) -> std::result::Result<tonic::Response<super::GpsState>, tonic::Status> {
2754 self.inner
2755 .ready()
2756 .await
2757 .map_err(|e| {
2758 tonic::Status::unknown(
2759 format!("Service was not ready: {}", e.into()),
2760 )
2761 })?;
2762 let codec = tonic_prost::ProstCodec::default();
2763 let path = http::uri::PathAndQuery::from_static(
2764 "/android.emulation.control.EmulatorController/getGps",
2765 );
2766 let mut req = request.into_request();
2767 req.extensions_mut()
2768 .insert(
2769 GrpcMethod::new(
2770 "android.emulation.control.EmulatorController",
2771 "getGps",
2772 ),
2773 );
2774 self.inner.unary(req, path, codec).await
2775 }
2776 /// Simulate a touch event on the finger print sensor.
2777 pub async fn send_fingerprint(
2778 &mut self,
2779 request: impl tonic::IntoRequest<super::Fingerprint>,
2780 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2781 self.inner
2782 .ready()
2783 .await
2784 .map_err(|e| {
2785 tonic::Status::unknown(
2786 format!("Service was not ready: {}", e.into()),
2787 )
2788 })?;
2789 let codec = tonic_prost::ProstCodec::default();
2790 let path = http::uri::PathAndQuery::from_static(
2791 "/android.emulation.control.EmulatorController/sendFingerprint",
2792 );
2793 let mut req = request.into_request();
2794 req.extensions_mut()
2795 .insert(
2796 GrpcMethod::new(
2797 "android.emulation.control.EmulatorController",
2798 "sendFingerprint",
2799 ),
2800 );
2801 self.inner.unary(req, path, codec).await
2802 }
2803 /// Send a keyboard event. Translating the event.
2804 pub async fn send_key(
2805 &mut self,
2806 request: impl tonic::IntoRequest<super::KeyboardEvent>,
2807 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2808 self.inner
2809 .ready()
2810 .await
2811 .map_err(|e| {
2812 tonic::Status::unknown(
2813 format!("Service was not ready: {}", e.into()),
2814 )
2815 })?;
2816 let codec = tonic_prost::ProstCodec::default();
2817 let path = http::uri::PathAndQuery::from_static(
2818 "/android.emulation.control.EmulatorController/sendKey",
2819 );
2820 let mut req = request.into_request();
2821 req.extensions_mut()
2822 .insert(
2823 GrpcMethod::new(
2824 "android.emulation.control.EmulatorController",
2825 "sendKey",
2826 ),
2827 );
2828 self.inner.unary(req, path, codec).await
2829 }
2830 /// Send touch/mouse events. Note that mouse events can be simulated
2831 /// by touch events.
2832 pub async fn send_touch(
2833 &mut self,
2834 request: impl tonic::IntoRequest<super::TouchEvent>,
2835 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2836 self.inner
2837 .ready()
2838 .await
2839 .map_err(|e| {
2840 tonic::Status::unknown(
2841 format!("Service was not ready: {}", e.into()),
2842 )
2843 })?;
2844 let codec = tonic_prost::ProstCodec::default();
2845 let path = http::uri::PathAndQuery::from_static(
2846 "/android.emulation.control.EmulatorController/sendTouch",
2847 );
2848 let mut req = request.into_request();
2849 req.extensions_mut()
2850 .insert(
2851 GrpcMethod::new(
2852 "android.emulation.control.EmulatorController",
2853 "sendTouch",
2854 ),
2855 );
2856 self.inner.unary(req, path, codec).await
2857 }
2858 pub async fn send_mouse(
2859 &mut self,
2860 request: impl tonic::IntoRequest<super::MouseEvent>,
2861 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2862 self.inner
2863 .ready()
2864 .await
2865 .map_err(|e| {
2866 tonic::Status::unknown(
2867 format!("Service was not ready: {}", e.into()),
2868 )
2869 })?;
2870 let codec = tonic_prost::ProstCodec::default();
2871 let path = http::uri::PathAndQuery::from_static(
2872 "/android.emulation.control.EmulatorController/sendMouse",
2873 );
2874 let mut req = request.into_request();
2875 req.extensions_mut()
2876 .insert(
2877 GrpcMethod::new(
2878 "android.emulation.control.EmulatorController",
2879 "sendMouse",
2880 ),
2881 );
2882 self.inner.unary(req, path, codec).await
2883 }
2884 pub async fn inject_wheel(
2885 &mut self,
2886 request: impl tonic::IntoStreamingRequest<Message = super::WheelEvent>,
2887 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2888 self.inner
2889 .ready()
2890 .await
2891 .map_err(|e| {
2892 tonic::Status::unknown(
2893 format!("Service was not ready: {}", e.into()),
2894 )
2895 })?;
2896 let codec = tonic_prost::ProstCodec::default();
2897 let path = http::uri::PathAndQuery::from_static(
2898 "/android.emulation.control.EmulatorController/injectWheel",
2899 );
2900 let mut req = request.into_streaming_request();
2901 req.extensions_mut()
2902 .insert(
2903 GrpcMethod::new(
2904 "android.emulation.control.EmulatorController",
2905 "injectWheel",
2906 ),
2907 );
2908 self.inner.client_streaming(req, path, codec).await
2909 }
2910 /// Stream a series of input events to the emulator, the events will
2911 /// arrive in order.
2912 pub async fn stream_input_event(
2913 &mut self,
2914 request: impl tonic::IntoStreamingRequest<Message = super::InputEvent>,
2915 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
2916 self.inner
2917 .ready()
2918 .await
2919 .map_err(|e| {
2920 tonic::Status::unknown(
2921 format!("Service was not ready: {}", e.into()),
2922 )
2923 })?;
2924 let codec = tonic_prost::ProstCodec::default();
2925 let path = http::uri::PathAndQuery::from_static(
2926 "/android.emulation.control.EmulatorController/streamInputEvent",
2927 );
2928 let mut req = request.into_streaming_request();
2929 req.extensions_mut()
2930 .insert(
2931 GrpcMethod::new(
2932 "android.emulation.control.EmulatorController",
2933 "streamInputEvent",
2934 ),
2935 );
2936 self.inner.client_streaming(req, path, codec).await
2937 }
2938 /// Make a phone call.
2939 pub async fn send_phone(
2940 &mut self,
2941 request: impl tonic::IntoRequest<super::PhoneCall>,
2942 ) -> std::result::Result<tonic::Response<super::PhoneResponse>, tonic::Status> {
2943 self.inner
2944 .ready()
2945 .await
2946 .map_err(|e| {
2947 tonic::Status::unknown(
2948 format!("Service was not ready: {}", e.into()),
2949 )
2950 })?;
2951 let codec = tonic_prost::ProstCodec::default();
2952 let path = http::uri::PathAndQuery::from_static(
2953 "/android.emulation.control.EmulatorController/sendPhone",
2954 );
2955 let mut req = request.into_request();
2956 req.extensions_mut()
2957 .insert(
2958 GrpcMethod::new(
2959 "android.emulation.control.EmulatorController",
2960 "sendPhone",
2961 ),
2962 );
2963 self.inner.unary(req, path, codec).await
2964 }
2965 /// Sends an sms message to the emulator.
2966 pub async fn send_sms(
2967 &mut self,
2968 request: impl tonic::IntoRequest<super::SmsMessage>,
2969 ) -> std::result::Result<tonic::Response<super::PhoneResponse>, tonic::Status> {
2970 self.inner
2971 .ready()
2972 .await
2973 .map_err(|e| {
2974 tonic::Status::unknown(
2975 format!("Service was not ready: {}", e.into()),
2976 )
2977 })?;
2978 let codec = tonic_prost::ProstCodec::default();
2979 let path = http::uri::PathAndQuery::from_static(
2980 "/android.emulation.control.EmulatorController/sendSms",
2981 );
2982 let mut req = request.into_request();
2983 req.extensions_mut()
2984 .insert(
2985 GrpcMethod::new(
2986 "android.emulation.control.EmulatorController",
2987 "sendSms",
2988 ),
2989 );
2990 self.inner.unary(req, path, codec).await
2991 }
2992 /// Sends an sms message to the emulator.
2993 pub async fn set_phone_number(
2994 &mut self,
2995 request: impl tonic::IntoRequest<super::PhoneNumber>,
2996 ) -> std::result::Result<tonic::Response<super::PhoneResponse>, tonic::Status> {
2997 self.inner
2998 .ready()
2999 .await
3000 .map_err(|e| {
3001 tonic::Status::unknown(
3002 format!("Service was not ready: {}", e.into()),
3003 )
3004 })?;
3005 let codec = tonic_prost::ProstCodec::default();
3006 let path = http::uri::PathAndQuery::from_static(
3007 "/android.emulation.control.EmulatorController/setPhoneNumber",
3008 );
3009 let mut req = request.into_request();
3010 req.extensions_mut()
3011 .insert(
3012 GrpcMethod::new(
3013 "android.emulation.control.EmulatorController",
3014 "setPhoneNumber",
3015 ),
3016 );
3017 self.inner.unary(req, path, codec).await
3018 }
3019 /// Retrieve the status of the emulator. This will contain general
3020 /// hardware information, and whether the device has booted or not.
3021 pub async fn get_status(
3022 &mut self,
3023 request: impl tonic::IntoRequest<()>,
3024 ) -> std::result::Result<tonic::Response<super::EmulatorStatus>, tonic::Status> {
3025 self.inner
3026 .ready()
3027 .await
3028 .map_err(|e| {
3029 tonic::Status::unknown(
3030 format!("Service was not ready: {}", e.into()),
3031 )
3032 })?;
3033 let codec = tonic_prost::ProstCodec::default();
3034 let path = http::uri::PathAndQuery::from_static(
3035 "/android.emulation.control.EmulatorController/getStatus",
3036 );
3037 let mut req = request.into_request();
3038 req.extensions_mut()
3039 .insert(
3040 GrpcMethod::new(
3041 "android.emulation.control.EmulatorController",
3042 "getStatus",
3043 ),
3044 );
3045 self.inner.unary(req, path, codec).await
3046 }
3047 /// Gets an individual screenshot in the desired format.
3048 ///
3049 /// The image will be scaled to the desired ImageFormat, while maintaining
3050 /// the aspect ratio. The returned image will never exceed resolution of the
3051 /// device display. Not setting the width or height (i.e. they are 0) will
3052 /// result in using the display width and height.
3053 ///
3054 /// The resulting image will be properly oriented and can be displayed
3055 /// directly without post processing. For example, if the device has a
3056 /// 1080x1920 screen and is in landscape mode and called with no width or
3057 /// height parameter, it will return a 1920x1080 image.
3058 ///
3059 /// The dimensions of the returned image will never exceed the corresponding
3060 /// display dimensions. For example, this method will return a 1920x1080
3061 /// screenshot, if the display resolution is 1080x1920 and a screenshot of
3062 /// 2048x2048 is requested when the device is in landscape mode.
3063 ///
3064 /// This method will return an empty image if the display is not visible.
3065 pub async fn get_screenshot(
3066 &mut self,
3067 request: impl tonic::IntoRequest<super::ImageFormat>,
3068 ) -> std::result::Result<tonic::Response<super::Image>, tonic::Status> {
3069 self.inner
3070 .ready()
3071 .await
3072 .map_err(|e| {
3073 tonic::Status::unknown(
3074 format!("Service was not ready: {}", e.into()),
3075 )
3076 })?;
3077 let codec = tonic_prost::ProstCodec::default();
3078 let path = http::uri::PathAndQuery::from_static(
3079 "/android.emulation.control.EmulatorController/getScreenshot",
3080 );
3081 let mut req = request.into_request();
3082 req.extensions_mut()
3083 .insert(
3084 GrpcMethod::new(
3085 "android.emulation.control.EmulatorController",
3086 "getScreenshot",
3087 ),
3088 );
3089 self.inner.unary(req, path, codec).await
3090 }
3091 /// Streams a series of screenshots in the desired format.
3092 ///
3093 /// A new frame will be delivered whenever the device produces a new frame.
3094 /// Beware that this can produce a significant amount of data and that
3095 /// certain translations can be very costly. For example, streaming a series
3096 /// of png images is very cpu intensive.
3097 ///
3098 /// Images are produced according to the getScreenshot API described above.
3099 ///
3100 /// If the display is inactive, or becomes inactive, an empty image will be
3101 /// delivered. Images will be delived again if the display becomes active and
3102 /// new frames are produced.
3103 pub async fn stream_screenshot(
3104 &mut self,
3105 request: impl tonic::IntoRequest<super::ImageFormat>,
3106 ) -> std::result::Result<
3107 tonic::Response<tonic::codec::Streaming<super::Image>>,
3108 tonic::Status,
3109 > {
3110 self.inner
3111 .ready()
3112 .await
3113 .map_err(|e| {
3114 tonic::Status::unknown(
3115 format!("Service was not ready: {}", e.into()),
3116 )
3117 })?;
3118 let codec = tonic_prost::ProstCodec::default();
3119 let path = http::uri::PathAndQuery::from_static(
3120 "/android.emulation.control.EmulatorController/streamScreenshot",
3121 );
3122 let mut req = request.into_request();
3123 req.extensions_mut()
3124 .insert(
3125 GrpcMethod::new(
3126 "android.emulation.control.EmulatorController",
3127 "streamScreenshot",
3128 ),
3129 );
3130 self.inner.server_streaming(req, path, codec).await
3131 }
3132 /// Streams a series of audio packets in the desired format.
3133 /// A new frame will be delivered whenever the emulated device
3134 /// produces a new audio frame. You can expect packets to be
3135 /// delivered in intervals of 20-30ms.
3136 ///
3137 /// Be aware that this can block when the emulator does not
3138 /// produce any audio whatsoever!
3139 pub async fn stream_audio(
3140 &mut self,
3141 request: impl tonic::IntoRequest<super::AudioFormat>,
3142 ) -> std::result::Result<
3143 tonic::Response<tonic::codec::Streaming<super::AudioPacket>>,
3144 tonic::Status,
3145 > {
3146 self.inner
3147 .ready()
3148 .await
3149 .map_err(|e| {
3150 tonic::Status::unknown(
3151 format!("Service was not ready: {}", e.into()),
3152 )
3153 })?;
3154 let codec = tonic_prost::ProstCodec::default();
3155 let path = http::uri::PathAndQuery::from_static(
3156 "/android.emulation.control.EmulatorController/streamAudio",
3157 );
3158 let mut req = request.into_request();
3159 req.extensions_mut()
3160 .insert(
3161 GrpcMethod::new(
3162 "android.emulation.control.EmulatorController",
3163 "streamAudio",
3164 ),
3165 );
3166 self.inner.server_streaming(req, path, codec).await
3167 }
3168 /// Injects a series of audio packets to the android microphone.
3169 /// A new frame will be delivered whenever the emulated device
3170 /// requests a new audio frame. Audio is usually delivered at a rate
3171 /// that the emulator is requesting frames. Audio will be stored in a
3172 /// temporary buffer that can hold 300ms of audio.
3173 ///
3174 /// Notes:
3175 ///
3176 /// * Only the first audio format packet that is delivered will be
3177 /// honored. There is no need to send the audio format multiple times.
3178 ///
3179 /// * Real time audio currently immediately overrides the buffer. This
3180 /// means you must provide a constant rate of audio packets. The real
3181 /// time mode is experimental. Timestamps of audio packets might be
3182 /// used in the future to improve synchronization.
3183 ///
3184 /// * INVALID_ARGUMENT (code 3) The sampling rate was too high/low
3185 ///
3186 /// * INVALID_ARGUMENT (code 3) The audio packet was too large to handle.
3187 ///
3188 /// * FAILED_PRECONDITION (code 9) If there was a microphone registered
3189 /// already.
3190 pub async fn inject_audio(
3191 &mut self,
3192 request: impl tonic::IntoStreamingRequest<Message = super::AudioPacket>,
3193 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3194 self.inner
3195 .ready()
3196 .await
3197 .map_err(|e| {
3198 tonic::Status::unknown(
3199 format!("Service was not ready: {}", e.into()),
3200 )
3201 })?;
3202 let codec = tonic_prost::ProstCodec::default();
3203 let path = http::uri::PathAndQuery::from_static(
3204 "/android.emulation.control.EmulatorController/injectAudio",
3205 );
3206 let mut req = request.into_streaming_request();
3207 req.extensions_mut()
3208 .insert(
3209 GrpcMethod::new(
3210 "android.emulation.control.EmulatorController",
3211 "injectAudio",
3212 ),
3213 );
3214 self.inner.client_streaming(req, path, codec).await
3215 }
3216 /// Deprecated, please use the streamLogcat method instead.
3217 #[deprecated]
3218 pub async fn get_logcat(
3219 &mut self,
3220 request: impl tonic::IntoRequest<super::LogMessage>,
3221 ) -> std::result::Result<tonic::Response<super::LogMessage>, tonic::Status> {
3222 self.inner
3223 .ready()
3224 .await
3225 .map_err(|e| {
3226 tonic::Status::unknown(
3227 format!("Service was not ready: {}", e.into()),
3228 )
3229 })?;
3230 let codec = tonic_prost::ProstCodec::default();
3231 let path = http::uri::PathAndQuery::from_static(
3232 "/android.emulation.control.EmulatorController/getLogcat",
3233 );
3234 let mut req = request.into_request();
3235 req.extensions_mut()
3236 .insert(
3237 GrpcMethod::new(
3238 "android.emulation.control.EmulatorController",
3239 "getLogcat",
3240 ),
3241 );
3242 self.inner.unary(req, path, codec).await
3243 }
3244 /// Streams the logcat output from the emulator.
3245 /// Note that parsed logcat messages are only available after L (Api >23)
3246 pub async fn stream_logcat(
3247 &mut self,
3248 request: impl tonic::IntoRequest<super::LogMessage>,
3249 ) -> std::result::Result<
3250 tonic::Response<tonic::codec::Streaming<super::LogMessage>>,
3251 tonic::Status,
3252 > {
3253 self.inner
3254 .ready()
3255 .await
3256 .map_err(|e| {
3257 tonic::Status::unknown(
3258 format!("Service was not ready: {}", e.into()),
3259 )
3260 })?;
3261 let codec = tonic_prost::ProstCodec::default();
3262 let path = http::uri::PathAndQuery::from_static(
3263 "/android.emulation.control.EmulatorController/streamLogcat",
3264 );
3265 let mut req = request.into_request();
3266 req.extensions_mut()
3267 .insert(
3268 GrpcMethod::new(
3269 "android.emulation.control.EmulatorController",
3270 "streamLogcat",
3271 ),
3272 );
3273 self.inner.server_streaming(req, path, codec).await
3274 }
3275 /// Transition the virtual machine to the desired state. Note that
3276 /// some states are only observable. For example you cannot transition
3277 /// to the error state.
3278 pub async fn set_vm_state(
3279 &mut self,
3280 request: impl tonic::IntoRequest<super::VmRunState>,
3281 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3282 self.inner
3283 .ready()
3284 .await
3285 .map_err(|e| {
3286 tonic::Status::unknown(
3287 format!("Service was not ready: {}", e.into()),
3288 )
3289 })?;
3290 let codec = tonic_prost::ProstCodec::default();
3291 let path = http::uri::PathAndQuery::from_static(
3292 "/android.emulation.control.EmulatorController/setVmState",
3293 );
3294 let mut req = request.into_request();
3295 req.extensions_mut()
3296 .insert(
3297 GrpcMethod::new(
3298 "android.emulation.control.EmulatorController",
3299 "setVmState",
3300 ),
3301 );
3302 self.inner.unary(req, path, codec).await
3303 }
3304 /// Gets the state of the virtual machine.
3305 pub async fn get_vm_state(
3306 &mut self,
3307 request: impl tonic::IntoRequest<()>,
3308 ) -> std::result::Result<tonic::Response<super::VmRunState>, tonic::Status> {
3309 self.inner
3310 .ready()
3311 .await
3312 .map_err(|e| {
3313 tonic::Status::unknown(
3314 format!("Service was not ready: {}", e.into()),
3315 )
3316 })?;
3317 let codec = tonic_prost::ProstCodec::default();
3318 let path = http::uri::PathAndQuery::from_static(
3319 "/android.emulation.control.EmulatorController/getVmState",
3320 );
3321 let mut req = request.into_request();
3322 req.extensions_mut()
3323 .insert(
3324 GrpcMethod::new(
3325 "android.emulation.control.EmulatorController",
3326 "getVmState",
3327 ),
3328 );
3329 self.inner.unary(req, path, codec).await
3330 }
3331 /// Atomically changes the current multi-display configuration.
3332 /// After this call the given display configurations will be activated. You
3333 /// can only update secondary displays. Displays with id 0 will be ignored.
3334 ///
3335 /// This call can result in the removal or addition of secondary displays,
3336 /// the final display state can be observed by the returned configuration.
3337 ///
3338 /// The following gRPC error codes can be returned:
3339 ///
3340 /// * FAILED_PRECONDITION (code 9) if the AVD does not support a
3341 /// configurable
3342 /// secondary display.
3343 /// * INVALID_ARGUMENT (code 3) if:
3344 /// * The same display id is defined multiple times.
3345 /// * The display configurations are outside valid ranges.
3346 /// See DisplayConfiguration for details on valid ranges.
3347 /// * INTERNAL (code 13) if there was an internal emulator failure.
3348 pub async fn set_display_configurations(
3349 &mut self,
3350 request: impl tonic::IntoRequest<super::DisplayConfigurations>,
3351 ) -> std::result::Result<
3352 tonic::Response<super::DisplayConfigurations>,
3353 tonic::Status,
3354 > {
3355 self.inner
3356 .ready()
3357 .await
3358 .map_err(|e| {
3359 tonic::Status::unknown(
3360 format!("Service was not ready: {}", e.into()),
3361 )
3362 })?;
3363 let codec = tonic_prost::ProstCodec::default();
3364 let path = http::uri::PathAndQuery::from_static(
3365 "/android.emulation.control.EmulatorController/setDisplayConfigurations",
3366 );
3367 let mut req = request.into_request();
3368 req.extensions_mut()
3369 .insert(
3370 GrpcMethod::new(
3371 "android.emulation.control.EmulatorController",
3372 "setDisplayConfigurations",
3373 ),
3374 );
3375 self.inner.unary(req, path, codec).await
3376 }
3377 /// Returns all currently valid logical displays.
3378 ///
3379 /// The gRPC error code FAILED_PRECONDITION (code 9) is returned if the AVD
3380 /// does not support a configurable secondary display.
3381 pub async fn get_display_configurations(
3382 &mut self,
3383 request: impl tonic::IntoRequest<()>,
3384 ) -> std::result::Result<
3385 tonic::Response<super::DisplayConfigurations>,
3386 tonic::Status,
3387 > {
3388 self.inner
3389 .ready()
3390 .await
3391 .map_err(|e| {
3392 tonic::Status::unknown(
3393 format!("Service was not ready: {}", e.into()),
3394 )
3395 })?;
3396 let codec = tonic_prost::ProstCodec::default();
3397 let path = http::uri::PathAndQuery::from_static(
3398 "/android.emulation.control.EmulatorController/getDisplayConfigurations",
3399 );
3400 let mut req = request.into_request();
3401 req.extensions_mut()
3402 .insert(
3403 GrpcMethod::new(
3404 "android.emulation.control.EmulatorController",
3405 "getDisplayConfigurations",
3406 ),
3407 );
3408 self.inner.unary(req, path, codec).await
3409 }
3410 /// Notifies client of the following changes:
3411 ///
3412 /// * Virtual scene camera status change.
3413 /// * Display configuration changes from extended ui. This will only be fired
3414 /// if the user makes modifications the extended displays through the
3415 /// extended control tab.
3416 ///
3417 /// Note that this method will send the initial virtual scene state
3418 /// immediately.
3419 pub async fn stream_notification(
3420 &mut self,
3421 request: impl tonic::IntoRequest<()>,
3422 ) -> std::result::Result<
3423 tonic::Response<tonic::codec::Streaming<super::Notification>>,
3424 tonic::Status,
3425 > {
3426 self.inner
3427 .ready()
3428 .await
3429 .map_err(|e| {
3430 tonic::Status::unknown(
3431 format!("Service was not ready: {}", e.into()),
3432 )
3433 })?;
3434 let codec = tonic_prost::ProstCodec::default();
3435 let path = http::uri::PathAndQuery::from_static(
3436 "/android.emulation.control.EmulatorController/streamNotification",
3437 );
3438 let mut req = request.into_request();
3439 req.extensions_mut()
3440 .insert(
3441 GrpcMethod::new(
3442 "android.emulation.control.EmulatorController",
3443 "streamNotification",
3444 ),
3445 );
3446 self.inner.server_streaming(req, path, codec).await
3447 }
3448 /// Rotation angles are relative to the camera's current orientation.
3449 /// The coordinate system is right-handed and is defined as follows:
3450 /// x axis is pointing right
3451 /// y axis is pointing up
3452 /// z axis is pointing towards the viewer
3453 /// The z component of rotation is not used when calling this method.
3454 pub async fn rotate_virtual_scene_camera(
3455 &mut self,
3456 request: impl tonic::IntoRequest<super::RotationRadian>,
3457 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3458 self.inner
3459 .ready()
3460 .await
3461 .map_err(|e| {
3462 tonic::Status::unknown(
3463 format!("Service was not ready: {}", e.into()),
3464 )
3465 })?;
3466 let codec = tonic_prost::ProstCodec::default();
3467 let path = http::uri::PathAndQuery::from_static(
3468 "/android.emulation.control.EmulatorController/rotateVirtualSceneCamera",
3469 );
3470 let mut req = request.into_request();
3471 req.extensions_mut()
3472 .insert(
3473 GrpcMethod::new(
3474 "android.emulation.control.EmulatorController",
3475 "rotateVirtualSceneCamera",
3476 ),
3477 );
3478 self.inner.unary(req, path, codec).await
3479 }
3480 /// Velocity is absolute and is measured in meters per second.
3481 /// The coordinate system is right-handed and is defined as follows:
3482 /// x axis is pointing right
3483 /// y axis is pointing up
3484 /// z axis is pointing towards the viewer
3485 pub async fn set_virtual_scene_camera_velocity(
3486 &mut self,
3487 request: impl tonic::IntoRequest<super::Velocity>,
3488 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3489 self.inner
3490 .ready()
3491 .await
3492 .map_err(|e| {
3493 tonic::Status::unknown(
3494 format!("Service was not ready: {}", e.into()),
3495 )
3496 })?;
3497 let codec = tonic_prost::ProstCodec::default();
3498 let path = http::uri::PathAndQuery::from_static(
3499 "/android.emulation.control.EmulatorController/setVirtualSceneCameraVelocity",
3500 );
3501 let mut req = request.into_request();
3502 req.extensions_mut()
3503 .insert(
3504 GrpcMethod::new(
3505 "android.emulation.control.EmulatorController",
3506 "setVirtualSceneCameraVelocity",
3507 ),
3508 );
3509 self.inner.unary(req, path, codec).await
3510 }
3511 /// Set foldable posture
3512 pub async fn set_posture(
3513 &mut self,
3514 request: impl tonic::IntoRequest<super::Posture>,
3515 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3516 self.inner
3517 .ready()
3518 .await
3519 .map_err(|e| {
3520 tonic::Status::unknown(
3521 format!("Service was not ready: {}", e.into()),
3522 )
3523 })?;
3524 let codec = tonic_prost::ProstCodec::default();
3525 let path = http::uri::PathAndQuery::from_static(
3526 "/android.emulation.control.EmulatorController/setPosture",
3527 );
3528 let mut req = request.into_request();
3529 req.extensions_mut()
3530 .insert(
3531 GrpcMethod::new(
3532 "android.emulation.control.EmulatorController",
3533 "setPosture",
3534 ),
3535 );
3536 self.inner.unary(req, path, codec).await
3537 }
3538 /// Get the backlight brightness.
3539 /// The following gRPC error codes can be returned:
3540 ///
3541 /// * FAILED_PRECONDITION (code 9) if the AVD does not support hw-control.
3542 pub async fn get_brightness(
3543 &mut self,
3544 request: impl tonic::IntoRequest<super::BrightnessValue>,
3545 ) -> std::result::Result<
3546 tonic::Response<super::BrightnessValue>,
3547 tonic::Status,
3548 > {
3549 self.inner
3550 .ready()
3551 .await
3552 .map_err(|e| {
3553 tonic::Status::unknown(
3554 format!("Service was not ready: {}", e.into()),
3555 )
3556 })?;
3557 let codec = tonic_prost::ProstCodec::default();
3558 let path = http::uri::PathAndQuery::from_static(
3559 "/android.emulation.control.EmulatorController/getBrightness",
3560 );
3561 let mut req = request.into_request();
3562 req.extensions_mut()
3563 .insert(
3564 GrpcMethod::new(
3565 "android.emulation.control.EmulatorController",
3566 "getBrightness",
3567 ),
3568 );
3569 self.inner.unary(req, path, codec).await
3570 }
3571 /// Set the backlight brightness.
3572 /// The following gRPC error codes can be returned:
3573 ///
3574 /// * FAILED_PRECONDITION (code 9) if the AVD does not support hw-control.
3575 /// * INVALID_ARGUMENT (code 3) The brightness exceeds the valid range.
3576 pub async fn set_brightness(
3577 &mut self,
3578 request: impl tonic::IntoRequest<super::BrightnessValue>,
3579 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3580 self.inner
3581 .ready()
3582 .await
3583 .map_err(|e| {
3584 tonic::Status::unknown(
3585 format!("Service was not ready: {}", e.into()),
3586 )
3587 })?;
3588 let codec = tonic_prost::ProstCodec::default();
3589 let path = http::uri::PathAndQuery::from_static(
3590 "/android.emulation.control.EmulatorController/setBrightness",
3591 );
3592 let mut req = request.into_request();
3593 req.extensions_mut()
3594 .insert(
3595 GrpcMethod::new(
3596 "android.emulation.control.EmulatorController",
3597 "setBrightness",
3598 ),
3599 );
3600 self.inner.unary(req, path, codec).await
3601 }
3602 /// Returns the current mode of the primary display of a resizable AVD.
3603 /// The following gRPC error codes can be returned:
3604 ///
3605 /// * FAILED_PRECONDITION (code 9) if the AVD is not resizable.
3606 pub async fn get_display_mode(
3607 &mut self,
3608 request: impl tonic::IntoRequest<()>,
3609 ) -> std::result::Result<tonic::Response<super::DisplayMode>, tonic::Status> {
3610 self.inner
3611 .ready()
3612 .await
3613 .map_err(|e| {
3614 tonic::Status::unknown(
3615 format!("Service was not ready: {}", e.into()),
3616 )
3617 })?;
3618 let codec = tonic_prost::ProstCodec::default();
3619 let path = http::uri::PathAndQuery::from_static(
3620 "/android.emulation.control.EmulatorController/getDisplayMode",
3621 );
3622 let mut req = request.into_request();
3623 req.extensions_mut()
3624 .insert(
3625 GrpcMethod::new(
3626 "android.emulation.control.EmulatorController",
3627 "getDisplayMode",
3628 ),
3629 );
3630 self.inner.unary(req, path, codec).await
3631 }
3632 /// Sets the size of the primary display of a resizable AVD. Fails if the AVD
3633 /// is not resizable. The following gRPC error codes can be returned:
3634 ///
3635 /// * FAILED_PRECONDITION (code 9) if the AVD is not resizable.
3636 pub async fn set_display_mode(
3637 &mut self,
3638 request: impl tonic::IntoRequest<super::DisplayMode>,
3639 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
3640 self.inner
3641 .ready()
3642 .await
3643 .map_err(|e| {
3644 tonic::Status::unknown(
3645 format!("Service was not ready: {}", e.into()),
3646 )
3647 })?;
3648 let codec = tonic_prost::ProstCodec::default();
3649 let path = http::uri::PathAndQuery::from_static(
3650 "/android.emulation.control.EmulatorController/setDisplayMode",
3651 );
3652 let mut req = request.into_request();
3653 req.extensions_mut()
3654 .insert(
3655 GrpcMethod::new(
3656 "android.emulation.control.EmulatorController",
3657 "setDisplayMode",
3658 ),
3659 );
3660 self.inner.unary(req, path, codec).await
3661 }
3662 }
3663}