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