summaryrefslogtreecommitdiff
path: root/stats/atoms.proto
blob: 8217eb14a88fbabe299a78a3361556a2a29876eb (plain)
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
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

package android.os.statsd;

option optimize_for = CODE_SIZE;
option java_package = "com.android.os";
option java_outer_classname = "AtomsProto";

import "frameworks/proto_logging/stats/attribution_node.proto";
import "frameworks/proto_logging/stats/atoms/adpf/adpf_atoms.proto";
import "frameworks/proto_logging/stats/atoms/agif/agif_atoms.proto";
import "frameworks/proto_logging/stats/atoms/corenetworking/connectivity/connectivity_atoms.proto";
import "frameworks/proto_logging/stats/atoms/display/display_atoms.proto";
import "frameworks/proto_logging/stats/atoms/dnd/dnd_atoms.proto";
import "frameworks/proto_logging/stats/atoms/gps/gps_atoms.proto";
import "frameworks/proto_logging/stats/atoms/grammaticalinflection/grammatical_inflection.proto";
import "frameworks/proto_logging/stats/atoms/hardware/biometrics/biometrics_atoms.proto";
import "frameworks/proto_logging/stats/atoms/hotword/hotword_atoms.proto";
import "frameworks/proto_logging/stats/atoms/input/input_atoms.proto";
import "frameworks/proto_logging/stats/atoms/kernel/kernel_atoms.proto";
import "frameworks/proto_logging/stats/atoms/locale/locale_atoms.proto";
import "frameworks/proto_logging/stats/atoms/location/location_atoms.proto";
import "frameworks/proto_logging/stats/atoms/media/media_drm_atoms.proto";
import "frameworks/proto_logging/stats/atoms/wearsysui/wearsysui_atoms.proto";
import "frameworks/proto_logging/stats/atoms/providers/mediaprovider/media_provider_atoms.proto";
import "frameworks/proto_logging/stats/atoms/sysui/sysui_atoms.proto";
import "frameworks/proto_logging/stats/atoms/usb/usb_atoms.proto";
import "frameworks/proto_logging/stats/atoms/view/inputmethod/inputmethod_atoms.proto";
import "frameworks/proto_logging/stats/atom_field_options.proto";
import "frameworks/proto_logging/stats/enums/adservices/fledge/enums.proto";
import "frameworks/proto_logging/stats/enums/adservices/measurement/enums.proto";
import "frameworks/proto_logging/stats/enums/anr/enums.proto";
import "frameworks/proto_logging/stats/enums/app/enums.proto";
import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
import "frameworks/proto_logging/stats/enums/app/remoteprovisioner_enums.proto";
import "frameworks/proto_logging/stats/enums/app/settings_enums.proto";
import "frameworks/proto_logging/stats/enums/app/wearservices/wearservices_enums.proto";
import "frameworks/proto_logging/stats/enums/app/tvsettings_enums.proto";
import "frameworks/proto_logging/stats/enums/app/wearsettings_enums.proto";
import "frameworks/proto_logging/stats/enums/autofill/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/hci/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/hfp/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/leaudio/enums.proto";
import "frameworks/proto_logging/stats/enums/bluetooth/smp/enums.proto";
import "frameworks/proto_logging/stats/enums/contexthub/enums.proto";
import "frameworks/proto_logging/stats/enums/debug/enums.proto";
import "frameworks/proto_logging/stats/enums/display/enums.proto";
import "frameworks/proto_logging/stats/enums/hardware/biometrics/enums.proto";
import "frameworks/proto_logging/stats/enums/jank/enums.proto";
import "frameworks/proto_logging/stats/enums/media/audio/enums.proto";
import "frameworks/proto_logging/stats/enums/media/midi/enums.proto";
import "frameworks/proto_logging/stats/enums/media/outputswitcher/enums.proto";
import "frameworks/proto_logging/stats/enums/media/enums.proto";
import "frameworks/proto_logging/stats/enums/mms/enums.proto";
import "frameworks/proto_logging/stats/enums/nearby/enums.proto";
import "frameworks/proto_logging/stats/enums/net/enums.proto";
import "frameworks/proto_logging/stats/enums/neuralnetworks/enums.proto";
import "frameworks/proto_logging/stats/enums/nfc/enums.proto";
import "frameworks/proto_logging/stats/enums/os/enums.proto";
import "frameworks/proto_logging/stats/enums/server/connectivity/data_stall_event.proto";
import "frameworks/proto_logging/stats/enums/server/display/enums.proto";
import "frameworks/proto_logging/stats/enums/server/enums.proto";
import "frameworks/proto_logging/stats/enums/server/job/enums.proto";
import "frameworks/proto_logging/stats/enums/server/location/enums.proto";
import "frameworks/proto_logging/stats/enums/service/enums.proto";
import "frameworks/proto_logging/stats/enums/service/procstats_enum.proto";
import "frameworks/proto_logging/stats/enums/stats/connectivity/connectivity_service.proto";
import "frameworks/proto_logging/stats/enums/stats/connectivity/network_stack.proto";
import "frameworks/proto_logging/stats/enums/stats/connectivity/tethering.proto";
import "frameworks/proto_logging/stats/enums/stats/dnsresolver/dns_resolver.proto";
import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy.proto";
import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/docsui/docsui_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/hdmi/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/intelligence/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/location/location_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
import "frameworks/proto_logging/stats/enums/stats/mediaprovider/mediaprovider_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/mobiledatadownload/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/privacysignals/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/safetycenter/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/storage/storage_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/style/style_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/sysui/notification_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/tls/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/tv/tif_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/wm/enums.proto";
import "frameworks/proto_logging/stats/enums/system/security/keystore2/enums.proto";
import "frameworks/proto_logging/stats/enums/telecomm/enums.proto";
import "frameworks/proto_logging/stats/enums/telephony/enums.proto";
import "frameworks/proto_logging/stats/enums/transparency/enums.proto";
import "frameworks/proto_logging/stats/enums/uwb/enums.proto";
import "frameworks/proto_logging/stats/enums/view/enums.proto";
import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
import "frameworks/proto_logging/stats/enums/stats/textclassifier/textclassifier_enums.proto";
import "frameworks/proto_logging/stats/enums/stats/otaupdate/updateengine_enums.proto";
import "frameworks/proto_logging/stats/message/mediametrics_message.proto";
import "frameworks/proto_logging/stats/atoms/devicelogs/device_logs_atoms.proto";
import "frameworks/proto_logging/stats/atoms/wearservices/wearservices_atoms.proto";
import "frameworks/proto_logging/stats/atoms/wear/media/wear_media_atoms.proto";

/**
 * The primary atom class. This message defines all of the available
 * raw stats log events from the Android system, also known as "atoms."
 *
 * This field contains a single oneof with all of the available messages.
 * The stats-log-api-gen tool runs as part of the Android build and
 * generates the android.util.StatsLog class, which contains the constants
 * and methods that Android uses to log.
 *
 * This Atom class is not actually built into the Android system.
 * Instead, statsd on Android constructs these messages synthetically,
 * in the format defined here and in stats_log.proto.
 */
message Atom {
    // Pushed atoms start at 2.
    oneof pushed {
        // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
        BleScanStateChanged ble_scan_state_changed = 2
                [(module) = "bluetooth", (module) = "statsdtest"];
        ProcessStateChanged process_state_changed = 3 [(module) = "framework", deprecated = true];
        BleScanResultReceived ble_scan_result_received = 4
            [(module) = "bluetooth", (module) = "statsdtest"];
        SensorStateChanged sensor_state_changed =
                5 [(module) = "framework", (module) = "statsdtest"];
        gps.GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
        SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
        ScheduledJobStateChanged scheduled_job_state_changed =
                8 [(module) = "framework", (module) = "statsdtest"];
        ScreenBrightnessChanged screen_brightness_changed =
                9 [(module) = "framework", (module) = "statsdtest"];
        WakelockStateChanged wakelock_state_changed =
                10 [(module) = "framework", (module) = "statsdtest"];
        LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
                11 [(module) = "framework"];
        MobileRadioPowerStateChanged mobile_radio_power_state_changed =
                12 [(module) = "framework", (truncate_timestamp) = true];
        WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
        ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
                14 [(module) = "framework"];
        MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
        ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
        CachedKillReported cached_kill_reported = 17 [(module) = "framework", deprecated = true];
        ProcessMemoryStatReported process_memory_stat_reported =
                18 [(module) = "framework", deprecated = true];
        sysui.LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
        BatterySaverModeStateChanged battery_saver_mode_state_changed =
                20 [(module) = "framework", (module) = "statsdtest"];
        DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
        DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
        AudioStateChanged audio_state_changed =
                23 [(module) = "framework", (truncate_timestamp) = true];
        MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
        CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
        FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
        UidProcessStateChanged uid_process_state_changed =
                27 [(module) = "framework", (module) = "statsdtest"];
        ProcessLifeCycleStateChanged process_life_cycle_state_changed =
                28 [(module) = "framework", (module) = "statsdtest"];
        ScreenStateChanged screen_state_changed =
                29 [(module) = "framework", (module) = "statsdtest"];
        BatteryLevelChanged battery_level_changed =
                30 [(module) = "framework", (module) = "statsdtest"];
        ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
        PluggedStateChanged plugged_state_changed = 32
                [(module) = "framework", (module) = "statsdtest"];
        InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
        input.TouchEventReported touch_event_reported = 34;
        WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
        KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
        WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
        WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
        WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
        PhoneSignalStrengthChanged phone_signal_strength_changed =
                40 [(module) = "framework", (module) = "statsdtest", (truncate_timestamp) = true];
        SettingChanged setting_changed = 41 [(module) = "framework"];
        ActivityForegroundStateChanged activity_foreground_state_changed =
                42 [(module) = "framework", (module) = "statsdtest"];
        IsolatedUidChanged isolated_uid_changed =
                43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
        PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
        WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
        AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
        AppBreadcrumbReported app_breadcrumb_reported = 47 [(module) = "statsd"];
        AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
        AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
        AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
        LmkKillOccurred lmk_kill_occurred = 51 [(module) = "framework"];
        PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
        WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
        LmkStateChanged lmk_state_changed = 54 [(module) = "framework"];
        AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
        ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
        BootSequenceReported boot_sequence_reported = 57;
        OverlayStateChanged overlay_state_changed =
                59 [(module) = "framework", (module) = "statsdtest"];
        ForegroundServiceStateChanged foreground_service_state_changed
                = 60 [(module) = "framework"];
        CallStateChanged call_state_changed =
                61 [(module) = "telecom", (truncate_timestamp) = true];
        sysui.KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
        sysui.KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
        sysui.KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered =
                64 [(module) = "sysui"];
        AppDied app_died = 65 [(module) = "framework"];
        ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
        BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "bluetooth"];
        BluetoothConnectionStateChanged bluetooth_connection_state_changed =
                68 [(module) = "bluetooth"];
        GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
        UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
        SpeakerImpedanceReported speaker_impedance_reported = 71;
        HardwareFailed hardware_failed = 72;
        PhysicalDropDetected physical_drop_detected = 73;
        ChargeCyclesReported charge_cycles_reported = 74;
        MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
        MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
        UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
        AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
        ANROccurred anr_occurred = 79 [(module) = "framework"];
        WTFOccurred wtf_occurred = 80 [(module) = "framework"];
        LowMemReported low_mem_reported = 81 [(module) = "framework"];
        GenericAtom generic_atom = 82;
        VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
        DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
        ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
        BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
        BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
        BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
        UiEventReported ui_event_reported = 90 [
            (module) = "framework",
            (module) = "sysui",
            (module) = "mediaprovider"
        ];
        BatteryHealthSnapshot battery_health_snapshot = 91;
        SlowIo slow_io = 92;
        BatteryCausedShutdown battery_caused_shutdown = 93;
        PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
        PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
        UserRestrictionChanged user_restriction_changed = 96;
        SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
        ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
        // TODO: service state change is very noisy shortly after boot, as well
        // as at other transitions - coming out of doze, device plugged in, etc.
        // Consider removing this if it becomes a problem
        ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
        ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
        FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
        BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
        DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
        DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
        DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
            105 [(module) = "docsui"];
        DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
        DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
        DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
            108 [(module) = "docsui"];
        DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
        DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
        DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
        DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
        WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
        WifiRunningStateChanged wifi_running_state_changed = 114
                [(module) = "framework", deprecated = true];
        AppCompacted app_compacted = 115 [(module) = "framework", deprecated = true];
        NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
        DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
            117 [(module) = "docsui"];
        DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
        DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
        DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
        DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
        RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
        SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
        GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
        BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
                125 [(module) = "bluetooth"];
        BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
                126 [(module) = "bluetooth"];
        BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
                127 [(module) = "bluetooth"];
        AppDowngraded app_downgraded = 128 [(module) = "framework"];
        AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
        LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
        GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
        GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
        UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
        NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
        NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
        NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
        NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
        NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
        NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
        SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
        SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
        BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
                142 [(module) = "framework"];
        AttentionManagerServiceResultReported attention_manager_service_result_reported =
                143 [(module) = "framework"];
        AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
        SpeechDspStatReported speech_dsp_stat_reported = 145;
        UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
        WatchdogRollbackOccurred watchdog_rollback_occurred =
                147 [(module) = "framework", (module) = "statsd"];
        BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
                148 [(module) = "framework"];
        BubbleUIChanged bubble_ui_changed = 149 [(module) = "framework"];
        ScheduledJobConstraintChanged scheduled_job_constraint_changed =
                150 [(module) = "framework"];
        BluetoothActiveDeviceChanged bluetooth_active_device_changed =
                151 [(module) = "bluetooth"];
        BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
                152 [(module) = "bluetooth"];
        BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
                153 [(module) = "bluetooth"];
        BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
                154 [(module) = "bluetooth"];
        BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
                155 [(module) = "bluetooth"];
        BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
                156 [(module) = "bluetooth"];
        BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
                157 [(module) = "bluetooth"];
        BluetoothDeviceFailedContactCounterReported
                bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
        BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
                159 [(module) = "bluetooth"];
        BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
                160 [(module) = "bluetooth"];
        BluetoothQualityReportReported bluetooth_quality_report_reported =
                161 [(module) = "bluetooth"];
        BluetoothDeviceInfoReported bluetooth_device_info_reported =
                162 [(module) = "bluetooth"];
        BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
                163 [(module) = "bluetooth"];
        BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
                164 [(module) = "bluetooth"];
        BluetoothBondStateChanged bluetooth_bond_state_changed =
                165 [(module) = "bluetooth"];
        BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
                166 [(module) = "bluetooth"];
        BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
                167 [(module) = "bluetooth"];
        ScreenTimeoutExtensionReported screen_timeout_extension_reported =
                168 [(module) = "framework"];
        ProcessStartTime process_start_time = 169 [(module) = "framework"];
        PermissionGrantRequestResultReported permission_grant_request_result_reported =
                170 [(module) = "permissioncontroller"];
        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed =
                171 [(module) = "bluetooth"];
        DeviceIdentifierAccessDenied device_identifier_access_denied =
                172 [(module) = "telephony_common"];
        BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
        sysui.AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
        sysui.AssistGestureFeedbackReported assist_gesture_feedback_reported =
                175 [(module) = "sysui"];
        sysui.AssistGestureProgressReported assist_gesture_progress_reported =
                176 [(module) = "sysui"];
        input.TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
        HiddenApiUsed hidden_api_used = 178 [(module) = "framework"];
        StyleUIChanged style_ui_changed = 179 [(module) = "sysui", (module) = "wallpaper"];
        PrivacyIndicatorsInteracted privacy_indicators_interacted =
                180 [(module) = "permissioncontroller"];
        AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
                181 [(module) = "framework"];
        NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
        AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
        BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
        TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
                187 [(module) = "bluetooth"];
        IntelligenceEventReported intelligence_event_reported =
                188 [(module) = "intelligence"];
        ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
                189 [(module) = "framework"];
        RoleRequestResultReported role_request_result_reported =
                190 [(module) = "permissioncontroller"];
        MediametricsAudiopolicyReported mediametrics_audiopolicy_reported =
                191 [(module) = "media_metrics"];
        MediametricsAudiorecordReported mediametrics_audiorecord_reported =
                192[(module) = "media_metrics"];
        MediametricsAudiothreadReported mediametrics_audiothread_reported =
                193 [(module) = "media_metrics"];
        MediametricsAudiotrackReported mediametrics_audiotrack_reported =
                194 [(module) = "media_metrics"];
        MediametricsCodecReported mediametrics_codec_reported =
                195 [(module) = "media_metrics"];
        MediametricsDrmWidevineReported mediametrics_drm_widevine_reported =
                196 [(module) = "media_metrics"];
        MediametricsExtractorReported mediametrics_extractor_reported =
                197 [(module) = "media_metrics"];
        MediametricsMediadrmReported mediametrics_mediadrm_reported =
                198 [(module) = "media_metrics"];
        MediametricsNuPlayerReported mediametrics_nuplayer_reported =
                199 [(module) = "media_metrics"];
        MediametricsRecorderReported mediametrics_recorder_reported =
                200 [(module) = "media_metrics"];
        MediametricsDrmManagerReported mediametrics_drmmanager_reported =
                201 [(module) = "media_metrics"];
        CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
        GarageModeInfo garage_mode_info = 204 [(module) = "car"];
        TestAtomReported test_atom_reported = 205
            [(module) = "cts", (module) = "statsdtest"];
        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
                206 [(module) = "framework"];
        ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
        ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
        ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
        LocationManagerApiUsageReported location_manager_api_usage_reported =
                210 [(module) = "framework"];
        ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
                211 [(module) = "permissioncontroller"];
        RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
                212 [(module) = "permissioncontroller"];
        GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
                213 [(module) = "permissioncontroller"];
        LocationAccessCheckNotificationAction location_access_check_notification_action =
                214 [(module) = "permissioncontroller"];
        AppPermissionFragmentActionReported app_permission_fragment_action_reported =
                215 [(module) = "permissioncontroller"];
        AppPermissionFragmentViewed app_permission_fragment_viewed =
                216 [(module) = "permissioncontroller"];
        AppPermissionsFragmentViewed app_permissions_fragment_viewed =
                217 [(module) = "permissioncontroller"];
        PermissionAppsFragmentViewed permission_apps_fragment_viewed =
                218  [(module) = "permissioncontroller"];
        TextSelectionEvent text_selection_event = 219  [(module) = "textclassifier"];
        TextLinkifyEvent text_linkify_event = 220  [(module) = "textclassifier"];
        ConversationActionsEvent conversation_actions_event = 221  [(module) = "textclassifier"];
        LanguageDetectionEvent language_detection_event = 222  [(module) = "textclassifier"];
        ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
        sysui.BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
        UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported =
                225 [(module) = "update_engine"];
        UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported =
                226 [(module) = "update_engine"];
        CameraActionEvent camera_action_event = 227 [(module) = "framework"];
        AppCompatibilityChangeReported app_compatibility_change_reported =
                228 [(module) = "framework"];
        PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
        VmsClientConnectionStateChanged vms_client_connection_state_changed =
                230 [(module) = "car"];
        MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
        MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
        MediaProviderPermissionRequested media_provider_permission_requested =
            235 [(module) = "mediaprovider"];
        MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
        MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
            237 [(module) = "mediaprovider"];
        RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
        BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
        BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
                240 [(module) = "framework"];
        BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
        BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
        UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
        NotificationReported notification_reported = 244 [(module) = "framework"];
        sysui.NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
        NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
        IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
        IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
        CellBroadcastMessageReported cb_message_reported =
            249 [(module) = "cellbroadcast"];
        CellBroadcastMessageError cb_message_error =
            250 [(module) = "cellbroadcast"];
        WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
        WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
        WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
        AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
        SnapshotMergeReported snapshot_merge_reported =
            255 [(module) = "update_engine"];
        ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
            256  [(module) = "framework"];
        // DisplayJankReported was deprecated in Android 12+
        DisplayJankReported display_jank_reported = 257 [deprecated = true];
        AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
        SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
        RankingSelected ranking_selected = 260 [
            (module) = "framework",
            (module) = "sysui",
            (module) = "mediaprovider"
        ];
        TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
        sysui.LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
        PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
        UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
        UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
        AccessibilityShortcutReported accessibility_shortcut_reported =
            266 [(module) = "framework"];
        AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
        DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
        AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
        AutoRevokeNotificationClicked auto_revoke_notification_clicked =
            270 [(module) = "permissioncontroller"];
        AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
            271 [(module) = "permissioncontroller"];
        AutoRevokedAppInteraction auto_revoked_app_interaction =
            272 [(module) = "permissioncontroller", (module) = "settings"];
        AppPermissionGroupsFragmentAutoRevokeAction
            app_permission_groups_fragment_auto_revoke_action =
            273 [(module) = "permissioncontroller"];
        EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
        AudioPowerUsageDataReported audio_power_usage_data_reported =
            275 [(module) = "media_metrics"];
        TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
        sysui.MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
            277 [(module) = "sysui"];
        CellBroadcastMessageFiltered cb_message_filtered =
            278 [(module) = "cellbroadcast"];
        TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
        TvCasSessionOpenStatus tv_cas_session_open_status =
            280 [(module) = "framework"];
        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
        DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
        CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
            283 [(module) = "car"];
        CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
            284 [(module) = "car"];
        CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
            285 [(module) = "car"];
        CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
            286 [(module) = "car"];
        CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
            287 [(module) = "car"];
        CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
            288 [(module) = "car"];
        CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
            289 [(module) = "car"];
        NetworkIpProvisioningReported network_ip_provisioning_reported =
            290 [(module) = "network_stack"];
        NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
        NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
        NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
        MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
            294 [(module) = "media_metrics"];
        MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
            295 [(module) = "media_metrics"];
        MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
            296 [(module) = "media_metrics"];
        MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
            297 [(module) = "media_metrics"];
        BlobCommitted blob_committed = 298 [(module) = "framework"];
        BlobLeased blob_leased = 299 [(module) = "framework"];
        BlobOpened blob_opened = 300 [(module) = "framework"];
        ContactsProviderStatusReported contacts_provider_status_reported = 301;
        KeystoreKeyEventReported keystore_key_event_reported = 302;
        NetworkTetheringReported  network_tethering_reported =
            303 [(module) = "network_tethering"];
        sysui.ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
        UIInteractionFrameInfoReported ui_interaction_frame_info_reported =
            305 [(module) = "framework"];
        UIActionLatencyReported ui_action_latency_reported = 306 [(module) = "framework"];
        WifiDisconnectReported wifi_disconnect_reported = 307 [(module) = "wifi"];
        WifiConnectionStateChanged wifi_connection_state_changed = 308 [(module) = "wifi"];
        HdmiCecActiveSourceChanged hdmi_cec_active_source_changed = 309 [(module) = "framework"];
        HdmiCecMessageReported hdmi_cec_message_reported = 310 [(module) = "framework"];
        AirplaneMode airplane_mode = 311 [(module) = "telephony"];
        ModemRestart modem_restart = 312 [(module) = "telephony"];
        CarrierIdMismatchReported carrier_id_mismatch_reported = 313 [(module) = "telephony"];
        CarrierIdTableUpdated carrier_id_table_updated = 314 [(module) = "telephony"];
        DataStallRecoveryReported data_stall_recovery_reported = 315 [(module) = "telephony"];
        MediametricsMediaParserReported mediametrics_mediaparser_reported =
                316 [(module) = "media_metrics"];
        TlsHandshakeReported tls_handshake_reported = 317 [(module) = "conscrypt"];
        TextClassifierApiUsageReported text_classifier_api_usage_reported = 318  [(module) = "textclassifier"];
        CarWatchdogKillStatsReported car_watchdog_kill_stats_reported = 319 [(module) = "car"];
        MediametricsPlaybackReported mediametrics_playback_reported = 320 [(module) = "media_metrics"];
        MediaNetworkInfoChanged media_network_info_changed = 321 [(module) = "media_metrics"];
        MediaPlaybackStateChanged media_playback_state_changed = 322 [(module) = "media_metrics"];
        MediaPlaybackErrorReported media_playback_error_reported = 323 [(module) = "media_metrics"];
        MediaPlaybackTrackChanged media_playback_track_changed = 324 [(module) = "media_metrics"];
        WifiScanReported wifi_scan_reported = 325 [(module) = "wifi"];
        WifiPnoScanReported wifi_pno_scan_reported = 326  [(module) = "wifi"];
        TifTuneStateChanged tif_tune_changed = 327 [(module) = "framework"];
        AutoRotateReported auto_rotate_reported = 328 [(module) = "framework"];
        PerfettoTrigger perfetto_trigger = 329 [(module) = "perfetto"];
        TranscodingData transcoding_data = 330 [(module) = "mediaprovider"];
        ImsServiceEntitlementUpdated ims_service_entitlement_updated = 331 [(module) = "imsentitlement"];
        DeviceRotated device_rotated = 333 [(module) = "framework"];
        SimSpecificSettingsRestored sim_specific_settings_restored = 334
            [(module) = "telephony"];
        TextClassifierDownloadReported text_classifier_download_reported = 335 [(module) = "textclassifier"];
        PinStorageEvent pin_storage_event = 336 [(module) = "telephony"];
        FaceDownReported face_down_reported = 337 [(module) = "framework"];
        BluetoothHALCrashReasonReported bluetooth_hal_crash_reason_reported =
            338 [(module) = "bluetooth"];
        RebootEscrowPreparationReported reboot_escrow_preparation_reported =
            339 [(module) = "framework"];
        RebootEscrowLskfCaptureReported reboot_escrow_lskf_capture_reported =
            340 [(module) = "framework"];
        RebootEscrowRebootReported reboot_escrow_reboot_reported = 341 [(module) = "framework"];
        BinderLatencyReported binder_latency_reported = 342 [(module) = "framework"];
        MediametricsAAudioStreamReported mediametrics_aaudiostream_reported =
            343 [(module) = "media_metrics"];
        MediaTranscodingSessionEnded media_transcoding_session_ended = 344
            [(module) = "media"];
        MagnificationUsageReported magnification_usage_reported =
            345 [(module) = "framework"];
        MagnificationModeWithImeOnReported magnification_mode_with_ime_on_reported =
            346 [(module) = "framework"];
        AppSearchCallStatsReported app_search_call_stats_reported = 347 [(module) = "appsearch"];
        AppSearchPutDocumentStatsReported app_search_put_document_stats_reported = 348 [(module) = "appsearch"];
        sysui.DeviceControlChanged device_control_changed = 349 [(module) = "sysui"];
        DeviceStateChanged device_state_changed = 350 [(module) = "framework"];
        input.InputDeviceRegistered inputdevice_registered = 351 [(module) = "framework"];
        sysui.SmartSpaceCardReported smartspace_card_reported = 352 [(module) = "sysui"];
        AuthPromptAuthenticateInvoked auth_prompt_authenticate_invoked = 353 [(module) = "framework"];
        AuthManagerCanAuthenticateInvoked auth_manager_can_authenticate_invoked = 354 [(module) = "framework"];
        AuthEnrollActionInvoked auth_enroll_action_invoked = 355 [(module) = "framework"];
        AuthDeprecatedAPIUsed auth_deprecated_api_used = 356 [(module) = "framework"];
        UnattendedRebootOccurred unattended_reboot_occurred = 357 [(module) = "scheduling"];
        LongRebootBlockingReported long_reboot_blocking_reported = 358 [(module) = "scheduling"];
        LocationTimeZoneProviderStateChanged location_time_zone_provider_state_changed =
            359 [(module) = "framework"];
        // 360-363 are reserved.
        FdtrackEventOccurred fdtrack_event_occurred = 364 [(module) = "framework"];
        TimeoutAutoExtendedReported timeout_auto_extended_reported = 365
            [(module) = "framework"];
        AlarmBatchDelivered alarm_batch_delivered = 367 [(module) = "framework"];
        AlarmScheduled alarm_scheduled = 368 [(module) = "framework"];
        CarWatchdogIoOveruseStatsReported car_watchdog_io_overuse_stats_reported = 369 [(module) = "car"];
        UserLevelHibernationStateChanged user_level_hibernation_state_changed = 370 [(module) = "framework"];
        AppSearchInitializeStatsReported app_search_initialize_stats_reported = 371 [(module) = "appsearch"];
        AppSearchQueryStatsReported app_search_query_stats_reported = 372 [(module) = "appsearch"];
        AppProcessDied app_process_died = 373 [(module) = "framework"];
        NetworkIpReachabilityMonitorReported network_ip_reachability_monitor_reported =
            374 [(module) = "network_stack"];
        input.SlowInputEventReported slow_input_event_reported = 375 [(module) = "input"];
        ANROccurredProcessingStarted anr_occurred_processing_started = 376 [(module) = "framework"];
        AppSearchRemoveStatsReported app_search_remove_stats_reported = 377 [(module) = "appsearch"];
        MediaCodecReported media_codec_reported =
            378 [(module) = "framework", (module) = "media_metrics"];
        PermissionUsageFragmentInteraction permission_usage_fragment_interaction = 379 [(module) = "permissioncontroller"];
        PermissionDetailsInteraction permission_details_interaction = 380 [(module) = "permissioncontroller"];
        PrivacySensorToggleInteraction privacy_sensor_toggle_interaction = 381 [(module) = "framework"];
        PrivacyToggleDialogInteraction privacy_toggle_dialog_interaction = 382 [(module) = "framework"];
        AppSearchOptimizeStatsReported app_search_optimize_stats_reported = 383 [(module) = "appsearch"];
        NonA11yToolServiceWarningReported non_a11y_tool_service_warning_report = 384 [(module) = "framework"];
        AppCompatStateChanged app_compat_state_changed = 386 [(module) = "framework"];
        SizeCompatRestartButtonEventReported size_compat_restart_button_event_reported = 387 [(module) = "framework"];
        SplitscreenUIChanged splitscreen_ui_changed = 388 [(module) = "framework"];
        NetworkDnsHandshakeReported network_dns_handshake_reported = 389 [(module) = "resolv"];
        BluetoothCodePathCounter bluetooth_code_path_counter =
            390 [(module) = "bluetooth"];
        BluetoothLeBatchScanReportDelay bluetooth_le_batch_scan_report_delay =
            392 [(module) = "bluetooth"];
        sysui.AccessibilityFloatingMenuUIChanged accessibility_floating_menu_ui_changed =
            393 [(module) = "sysui"];
        NeuralNetworksCompilationCompleted neuralnetworks_compilation_completed = 394
            [(module) = "neuralnetworks"];
        NeuralNetworksExecutionCompleted neuralnetworks_execution_completed = 395
            [(module) = "neuralnetworks"];
        NeuralNetworksCompilationFailed neuralnetworks_compilation_failed = 396
            [(module) = "neuralnetworks"];
        NeuralNetworksExecutionFailed neuralnetworks_execution_failed = 397
            [(module) = "neuralnetworks"];
        ContextHubBooted context_hub_booted = 398 [(module) = "contexthub"];
        ContextHubRestarted context_hub_restarted = 399 [(module) = "contexthub"];
        ContextHubLoadedNanoappSnapshotReported context_hub_loaded_nanoapp_snapshot_reported = 400
            [(module) = "contexthub"];
        ChreCodeDownloadTransacted chre_code_download_transacted = 401 [(module) = "contexthub"];
        UwbSessionInitiated uwb_session_inited = 402 [(module) = "uwb"];
        UwbSessionClosed uwb_session_closed = 403 [(module) = "uwb"];
        UwbFirstRangingReceived uwb_first_ranging_received = 404 [(module) = "uwb"];
        UwbRangingMeasurementReceived uwb_ranging_measurement_received = 405 [(module) = "uwb"];
        TextClassifierDownloadWorkScheduled text_classifier_download_work_scheduled = 406 [(module) = "textclassifier"];
        TextClassifierDownloadWorkCompleted text_classifier_download_work_completed = 407 [(module) = "textclassifier"];
        ClipboardCleared clipboard_cleared = 408 [(module) = "framework"];
        VmCreationRequested vm_creation_requested = 409 [(module) = "virtualizationservice"];
        NearbyDeviceScanStateChanged nearby_device_scan_state_changed = 410 [(module) = "nearby"];
        CameraCompatControlEventReported camera_compat_control_event_reported = 411 [(module) = "framework"];
        ApplicationLocalesChanged application_locales_changed = 412 [(module) = "framework"];
        MediametricsAudioTrackStatusReported mediametrics_audiotrackstatus_reported =
            413 [(module) = "media_metrics"];
        FoldStateDurationReported fold_state_duration_reported = 414 [(module) = "framework"];
        LocationTimeZoneProviderControllerStateChanged location_time_zone_provider_controller_state_changed =
            415 [(module) = "framework"];
        DisplayHbmStateChanged display_hbm_state_changed = 416 [(module) = "framework"];
        DisplayHbmBrightnessChanged display_hbm_brightness_changed = 417 [(module) = "framework"];
        PersistentUriPermissionsFlushed persistent_uri_permissions_flushed =
            418 [(module) = "framework"];
        EarlyBootCompOsArtifactsCheckReported early_boot_comp_os_artifacts_check_reported = 419 [(module) = "art"];
        VBMetaDigestReported vbmeta_digest_reported = 420 [(module) = "framework"];
        ApexInfoGathered apex_info_gathered = 421 [(module) = "framework"];
        PvmInfoGathered pvm_info_gathered = 422 [(module) = "framework"];
        WearSettingsUIInteracted wear_settings_ui_interacted = 423 [(module) = "wear_settings"];
        TracingServiceReportEvent tracing_service_report_event = 424 [(module) = "framework"];
        MediametricsAudioRecordStatusReported mediametrics_audiorecordstatus_reported =
            425 [(module) = "media_metrics"];
        sysui.LauncherLatency launcher_latency = 426 [(module) = "sysui"];
        DropboxEntryDropped dropbox_entry_dropped = 427 [(module) = "framework"];
        WifiP2pConnectionReported wifi_p2p_connection_reported = 428 [(module) = "wifi"];
        GameStateChanged game_state_changed = 429 [(module) = "framework"];
        hotword.HotwordDetectorCreateRequested hotword_detector_create_requested = 430
            [(module) = "framework"];
        hotword.HotwordDetectionServiceInitResultReported hotword_detection_service_init_result_reported = 431
            [(module) = "framework"];
        hotword.HotwordDetectionServiceRestarted hotword_detection_service_restarted = 432
            [(module) = "framework"];
        hotword.HotwordDetectorKeyphraseTriggered hotword_detector_keyphrase_triggered = 433
            [(module) = "framework"];
        hotword.HotwordDetectorEvents hotword_detector_events = 434
            [(module) = "framework"];
        AdServicesApiCalled ad_services_api_called =
            435 [(module) = "adservices", (truncate_timestamp) = true];
        AdServicesMeasurementReportsUploaded ad_services_mesurement_reports_uploaded =
            436 [(module) = "adservices", (truncate_timestamp) = true];
        BootCompletedBroadcastCompletionLatencyReported boot_completed_broadcast_completion_latency_reported =
                437 [(module) = "framework"];
        ContactsIndexerUpdateStatsReported contacts_indexer_update_stats_reported = 440
            [(module) = "appsearch"];
        AppBackgroundRestrictionsInfo app_background_restrictions_info =
            441 [(module) = "framework"];
        MmsSmsProviderGetThreadIdFailed mms_sms_provider_get_thread_id_failed = 442 [(module) = "telephony"];
        MmsSmsDatabaseHelperOnUpgradeFailed mms_sms_database_helper_on_upgrade_failed = 443 [(module) = "telephony"];
        PermissionReminderNotificationInteracted permission_reminder_notification_interacted =
            444 [(module) = "permissioncontroller"];
        RecentPermissionDecisionsInteracted recent_permission_decisions_interacted =
            445 [(module) = "permissioncontroller"];
        GnssPsdsDownloadReported gnss_psds_download_reported = 446 [(module) = "framework"];
        LeAudioConnectionSessionReported le_audio_connection_session_reported = 447 [(module) = "bluetooth"];
        LeAudioBroadcastSessionReported le_audio_broadcast_session_reported = 448 [(module) = "bluetooth"];
        DreamUiEventReported dream_ui_event_reported = 449 [(module) = "framework"];
        sysui.TaskManagerEventReported task_manager_event_reported = 450 [(module) = "sysui"];
        CdmAssociationAction cdm_association_action = 451 [(module) = "framework"];
        MagnificationTripleTapAndHoldActivatedSessionReported magnification_triple_tap_and_hold_activated_session_reported =
            452 [(module) = "framework"];
        MagnificationFollowTypingFocusActivatedSessionReported magnification_follow_typing_focus_activated_session_reported =
            453 [(module) = "framework"];
        AccessibilityTextReadingOptionsChanged accessibility_text_reading_options_changed = 454 [(module) = "settings"];
        WifiSetupFailureCrashReported wifi_setup_failure_crash_reported = 455 [(module) = "wifi"];
        UwbDeviceErrorReported uwb_device_error_reported = 456 [(module) = "uwb"];
        IsolatedCompilationScheduled isolated_compilation_scheduled = 457 [(module) = "art"];
        IsolatedCompilationEnded isolated_compilation_ended = 458 [(module) = "art"];
        OnsOpportunisticEsimProvisioningComplete ons_opportunistic_esim_provisioning_complete = 459 [(module) = "ons"];
        SystemServerPreWatchdogOccurred system_server_pre_watchdog_occurred = 460 [(module) = "framework"];
        TelephonyAnomalyDetected telephony_anomaly_detected = 461 [(module) = "telephony"];
        LetterboxPositionChanged letterbox_position_changed = 462 [(module) = "framework"];
        RemoteKeyProvisioningAttempt remote_key_provisioning_attempt = 463 [(module) = "rkpd"];
        RemoteKeyProvisioningNetworkInfo remote_key_provisioning_network_info = 464 [(module) = "rkpd"];
        RemoteKeyProvisioningTiming remote_key_provisioning_timing = 465 [(module) = "rkpd"];
        sysui.MediaOutputOpInteractionReported mediaoutput_op_interaction_report =
            466 [(module) = "sysui"];
        SyncExemptionOccurred sync_exemption_occurred = 468 [(module) = "framework"];
        AutofillPresentationEventReported autofill_presentation_event_reported = 469 [(module) = "framework"];
        DockStateChanged dock_state_changed = 470 [(module) = "framework"];
        SafetySourceStateCollected safety_source_state_collected = 471 [(module) = "permissioncontroller"];
        SafetyCenterSystemEventReported safety_center_system_event_reported = 472 [(module) = "permissioncontroller"];
        SafetyCenterInteractionReported safety_center_interaction_reported = 473 [(module) = "permissioncontroller"];
        SettingsProviderSettingChanged settings_provider_setting_changed = 474 [(module) = "framework"];
        BroadcastDeliveryEventReported broadcast_delivery_event_reported =
                475 [(module) = "framework"];
        ServiceRequestEventReported service_request_event_reported = 476 [(module) = "framework"];
        ProviderAcquisitionEventReported provider_acquisition_event_reported =
                477 [(module) = "framework"];
        BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
        CellBroadcastConfigUpdated cb_config_updated = 479 [(module) = "cellbroadcast"];
        CellBroadcastModuleErrorReported cb_module_error_reported = 480 [(module) = "cellbroadcast"];
        CellBroadcastServiceFeatureChanged cb_service_feature_changed = 481 [(module) = "cellbroadcast"];
        CellBroadcastReceiverFeatureChanged cb_receiver_feature_changed = 482 [(module) = "cellbroadcast"];
        JSScriptEngineLatencyReported jsscriptengine_latency_reported = 483 [(module) = "adservices"];
        PrivacySignalNotificationInteraction privacy_signal_notification_interaction = 484 [(module) = "permissioncontroller"];
        PrivacySignalIssueCardInteraction privacy_signal_issue_card_interaction = 485 [(module) = "permissioncontroller"];
        PrivacySignalsJobFailure privacy_signals_job_failure = 486 [(module) = "permissioncontroller"];
        VibrationReported vibration_reported = 487 [(module) = "framework"];
        UwbStartRanging uwb_ranging_start = 489 [(module) = "uwb"];
        MobileDataDownloadFileGroupDownloadStatusReported mobile_data_download_file_group_status_reported = 490 [(module) = "adservices"];
        AppCompactedV2 app_compacted_v2 = 491 [(module) = "framework"];
        // reserved 492
        AdServicesSettingsUsageReported ad_services_settings_usage_reported = 493 [(module) = "adservices", (truncate_timestamp) = true];
        DisplayBrightnessChanged display_brightness_changed = 494 [(module) = "framework"];
        ActivityActionBlocked activity_action_blocked = 495 [(module) = "framework"];
        BackgroundFetchProcessReported background_fetch_process_reported =
                496 [(module) = "adservices"];
        UpdateCustomAudienceProcessReported update_custom_audience_process_reported =
                497 [(module) = "adservices"];
        RunAdBiddingProcessReported run_ad_bidding_process_reported = 498 [(module) = "adservices"];
        RunAdScoringProcessReported run_ad_scoring_process_reported = 499 [(module) = "adservices"];
        RunAdSelectionProcessReported run_ad_selection_process_reported =
                500 [(module) = "adservices"];
        RunAdBiddingPerCAProcessReported run_ad_bidding_per_ca_process_reported =
                501 [(module) = "adservices"];
        MobileDataDownloadDownloadResultReported mobile_data_download_download_result_reported = 502 [(module) = "adservices"];
        MobileDataDownloadFileGroupStorageStatsReported mobile_data_download_file_group_storage_stats_reported = 503 [(module) = "adservices"];
        NetworkDnsServerSupportReported network_dns_server_support_reported = 504 [(module) = "resolv"];
        VmBooted vm_booted = 505 [(module) = "virtualizationservice"];
        VmExited vm_exited = 506 [(module) = "virtualizationservice"];
        AmbientBrightnessStatsReported ambient_brightness_stats_reported = 507 [(module) = "framework"];
        MediametricsSpatializerCapabilitiesReported mediametrics_spatializercapabilities_reported =
                508 [(module) = "media_metrics"];
        MediametricsSpatializerDeviceEnabledReported mediametrics_spatializerdeviceenabled_reported =
                509 [(module) = "media_metrics"];
        MediametricsHeadTrackerDeviceEnabledReported mediametrics_headtrackerdeviceenabled_reported =
                510 [(module) = "media_metrics"];
        MediametricsHeadTrackerDeviceSupportedReported mediametrics_headtrackerdevicesupported_reported =
                511 [(module) = "media_metrics"];
        AdServicesMeasurementRegistrations ad_services_measurement_registrations =
            512 [(module) = "adservices", (truncate_timestamp) = true];
        HearingAidInfoReported hearing_aid_info_reported = 513 [(module) = "framework"];
        DeviceWideJobConstraintChanged device_wide_job_constraint_changed =
            514 [(module) = "framework"];
        AmbientModeChanged ambient_mode_changed = 515 [(module) = "framework"];
        ANRLatencyReported anr_latency_reported = 516 [(module) = "framework"];
        ResourceValueApiStatisticsReported resource_api_info = 517 [(module) = "framework"];
        SystemDefaultNetworkChanged system_default_network_changed =
            518 [(module) = "network_stack"];
        IwlanSetupDataCallResultReported iwlan_setup_data_call_result_reported = 519 [(module) = "iwlan"];
        IwlanPdnDisconnectedReasonReported iwlan_pdn_disconnected_reason_reported = 520 [(module) = "iwlan"];
        AirplaneModeSessionReported airplane_mode_session_reported = 521 [(module) = "wifi", (module) = "bluetooth"];
        VmCpuStatusReported vm_cpu_status_reported = 522 [(module) = "virtualizationservice", deprecated = true];
        VmMemStatusReported vm_mem_status_reported = 523 [(module) = "virtualizationservice", deprecated = true];
        PackageInstallationSessionReported package_installation_session_reported = 524 [(module) = "framework"];
        DefaultNetworkRematchInfo default_network_rematch_info = 525 [(module) = "connectivity"];
        NetworkSelectionPerformance network_selection_performance = 526 [(module) = "connectivity"];
        NetworkNsdReported network_nsd_reported = 527 [(module) = "connectivity"];
        BluetoothDisconnectionReasonReported bluetooth_disconnection_reason_reported = 529 [(module) = "bluetooth"];
        BluetoothLocalVersionsReported bluetooth_local_versions_reported = 530 [(module) = "bluetooth"];
        BluetoothRemoteSupportedFeaturesReported bluetooth_remote_supported_features_reported = 531 [(module) = "bluetooth"];
        BluetoothLocalSupportedFeaturesReported bluetooth_local_supported_features_reported = 532 [(module) = "bluetooth"];
        BluetoothGattAppInfo bluetooth_gatt_app_info = 533 [(module) = "bluetooth"];
        BrightnessConfigurationUpdated brightness_configuration_updated = 534 [(module) = "framework"];
        AdServicesGetTopicsReported ad_services_get_topics_reported =
            535 [(module) = "adservices", (truncate_timestamp) = true];
        AdServicesEpochComputationGetTopTopicsReported
            ad_services_epoch_computation_get_top_topics_reported =
                536 [(module) = "adservices", (truncate_timestamp) = true];
        AdServicesEpochComputationClassifierReported
            ad_services_epoch_computation_classifier_reported =
                537 [(module) = "adservices", (truncate_timestamp) = true];
        WearMediaOutputSwitcherLaunched wear_media_output_switcher_launched =
            538 [(module) = "MediaOutputSwitcher"];
        WearMediaOutputSwitcherFinished wear_media_output_switcher_finished =
            539 [(module) = "MediaOutputSwitcher"];
        WearMediaOutputSwitcherConnectionReported
            wear_media_output_switcher_connection_reported =
                540 [(module) = "MediaOutputSwitcher"];
        WearMediaOutputSwitcherDeviceScanTriggered
            wear_media_output_switcher_device_scan_triggered =
                541 [(module) = "MediaOutputSwitcher"];
        WearMediaOutputSwitcherFirstDeviceScanLatency
            wear_media_output_switcher_first_device_scan_latency =
                542 [(module) = "MediaOutputSwitcher"];
        WearMediaOutputSwitcherConnectDeviceLatency
            wear_media_output_switcher_connect_device_latency =
                543 [(module) = "MediaOutputSwitcher"];
        PackageManagerSnapshotReported
            package_manager_snapshot_reported = 544 [(module) = "framework"];
        PackageManagerAppsFilterCacheBuildReported
            package_manager_apps_filter_cache_build_reported = 545 [(module) = "framework"];
        PackageManagerAppsFilterCacheUpdateReported
            package_manager_apps_filter_cache_update_reported = 546 [(module) = "framework"];
        sysui.LauncherImpressionEvent launcher_impression_event = 547 [(module) = "sysui"];
        WearMediaOutputSwitcherAllDevicesScanLatency
            wear_media_output_switcher_all_devices_scan_latency =
                549 [(module) = "MediaOutputSwitcher"];
        WsWatchFaceEdited ws_watch_face_edited = 551 [(module) = "wearservices"];
        WsWatchFaceFavouriteActionReported ws_watch_face_favorite_action_reported = 552 [(module) = "wearservices"];
        WsWatchFaceSetActionReported ws_watch_face_set_action_reported = 553 [(module) = "wearservices"];
        PackageUninstallationReported package_uninstallation_reported = 554 [(module) = "framework"];
        agif.GameModeChanged game_mode_changed = 555 [(module) = "framework"];
        agif.GameModeConfigurationChanged game_mode_configuration_changed = 556 [(module) = "framework"];
        BedtimeModeStateChanged bedtime_mode_state_changed = 557 [(module) = "framework"];
        NetworkSliceSessionEnded network_slice_session_ended = 558 [(module) = "connectivity"];
        NetworkSliceDailyDataUsageReported network_slice_daily_data_usage_reported = 559 [(module) = "connectivity"];
        NfcTagTypeOccurred nfc_tag_type_occurred = 560 [(module) = "nfc"];
        NfcAIDConflictOccurred nfc_aid_conflict_occurred = 561 [(module) = "nfc"];
        NfcReaderConflictOccurred nfc_reader_conflict_occurred = 562 [(module) = "nfc"];
        WsTileListChanged ws_tile_list_changed = 563 [(module) = "wearservices"];
        GetTypeAccessedWithoutPermission get_type_accessed_without_permission = 564[(module) = "framework"];
        MobileBundledAppInfoGathered mobile_bundled_app_info_gathered = 566 [(module) = "framework"];
        WsWatchFaceComplicationSetChanged ws_watch_face_complication_set_changed = 567 [(module) = "wearservices"];
        media.MediaDrmCreated media_drm_created = 568 [(module) = "media_metrics"];
        media.MediaDrmErrored media_drm_errored = 569 [(module) = "media_metrics"];
        media.MediaDrmSessionOpened media_drm_session_opened = 570
            [(module) = "media_metrics"];
        media.MediaDrmSessionClosed media_drm_session_closed = 571
            [(module) = "media_metrics"];
        UserSelectedResolution user_selected_resolution = 572 [(module) = "settings"];
        UnsafeIntentEventReported unsafe_intent_event_reported = 573 [(module) = "framework"];
        adpf.PerformanceHintSessionReported performance_hint_session_reported = 574 [(module) = "framework"];
        MediametricsMidiDeviceCloseReported mediametrics_midi_device_close_reported =
            576 [(module) = "media_metrics"];
        hardware.biometrics.BiometricTouchReported biometric_touch_reported = 577 [(module) = "sysui"];
        hotword.HotwordAudioEgressEventReported hotword_audio_egress_event_reported = 578
            [(module) = "framework"];
        location.LocationEnabledStateChanged location_enabled_state_changed = 580 [(module) = "framework"];
        view.inputmethod.ImeRequestFinished ime_request_finished = 581 [(module) = "framework"];
        usb.UsbComplianceWarningsReported usb_compliance_warnings_reported = 582 [(module) = "framework"];
        locale.AppSupportedLocalesChanged app_supported_locales_changed = 583 [(module) = "framework"];
        grammaticalinflection.ApplicationGrammaticalInflectionChanged grammatical_inflection_changed = 584 [(module) = "framework"];
        providers.mediaprovider.MediaProviderVolumeRecoveryReported
            media_provider_volume_recovery_reported = 586 [(module) = "mediaprovider"];
        hardware.biometrics.BiometricPropertiesCollected
            biometric_properties_collected = 587 [(module) = "framework"];
        kernel.KernelWakeupAttributed kernel_wakeup_attributed = 588 [(module) = "framework"];
        display.ScreenStateChangedV2 screen_state_changed_v2 = 589 [(module) = "framework"];
        wearservices.WsBackupActionReported ws_backup_action_reported = 590
            [(module) = "wearservices"];
        wearservices.WsRestoreActionReported ws_restore_action_reported = 591
            [(module) = "wearservices"];
        devicelogs.DeviceLogAccessEventReported device_log_access_event_reported = 592 [(module) = "sysui"];
        wear.media.MediaSessionUpdated media_session_updated = 594 [(module) = "wearmedia"];
        wearsysui.WearOobeStateChanged wear_oobe_state_changed = 595 [(module) = "framework"];
        wearservices.WsNotificationUpdated ws_notification_updated = 596
            [(module) = "wearservices"];
        // reserved 597
        corenetworking.connectivity.NetworkValidationFailureStatsDailyReported
            network_validation_failure_stats_daily_reported = 601 [(module) = "connectivity"];
        wearservices.WsComplicationTapped ws_complication_tapped = 602 [(module) = "wearservices"];
        wearservices.WsNotificationBlocking ws_notification_blocking = 780 [(module) = "wearservices"];
    }

    // Pushed atom extensions.
    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
    extensions 332; // ArtDatumReported art_datum_reported
    extensions 366; // OdrefreshReported odrefresh_reported
    extensions 385; // AppSearchSetSchemaStatsReported app_search_set_schema_stats_reported
    extensions 467; // BackgroundDexoptJobEnded background_dexopt_job_ended
    extensions 488; // SandboxApiCalled sandbox_api_called
    extensions 528; // ExpressEventReported express_event_reported
    extensions 548; // OdsignReported odsign_reported
    extensions 550; // ArtDeviceDatumReported art_device_datum_reported
    extensions 565; // ArtDatumDeltaReported art_datum_delta_reported
    extensions 579; // AppSearchSchemaMigrationStatsReported app_search_schema_migration_stats_reported
    extensions 585; // CredentialManagerApiCalled credential_manager_api_called
    extensions 593; // ExpressHistogramSampleReported express_histogram_sample_reported
    extensions 598; // AdServicesBackCompatGetTopicsReported ad_services_back_compat_get_topics_reported
    extensions 599; // AdServicesBackCompatEpochComputationClassifierReported ad_services_back_compat_epoch_computation_classifier_reported
    extensions 600; // MediaCodecReclaimRequestCompleted media_codec_reclaim_request_completed
    extensions 603; // AutofillUiEventReported autofill_ui_event_reported
    extensions 604; // AutofillFillRequestReported autofill_fill_request_reported
    extensions 605; // AutofillFillResponseReported autofill_fill_response_reported
    extensions 606; // AutofillSaveEventReported autofill_save_event_reported
    extensions 607; // AutofillSessionCommitted autofill_session_committed
    extensions 608; // MediaActionReported media_action_reported
    extensions 609; // MediaControlsLaunched media_controls_launched
    extensions 610; // WsWearTimeSession ws_wear_time_session
    extensions 611; // LockscreenShortcutSelected lockscreen_shortcut_selected
    extensions 612; // LockscreenShortcutTriggered lockscreen_shortcut_triggered
    extensions 613; // BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported
    extensions 614; // BluetoothL2capCocClientConnection bluetooth_l2cap_coc_client_connection
    extensions 615; // BluetoothL2capCocServerConnection bluetooth_l2cap_coc_server_connection
    extensions 616; // HealthConnectApiCalled health_connect_api_called
    extensions 617; // HealthConnectUsageStats health_usage_stats
    extensions 618; // HealthConnectStorageStats health_connect_storage_stats
    extensions 619; // WearAdaptiveSuspendStatsReported wear_adaptive_suspend_stats_reported
    extensions 620; // WearPowerAnomalyServiceOperationalStatsReported wear_power_anomaly_service_operational_stats_reported
    extensions 621; // WearPowerAnomalyServiceEventStatsReported wear_power_anomaly_service_event_stats_reported
    extensions 622; // SettingsSpaReported settings_spa_reported
    extensions 623; // HealthConnectUiImpression health_connect_ui_impression
    extensions 624; // HealthConnectUiInteraction health_connect_ui_interaction
    extensions 625; // HealthConnectAppOpenedReported health_connect_app_opened_reported
    extensions 626; // WsIncomingCallActionReported ws_incoming_call_action_reported
    extensions 627; // WsCallDisconnectionReported ws_call_disconnection_reported
    extensions 628; // WsCallDurationReported ws_call_duration_reported
    extensions 629; // WsCallUserExperienceLatencyReported ws_call_user_experience_latency_reported
    extensions 630; // WsCallInteractionReported ws_call_interaction_reported
    extensions 631; // FullScreenIntentLaunched full_screen_intent_launched
    extensions 632; // BalAllowed bal_allowed
    extensions 633; // EmergencyStateChanged emergency_state_changed
    extensions 634; // QualifiedRatListChanged qualified_rat_list_changed
    extensions 635; // QnsImsCallDropStats qns_ims_call_drop_stats
    extensions 636; // QnsFallbackRestrictionChanged qns_fallback_restriction_changed
    extensions 637; // EmergencyNumberDialed emergency_number_dialed
    extensions 638; // WifiAwareNdpReported wifi_aware_ndp_reported
    extensions 639; // WifiAwareAttachReported wifi_aware_attach_reported
    extensions 640; // AdServicesMeasurementDebugKeys ad_services_measurement_debug_keys
    extensions 641; // MediaCodecStarted media_codec_started
    extensions 642; // MediaCodecStopped media_codec_stopped
    extensions 643; // HealthConnectApiInvoked health_connect_api_invoked
    extensions 644; // ExpressUidEventReported express_uid_event_reported
    extensions 645; // PermissionRationaleDialogViewed permission_rationale_dialog_viewed
    extensions 646; // PermissionRationaleDialogActionReported permission_rationale_dialog_action_reported
    extensions 647; // AppDataSharingUpdatesNotificationInteraction app_data_sharing_updates_notification_interaction
    extensions 648; // AppDataSharingUpdatesFragmentViewed app_data_sharing_updates_fragment_viewed
    extensions 649; // AppDataSharingUpdatesFragmentActionReported app_data_sharing_updates_fragment_action_reported
    extensions 650; // DailykeepaliveInfoReported daily_keepalive_info_reported
    extensions 651; // CredentialManagerInitialPhaseReported credential_manager_init_phase_reported
    extensions 652; // CredentialManagerCandidatePhaseReported credential_manager_candidate_phase_reported
    extensions 653; // CredentialManagerFinalPhaseReported credential_manager_final_phase_reported
    extensions 654; // ExerciseRouteApiCalled exercise_route_api_called
    extensions 655; // PluginInitialized plugin_initialized
    extensions 656; // BluetoothLeSessionConnected bluetooth_le_session_connected
    extensions 657; // DNDStateChanged dnd_state_changed
    extensions 658; // ExpressUidHistogramSampleReported express_uid_histogram_sample_reported
    extensions 659; // AutofillFieldClassificationEventReported autofill_field_classification_event_reported
    extensions 660; // TestExtensionAtomReported test_extension_atom_reported
    extensions 661; // WifiSelfRecoveryTriggered wifi_self_recovery_triggered
    extensions 662; // AdServicesErrorReported ad_services_error_reported
    extensions 663; // AdServicesBackgroundJobsExecutionReported ad_services_background_jobs_execution_reported
    extensions 664; // RkpdPoolStats rkpd_pool_stats
    extensions 665; // RkpdClientOperation rkpd_client_operation
    extensions 666;  // RestrictedBluetoothDeviceNameReported restricted_bluetooth_device_name_reported
    extensions 667; // CredentialManagerTotalCandidateReported credential_manager_total_reported
    extensions 668; // CredentialManagerFinalNoUidReported credential_manager_finalnouid_reported
    extensions 669; // CredentialManagerGetProviderReported credential_manager_get_reported
    extensions 670; // CredentialManagerBrowsedAuthenticationClicked credential_manager_auth_click_reported
    extensions 671; // CredentialManagerApiV2Called credential_manager_apiv2_called
    extensions 672; // TestRestrictedAtomReported test_restricted_atom_reported
    extensions 673; // AdServicesMeasurementDelayedSourceRegistration ad_services_measurement_delayed_source_registration
    extensions 674; // AdServicesMeasurementAttribution ad_services_measurement_attribution
    extensions 675; // AdServicesMeasurementJobs ad_services_measurement_jobs
    extensions 676; // AdServicesMeasurementWipeout ad_services_measurement_wipeout
    extensions 677; // MediaSessionStateChanged media_session_state_changed
    extensions 678; // IkeSessionTerminated ike_session_terminated
    extensions 679; // TvLowPowerStandbyPolicy tv_low_power_standby_policy
    extensions 680; // SoftApStarted softap_started
    extensions 681; // SoftApStopped softap_stopped
    extensions 682; // KeyboardConfigured keyboard_configured
    extensions 683; // KeyboardSystemsEventReported keyboard_systems_event_reported
    extensions 684; // MediaCodecRendered media_codec_rendered
    extensions 685; // InTaskActivityStarted in_task_activity_started
    extensions 686; // InputDeviceUsageReported inputdevice_usage_reported
    extensions 687; // WifiLockReleased wifi_lock_released
    extensions 688; // WifiLockDeactivated wifi_lock_deactivated
    extensions 689; // WifiConfigSaved wifi_config_saved
    extensions 690; // WifiAwareResourceUsingChanged wifi_aware_resource_using_changed
    extensions 691; // WifiAwareHalApiCalled wifi_aware_hal_api_called
    extensions 692; // WifiLocalOnlyRequestReceived wifi_local_only_request_received
    extensions 693; // WifiLocalOnlyRequestScanTriggered wifi_local_only_request_scan_triggered
    extensions 694; // WifiThreadTaskExecuted wifi_thread_task_executed
    extensions 695; // AdServicesMeasurementAdIdMatchForDebugKeys ad_services_ad_id_match_for_debug_keys
    extensions 696; // BluetoothProfileConnectionAttempted bluetooth_profile_connection_attempted
    extensions 697; // AdServicesEnrollmentDataStored ad_services_enrollment_data_stored
    extensions 698; // AdServicesEnrollmentFileDownloaded ad_services_enrollment_file_downloaded
    extensions 699; // AdServicesEnrollmentMatched ad_services_enrollment_matched
    extensions 700; // WifiStateChanged wifi_state_changed
    extensions 701; // HdmiEarcStatusReported hdmi_earc_status_reported
    extensions 702; // AdServicesConsentMigrated ad_services_consent_migrated
    extensions 703; // CronetEngineCreated cronet_engine_created
    extensions 704; // CronetTrafficReported cronet_traffic_reported
    extensions 705; // DreamSettingChanged dream_setting_changed
    extensions 706; // AiWallpapersButtonPressed ai_wallpapers_button_pressed
    extensions 707; // AiWallpapersTemplateSelected ai_wallpapers_template_selected
    extensions 708; // AiWallpapersTermSelected ai_wallpapers_term_selected
    extensions 709; // AiWallpapersWallpaperSet ai_wallpapers_wallpaper_set
    extensions 710; // AiWallpapersSessionSummary ai_wallpapers_session_summary
    extensions 711; // OnDevicePersonalizationApiCalled ondevicepersonalization_api_called
    extensions 712; // FederatedComputeApiCalled federated_compute_api_called
    extensions 713; // CellularRadioPowerStateChanged cellular_radio_power_state_changed
    extensions 714; // AdServicesEnrollmentFailed ad_services_enrollment_failed
    extensions 715; // WearModeStateChanged wear_mode_state_changed
    extensions 716; // LauncherImpressionEventV2 launcher_impression_event_v2
    extensions 717; // ExternalTvInputEvent external_tv_input_event
    extensions 718; // StylusPredictionMetricsReported stylus_prediction_metrics_reported
    extensions 719; // PnoScanStarted pno_scan_started
    extensions 720; // PnoScanStopped pno_scan_stopped
    extensions 721; // MediatorUpdated mediator_updated
    extensions 722; // WifiIsUnusableReported wifi_is_unusable_reported
    extensions 723; // WifiApCapabilitiesReported wifi_ap_capabilities_reported
    extensions 724; // HdmiSoundbarModeStatusReported hdmi_soundbar_mode_status_reported
    extensions 725; // UserRiskEventReported user_risk_event_reported
    extensions 726; // DeviceLockCheckInRequestReported device_lock_check_in_request_reported
    extensions 727; // DeviceLockProvisioningCompleteReported device_lock_provisioning_complete_reported
    extensions 728; // DeviceLockKioskAppRequestReported device_lock_kiosk_app_request_reported
    extensions 729; // MediaProjectionStateChanged media_projection_state_changed
    extensions 730; // MediaProjectionTargetChanged media_projection_target_changed
    extensions 731; // WearPowerMenuOpened wear_power_menu_opened
    extensions 732; // ApexInstallationRequested apex_installation_requested
    extensions 733; // ApexInstallationStaged apex_installation_staged
    extensions 734; // ApexInstallationEnded apex_installation_ended
    extensions 735; // SandboxActivityEventOccurred sandbox_activity_event_occurred
    extensions 736; // RendererInitialized renderer_initialized
    extensions 737; // SchemaVersionReceived schema_version_received
    extensions 738; // ThreadnetworkTelemetryDataReported threadnetwork_telemetry_data_reported
    extensions 739; // ThreadnetworkTopoEntryRepeated threadnetwork_topo_entry_repeated
    extensions 740; // ThreadnetworkDeviceInfoReported threadnetwork_device_info_reported
    extensions 741; // LayoutInspected layout_inspected
    extensions 742; // LayoutExpressionsInspected layout_expression_inspected
    extensions 743; // LayoutAnimationsInspected layout_animations_inspected
    extensions 744; // MaterialComponentsInspected material_components_inspected
    extensions 745; // TileRequested tile_requested
    extensions 746; // StateResponseReceived state_response_received
    extensions 747; // TileResponseReceived tile_response_received
    extensions 748; // InflationFinished inflation_finished
    extensions 749; // InflationFailed inflation_failed
    extensions 750; // IgnoredInflationFailuresReported ignored_inflation_failures_reported
    extensions 751; // DrawableRendered drawable_rendered
    extensions 752; // StatsSocketLossReported stats_socket_loss_reported
    extensions 753; // DisplaySwitchLatencyTracked display_switch_latency_tracked
    extensions 754; // KernelOomKillOccurred kernel_oom_kill_occurred
    extensions 755; // WearAssistantOpened wear_assistant_opened
    extensions 756; // AdServicesMeasurementClickVerification ad_services_measurement_click_verification
    extensions 757; // WearMediaOutputSwitcherDeviceScanApiLatency wear_media_output_switcher_device_scan_api_latency
    extensions 758; // WearMediaOutputSwitcherSassDeviceUnavailable wear_media_output_switcher_sass_device_unavailable
    extensions 759; // WearMediaOutputSwitcherFastPairApiTimeout wear_media_output_switcher_fastpair_api_timeout
    extensions 760; // IkeLivenessCheckSessionValidated ike_liveness_check_session_validated
    extensions 761; // HotwordEventEgressSize hotword_egress_size_atom_reported
    extensions 762; // CronetEngineBuilderInitialized cronet_engine_builder_initialized
    extensions 763; // CronetHttpFlagsInitialized cronet_http_flags_initialized
    extensions 764; // CronetInitialized cronet_initialized
    extensions 765; // AdServicesEncryptionKeyFetched ad_services_encryption_key_fetched
    extensions 766; // AdServicesEncryptionKeyDbTransactionEnded ad_services_encryption_key_db_transaction_ended
    extensions 767; // DestinationRegisteredBeacons destination_registered_beacons
    extensions 768; // ReportInteractionApiCalled report_interaction_api_called
    extensions 769; // InteractionReportingTableCleared interaction_reporting_table_cleared
    extensions 770; // CarRecentsEventReported car_recents_event_reported
    extensions 771; // FederatedComputeTrainingEventReported federated_compute_training_event_reported
    extensions 772; // ThermalStatusCalled thermal_status_called
    extensions 773; // ThermalHeadroomCalled thermal_headroom_called
    extensions 774; // ThermalHeadroomThresholdsCalled thermal_headroom_thresholds_called
    extensions 775; // BootIntegrityInfoReported boot_integrity_info_reported
    extensions 776; // ScreenOffReported screen_off_reported
    extensions 777; // ApfSessionInfoReported apf_session_info_reported
    extensions 778; // IpClientRaInfoReported ip_client_ra_info_reported
    extensions 779; // NetworkRequestStateChanged network_request_state_changed
    extensions 9999; // Atom9999 atom_9999
    // StatsdStats tracks platform atoms with ids up to 900.
    // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.

    // Pulled events will start at field 10000.
    // Next: 10204
    oneof pulled {
        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
        MobileBytesTransfer mobile_bytes_transfer =
                10002 [(module) = "framework", (truncate_timestamp) = true];
        MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
                10003 [(module) = "framework", (truncate_timestamp) = true];
        BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
        KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
        SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "framework", (module) = "statsdtest"];
        CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
        CpuTimePerUidFreq cpu_time_per_uid_freq =
                10010 [(module) = "framework", (module) = "statsd"];
        WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
        ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
        BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
        ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
        SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
        SystemUptime system_uptime = 10015 [(module) = "framework"];
        CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
        CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
        DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
        RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
        FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
        Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
        BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
        BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
        LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
        DiskStats disk_stats = 10025 [(module) = "framework"];
        DirectoryUsage directory_usage = 10026 [(module) = "framework"];
        AppSize app_size = 10027 [(module) = "framework"];
        CategorySize category_size = 10028 [(module) = "framework"];
        ProcStats proc_stats = 10029 [(module) = "framework"];
        BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
        NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
        DiskIo disk_io = 10032 [(module) = "framework"];
        PowerProfile power_profile = 10033 [(module) = "framework"];
        ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
        ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
        CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
        OnDevicePowerMeasurement on_device_power_measurement = 10038 [(module) = "framework"];
        DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
        ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
        BatteryLevel battery_level = 10043 [(module) = "framework"];
        BuildInformation build_information = 10044 [(module) = "framework"];
        BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
        DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
        DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
        NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
        RoleHolder role_holder = 10049 [(module) = "framework"];
        DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
        TrainInfo train_info = 10051 [(module) = "statsd"];
        TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
        ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
        GpuStatsGlobalInfo gpu_stats_global_info = 10054;
        GpuStatsAppInfo gpu_stats_app_info = 10055;
        SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
        AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
        FaceSettings face_settings = 10058 [(module) = "framework"];
        CoolingDevice cooling_device = 10059 [(module) = "framework"];
        AppOps app_ops = 10060 [(module) = "framework"];
        ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
        SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
        SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
        ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
        VmsClientStats vms_client_stats = 10065 [(module) = "car"];
        NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
        DangerousPermissionStateSampled dangerous_permission_state_sampled =
                10067 [(module) = "framework"];
        GraphicsStats graphics_stats = 10068 [(module) = "hwui"];
        RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
        IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
        PackageNotificationPreferences package_notification_preferences =
                10071 [(module) = "framework"];
        PackageNotificationChannelPreferences package_notification_channel_preferences =
                10072 [(module) = "framework"];
        PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
                10073 [(module) = "framework"];
        GnssStats gnss_stats = 10074 [(module) = "framework"];
        AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
        VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
        VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
        SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
        SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
        SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
        BlobInfo blob_info = 10081 [(module) = "framework"];
        DataUsageBytesTransfer data_usage_bytes_transfer =
                10082 [(module) = "framework", (truncate_timestamp) = true];
        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
                10083 [(module) = "framework", (truncate_timestamp) = true];
        dnd.DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
        GeneralExternalStorageAccessStats general_external_storage_access_stats =
            10085 [(module) = "mediaprovider"];
        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
        OutgoingSms outgoing_sms = 10087 [(module) = "telephony"];
        CarrierIdTableVersion carrier_id_table_version = 10088 [(module) = "telephony"];
        DataCallSession data_call_session = 10089 [(module) = "telephony"];
        CellularServiceState cellular_service_state = 10090 [(module) = "telephony"];
        CellularDataServiceSwitch cellular_data_service_switch = 10091 [(module) = "telephony"];
        SystemMemory system_memory = 10092 [(module) = "framework"];
        ImsRegistrationTermination ims_registration_termination = 10093 [(module) = "telephony"];
        ImsRegistrationStats ims_registration_stats = 10094 [(module) = "telephony"];
        CpuTimePerClusterFreq cpu_time_per_cluster_freq = 10095 [(module) = "framework"];
        CpuCyclesPerUidCluster cpu_cycles_per_uid_cluster = 10096 [(module) = "framework"];
        DeviceRotatedData device_rotated_data = 10097 [(module) = "framework"];
        CpuCyclesPerThreadGroupCluster cpu_cycles_per_thread_group_cluster = 10098 [(module) = "framework"];
        MediaDrmActivityInfo media_drm_activity_info = 10099 [(module) = "media_metrics"];
        OemManagedBytesTransfer oem_managed_bytes_transfer = 10100 [(module) = "framework"];
        GnssPowerStats gnss_power_stats = 10101 [(module) = "framework"];
        TimeZoneDetectorState time_zone_detector_state = 10102 [(module) = "framework"];
        Keystore2StorageStats keystore2_storage_stats = 10103 [(module) = "framework"];
        RkpPoolStats rkp_pool_stats = 10104 [deprecated = true];
        ProcessDmabufMemory process_dmabuf_memory = 10105 [(module) = "framework"];
        PendingAlarmInfo pending_alarm_info = 10106 [(module) = "framework"];
        UserLevelHibernatedApps user_level_hibernated_apps = 10107 [(module) = "framework"];
        sysui.LauncherLayoutSnapshot launcher_layout_snapshot = 10108
            [(module) = "sysui"];
        GlobalHibernatedApps global_hibernated_apps = 10109 [(module) = "framework"];
        input.InputEventLatencySketch input_event_latency_sketch = 10110 [(module) = "input"];
        BatteryUsageStatsBeforeReset battery_usage_stats_before_reset =
            10111 [(module) = "framework"];
        BatteryUsageStatsSinceReset battery_usage_stats_since_reset =
            10112 [(module) = "framework"];
        BatteryUsageStatsSinceResetUsingPowerProfileModel
            battery_usage_stats_since_reset_using_power_profile_model =
            10113 [(module) = "framework"];
        InstalledIncrementalPackage installed_incremental_package = 10114 [(module) = "framework"];
        TelephonyNetworkRequests telephony_network_requests =
            10115 [(module) = "telephony", deprecated = true];
        AppSearchStorageInfo app_search_storage_info = 10116 [(module) = "appsearch"];
        VmStat vmstat = 10117 [(module) = "framework"];
        Keystore2KeyCreationWithGeneralInfo keystore2_key_creation_with_general_info =
                10118 [(module) = "framework"];
        Keystore2KeyCreationWithAuthInfo keystore2_key_creation_with_auth_info =
                10119 [(module) = "framework"];
        Keystore2KeyCreationWithPurposeAndModesInfo
                keystore2_key_creation_with_purpose_and_modes_info = 10120 [(module) = "framework"];
        Keystore2AtomWithOverflow keystore2_atom_with_overflow = 10121 [(module) = "framework"];
        Keystore2KeyOperationWithPurposeAndModesInfo
                keystore2_key_operation_with_purpose_and_modes_info =
                        10122 [(module) = "framework"];
        Keystore2KeyOperationWithGeneralInfo keystore2_key_operation_with_general_info =
                10123 [(module) = "framework"];
        RkpErrorStats rkp_error_stats = 10124 [(module) = "framework"];
        Keystore2CrashStats keystore2_crash_stats = 10125 [(module) = "framework"];
        VendorApexInfo vendor_apex_info = 10126 [(module) = "framework"];
        AccessibilityShortcutStats accessibility_shortcut_stats = 10127 [(module) = "framework"];
        AccessibilityFloatingMenuStats accessibility_floating_menu_stats =
            10128 [(module) = "framework"];
        DataUsageBytesTransferV2 data_usage_bytes_transfer_v2 = 10129 [(module) = "framework",
                (truncate_timestamp) = true];
        MediaCapabilities media_capabilities = 10130 [(module) = "framework"];
        CarWatchdogSystemIoUsageSummary car_watchdog_system_io_usage_summary =
            10131 [(module) = "car"];
        CarWatchdogUidIoUsageSummary car_watchdog_uid_io_usage_summary = 10132 [(module) = "car"];
        ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats =
                10133 [(module) = "telephony"];
        RcsClientProvisioningStats rcs_client_provisioning_stats =
                10134 [(module) = "telephony"];
        RcsAcsProvisioningStats rcs_acs_provisioning_stats =
                10135 [(module) = "telephony"];
        SipDelegateStats sip_delegate_stats = 10136 [(module) = "telephony"];
        SipTransportFeatureTagStats sip_transport_feature_tag_stats =
                10137 [(module) = "telephony"];
        SipMessageResponse sip_message_response = 10138 [(module) = "telephony"];
        SipTransportSession sip_transport_session = 10139 [(module) = "telephony"];
        ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event =
                10140 [(module) = "telephony"];
        ImsDedicatedBearerEvent ims_dedicated_bearer_event = 10141 [(module) = "telephony"];
        ImsRegistrationServiceDescStats ims_registration_service_desc_stats =
                10142 [(module) = "telephony"];
        UceEventStats uce_event_stats = 10143 [(module) = "telephony"];
        PresenceNotifyEvent presence_notify_event = 10144 [(module) = "telephony"];
        GbaEvent gba_event = 10145 [(module) = "telephony"];
        PerSimStatus per_sim_status = 10146 [(module) = "telephony"];
        GpuWorkPerUid gpu_work_per_uid = 10147;
        PersistentUriPermissionsAmountPerPackage persistent_uri_permissions_amount_per_package =
            10148 [(module) = "framework"];
        SignedPartitionInfo signed_partition_info = 10149 [(module) = "framework"];
        PinnedFileSizesPerPackage pinned_file_sizes_per_package = 10150
            [(module) = "framework"];
        PendingIntentsPerPackage pending_intents_per_package = 10151
            [(module) = "framework"];
        UserInfo user_info = 10152 [(module) = "framework"];
        TelephonyNetworkRequestsV2 telephony_network_requests_v2 = 10153 [(module) = "telephony"];
        DeviceTelephonyProperties device_telephony_properties = 10154 [(module) = "telephony"];
        RemoteKeyProvisioningErrorCounts remote_key_provisioning_error_counts = 10155 [deprecated = true];
        SafetyState safety_state = 10156 [(module) = "permissioncontroller"];
        IncomingMms incoming_mms = 10157 [(module) = "mms"];
        OutgoingMms outgoing_mms = 10158 [(module) = "mms"];
        MultiUserInfo multi_user_info = 10160 [(module) = "framework"];
        NetworkBpfMapInfo network_bpf_map_info = 10161 [(module) = "connectivity"];
        OutgoingShortCodeSms outgoing_short_code_sms = 10162 [(module) = "telephony"];
        ConnectivityStateSample connectivity_state_sample = 10163 [(module) = "connectivity"];
        NetworkSelectionRematchReasonsInfo network_selection_rematch_reasons_info = 10164 [(module) = "connectivity"];
        agif.GameModeInfo game_mode_info = 10165 [(module) = "framework"];
        agif.GameModeConfiguration game_mode_configuration = 10166 [(module) = "framework"];
        agif.GameModeListener game_mode_listener = 10167 [(module) = "framework"];
        NetworkSliceRequestCountSample network_slice_request_count = 10168 [(module) = "connectivity"];
        WsTileSnapshot ws_tile_snapshot = 10169 [(module) = "wearservices"];
        WsActiveWatchFaceComplicationSetSnapshot ws_active_watch_face_complication_set_snapshot = 10170 [(module) = "wearservices"];
        ProcessState process_state = 10171 [(module) = "framework"];
        ProcessAssociation process_association = 10172 [(module) = "framework"];
        adpf.ADPFSystemComponentInfo adpf_system_component_info = 10173 [(module) = "framework"];
        sysui.NotificationMemoryUse notification_memory_use = 10174 [(module) = "sysui"];
        display.HdrCapabilities hdr_capabilities = 10175 [(module) = "framework"];
        WsFavouriteWatchFaceListSnapshot ws_favourite_watch_face_list_snapshot = 10176 [(module) = "wearservices"];
    }

    // Pulled atom extensions.
    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
    extensions 10159; // SandboxSdkStorage sandbox_sdk_storage
    extensions 10177; // QnsRatPreferenceMismatchInfo qns_rat_preference_mismatch_info
    extensions 10178; // QnsHandoverTimeMillis qns_handover_time_millis
    extensions 10179; // QnsHandoverPingpong qns_handover_pingpong
    extensions 10180; // EmergencyNumbersInfo emergency_numbers_info
    extensions 10181; // MteState mte_state
    extensions 10182; // SatelliteController satellite_controller
    extensions 10183; // SatelliteSession satellite_session
    extensions 10184; // SatelliteIncomingDatagram satellite_incoming_datagram
    extensions 10185; // SatelliteOutgoingDatagram satellite_outgoing_datagram
    extensions 10186; // SatelliteProvision satellite_provision
    extensions 10187; // SatelliteSosMessageRecommender satellite_sos_message_recommender
    extensions 10188; // UwbActivityInfo uwb_activity_info
    extensions 10189; // CachedAppsHighWaterMark cached_apps_high_watermark
    extensions 10190; // WifiAwareCapabilities wifi_aware_capabilities
    extensions 10191; // TouchpadUsage touchpad_usage
    extensions 10192; // DreamSettingSnapshot dream_setting_snapshot
    extensions 10193; // WifiModuleInfo wifi_module_info
    extensions 10194; // WifiSettingInfo wifi_setting_info
    extensions 10195; // WifiComplexSettingInfo wifi_complex_setting_info
    extensions 10196; // SysproxyBluetoothBytesTransfer sysproxy_bluetooth_bytes_transfer
    extensions 10197; // WsStandaloneModeSnapshot ws_standalone_mode_snapshot
    extensions 10198; // WifiConfiguredNetworkInfo wifi_configured_network_info;
    extensions 10199; // CpuPolicy cpu_policy
    extensions 10200; // ProxyBytesTransferByFgBg proxy_bytes_transfer_by_fg_bg
    extensions 10201; // ThermalHeadroomThresholds thermal_headroom_thresholds
    extensions 10202; // Reserved for b/308823939.
    extensions 10203; // Reserved for b/308823939.
    extensions 99999; // Atom99999 atom_99999

    // DO NOT USE field numbers above 100,000 in AOSP.
    // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
    // Field numbers 200,000 and above are reserved for future use; do not use them at all.
    reserved 58, 83, 360 to 363, 492, 597, 10008, 10036, 10040, 10041, 21004, 21005;
}

/*
 * *****************************************************************************
 * Below are all of the individual atoms that are logged by Android via statsd.
 *
 * RULES:
 *   - The field ids for each atom must start at 1, and count upwards by 1.
 *     Skipping field ids is not allowed.
 *   - These form an API, so renaming, renumbering or removing fields is
 *     not allowed between android releases.  (This is not currently enforced,
 *     but there will be a tool to enforce this restriction).
 *   - The types must be built-in protocol buffer types, namely, no sub-messages
 *     are allowed (yet).  The bytes type is also not allowed.
 *   - The CamelCase name of the message type should match the
 *     underscore_separated name as defined in Atom.
 *   - If an atom represents work that can be attributed to an app, there can
 *     be exactly one AttributionChain field. It must be field number 1.
 *   - A field that is a uid should be an int32 field, tagged with the
 *     [(is_uid) = true] annotation.
 *
 * CONVENTIONS:
 *   - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
 *   - If there is a UID, it goes first. Think in an object-oriented fashion.
 * *****************************************************************************
 */

/**
 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
 * Logs when the Thermal service HAL notifies the throttling start/stop events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
 */
message ThermalThrottlingStateChanged {
    // The type of temperature being reported (CPU, GPU, SKIN, etc)
    optional android.os.TemperatureTypeEnum sensor_type = 1;

    // Throttling state, this field is DEPRECATED
    enum State {
        UNKNOWN = 0;
        START = 1; // START indicated that throttling was triggered.
        STOP = 2; // STOP indicates that throttling was cleared.
    }
    optional State state = 2;

    optional float temperature = 3;
}

/**
 * Track transcoding service usage
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/TranscodeHelper.java
 * Next Tag: 14
 */
message TranscodingData {
    // Reason that leads to the type of access.
    enum AccessReason {
        UNKNOWN = 0;
        SYSTEM_DEFAULT = 1; // Default option
        SYSTEM_CONFIG = 2;  // Server-side/on-device config
        APP_MANIFEST = 3;  // media_capabilites.xml
        APP_COMPAT = 4;   // App compat framework
        APP_EXTRA = 5;   // ApplicationMediaCapabilities API in open()
    }

    // Causes that leads to the failure of transcode.
    enum FailureCause {
        CAUSE_UNKNOWN = 0;
        TRANSCODING_SERVICE_ERROR = 1;     // Error from transcoding service.
        TRANSCODING_CLIENT_TIMEOUT = 2;    // Timeout from MediaProvider.
        TRANSCODING_SESSION_CANCELED = 3; // MediaProvider cancels the transcode.
    }

    enum AccessType {
        HEVC_WRITE = 1;
        READ_DIRECT = 2;
        READ_CACHE = 3;
        READ_TRANSCODE = 4;
        WRITE_CACHE = 5; // App trying to write to transcodeid avc file in cache, this is rare.
        AVC_WRITE = 6;
    }

    enum Result {
        SUCCESS = 0;
        FAIL = 1;
        UNDEFINED = 2;
    }

    optional string requestor_package = 1;
    optional AccessType access_type = 2;
    optional int64 file_size_bytes = 3;
    optional Result transcode_result = 4;
    optional int64 transcode_duration_millis = 5; // The duration of transcoding.
    optional int64 file_duration_millis = 6; // The duration of the video file.
    optional int64 file_framerate_fps = 7; // The framerate of the video file.
    optional AccessReason access_reason = 8;
    optional int64 width = 9;
    optional int64 height = 10;
    optional bool hit_anr = 11;
    optional FailureCause failure_cause = 12;   // This field is valid only when fails.
    optional int64 transcoding_service_error_code = 13; // Error code from transcoding service.
}

/**
 * Logs when the screen state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ScreenStateChanged {
    // New screen state, from frameworks/proto_logging/stats/enums/view/enums.proto.
    optional android.view.DisplayStateEnum state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Part of the go/activity-security project. Logs information about activity
 * starts which would be blocked as part of the project.
 *
 * Logged from:
 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityStarter.java
 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityClientController.java
 */
message ActivityActionBlocked {
    enum Action {
        ACTION_UNSPECIFIED = 0;
        ACTIVITY_START_SAME_TASK = 1;
        ACTIVITY_START_DIFFERENT_TASK = 2;
        ACTIVITY_START_NEW_TASK = 3;
        FINISH_TASK = 4;
    }
    optional int32 caller_uid = 1 [(is_uid) = true];
    optional string caller_activity_class_name = 2;
    optional int32 target_task_top_activity_uid = 3 [(is_uid) = true];
    optional string target_task_top_activity_class_name = 4;
    optional bool target_task_is_different = 5;
    optional int32 target_activity_uid = 6 [(is_uid) = true];
    optional string target_activity_class_name = 7;
    optional string target_intent_action = 8;
    optional int32 target_intent_flags = 9;

    optional Action action = 10;
    optional int32 version = 11;
    optional bool multi_window = 12;
    optional int32 bal_code = 13;
    optional string task_debug_info = 14;
}

/**
 * Logs that the process state of the uid, as determined by ActivityManager
 * (i.e. the highest process state of that uid's processes) has changed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message UidProcessStateChanged {
    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];

    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
    optional android.app.ProcessStateEnum state = 2
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs process state change of a process, as per the activity manager.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
 */
message ProcessStateChanged {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // TODO: remove this when validation is done
    optional int64 version = 5;
    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
    optional android.app.ProcessStateEnum state = 4;
}

/**
 * Logs how long a process was in each of the states.
 */
message ProcessState {
  optional int32 uid = 1 [(is_uid) = true];
  optional string process_name = 2;

  // Measurement period. Can be used as denominator.
  // The gauge duration is not representative because we want uptime and also
  // the measurement usually ends at a time earlier than pull time.
  optional int32 measurement_start_uptime_seconds = 3;
  optional int32 measurement_end_uptime_seconds = 4;
  optional int32 measurement_duration_uptime_seconds = 5;

  // Individual state breakdowns, summing up to total process runtime.
  // Flattening (instead of a dimensions - value pair) for two reasons:
  // 1. Makes metric filtering possible (can pull the entire process data based
  //    on a specific value.
  // 2. More efficient to encode (proto id serves as dimension).
  optional int32 top_seconds = 6;
  optional int32 fgs_seconds = 7;
  optional int32 bound_top_seconds = 8;
  optional int32 bound_fgs_seconds = 9;
  optional int32 important_fg_bg_seconds = 10;
  optional int32 cached_seconds = 11;
  optional int32 frozen_seconds = 12;
  optional int32 other_seconds = 13;
}

/**
 * Logs association between processes.
 */
message ProcessAssociation {
  optional int32 client_uid = 1 [(is_uid) = true];

  // If we only care about the package name name we do not need to upload this
  // (even though we should add it to the atom for filtering / sharding)
  optional string client_process = 2;

  optional int32 service_uid = 3 [(is_uid) = true];

  optional string service_name = 4;

  optional string service_process = 10;

  // Measurement period. Can be used as denominator.
  // The gauge duration is not representative because we want uptime and also
  // the measurement usually ends at a time earlier than pull time.
  optional int32 measurement_start_uptime_seconds = 5;
  optional int32 measurement_end_uptime_seconds = 6;
  optional int32 measurement_duration_uptime_seconds = 7;

  optional int32 duration_seconds = 8;

  // Number of times this association was established.
  optional int32 count = 9;
}

/**
 * Logs when ActivityManagerService sleep state is changed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
 */
message ActivityManagerSleepStateChanged {
    // TODO: import frameworks proto
    enum State {
        UNKNOWN = 0;
        ASLEEP = 1;
        AWAKE = 2;
    }
    optional State state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs when system memory state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message MemoryFactorStateChanged {
    // TODO: import frameworks proto
    enum State {
        MEMORY_UNKNOWN = 0;
        NORMAL = 1;     // normal.
        MODERATE = 2;   // moderate memory pressure.
        LOW = 3;        // low memory.
        CRITICAL = 4;   // critical memory.

    }
    optional State factor = 1 [(state_field_option).exclusive_state = true];
}

/**
 * Logs when app is using too much cpu, according to ActivityManagerService.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message ExcessiveCpuUsageReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // package version. TODO: remove this when validation is done
    optional int64 version = 4;
}

/**
 * Logs when a cached process is killed, along with its pss.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message CachedKillReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // TODO: remove this when validation is done
    optional int64 version = 5;
    optional int64 pss = 4;
}

/**
 * Logs the change in wifi health.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
 */
message WifiHealthStatReported {
    enum Band {
        UNKNOWN = 0;
        // All of 2.4GHz band
        BAND_2G = 1;
        // Frequencies in the range of [5150, 5250) GHz
        BAND_5G_LOW = 2;
        // Frequencies in the range of [5250, 5725) GHz
        BAND_5G_MIDDLE = 3;
        // Frequencies in the range of [5725, 5850) GHz
        BAND_5G_HIGH = 4;
        // Frequencies in the range of [5925, 6425) GHz
        BAND_6G_LOW = 5;
        // Frequencies in the range of [6425, 6875) GHz
        BAND_6G_MIDDLE = 6;
        // Frequencies in the range of [6875, 7125) GHz
        BAND_6G_HIGH = 7;
    }
    // duration this stat is obtained over in milliseconds
    optional int32 duration_millis = 1;
    // whether wifi is classified as sufficient for the user's data traffic, determined
    // by whether the calculated throughput exceeds the average demand within |duration_millis|
    optional bool is_sufficient = 2;
    // whether cellular data is available
    optional bool is_cell_data_available = 3;
    // the Band bucket the connected network is on
    optional Band band = 4;
    // the Signal strength in the range of [-126, 0)
    optional int32 rssi = 5;
    // estimated tx throughput in kbps
    optional int32 tx_kbps = 6 [default = -1];
    // estimated rx throughput in kbps
    optional int32 rx_kbps = 7 [default = -1];
   // External scorer UID if external scorer is enabled. Otherwise WIFI_UID for
   // AOSP scorer.
   optional int32 scorer_uid = 8;
   // Whether or not Wi-Fi is predicted as usable by the scorer
   // Note: 'is_wifi_predicted_as_usable' is deprectaed by 'wifi_predicted_usability_state'.
   optional bool is_wifi_predicted_as_usable = 9;
   // Wi-Fi usability state as predicted by the scorer
   optional android.net.wifi.WifiPredictedUsabilityState wifi_predicted_usability_state = 10;
}

/**
 * Logged when wifi detects a significant change in connection failure rate.
 *
 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
 *
 */
message WifiFailureStatReported {
    enum AbnormalityType {
        UNKNOWN = 0;
        SIGNIFICANT_INCREASE = 1;
        SIGNIFICANT_DECREASE = 2;
        SIMPLY_HIGH = 3;
    }
    enum FailureType {
        FAILURE_UNKNOWN = 0;
        FAILURE_CONNECTION = 1;
        FAILURE_ASSOCIATION_REJECTION = 2;
        FAILURE_ASSOCIATION_TIMEOUT = 3;
        FAILURE_AUTHENTICATION = 4;
        FAILURE_NON_LOCAL_DISCONNECTION = 5;
        FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
    }
    // Reason for uploading this stat
    optional AbnormalityType abnormality_type = 1;
    // The particular type of failure
    optional FailureType failure_type = 2;
    // How many times we have encountered this combination of AbnormalityType and FailureType
    optional int32 failure_count = 3;
}

/**
 * Logs whether a Wifi connection attempt was successful and reasons for failure if it wasn't.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
 */
message WifiConnectionResultReported {
    enum FailureCode {
        FAILURE_UNKNOWN = 0;
        FAILURE_ASSOCIATION_TIMEOUT = 1;
        FAILURE_ASSOCIATION_REJECTION = 2;
        FAILURE_AUTHENTICATION_GENERAL = 3;
        FAILURE_AUTHENTICATION_EAP = 4;
        FAILURE_DHCP = 5;
        FAILURE_NETWORK_DISCONNECTION = 6;
        FAILURE_ROAM_TIMEOUT = 7;
        FAILURE_WRONG_PASSWORD = 8;
        FAILURE_CONNECT_NETWORK_FAILED = 9;
        FAILURE_NEW_CONNECTION_ATTEMPT = 10;
        FAILURE_REDUNDANT_CONNECTION_ATTEMPT = 11;
        FAILURE_NETWORK_NOT_FOUND = 12;
        FAILURE_NO_RESPONSE = 13;
        FAILURE_OTHERS = 14;
    }

    enum Trigger {
        UNKNOWN = 0;
        // Connection attempt was initiated manually.
        MANUAL = 1;
        // Automatic reconnection to the same network as connected previously.
        RECONNECT_SAME_NETWORK = 2;
        // Automatic reconnection to a saved network, but not the previous one.
        AUTOCONNECT_CONFIGURED_NETWORK = 3;
        // Automatic first connection attempt after device boot.
        AUTOCONNECT_BOOT = 4;
    }

    // True represents a successful connection.
    optional bool connection_result = 1;
    // Reason for the connection failure.
    optional FailureCode failure_code = 2;
    // Scan RSSI before the connection attempt.
    optional int32 rssi = 3;
    // Time taken by this connection attempt.
    optional int32 connection_attempt_duration_millis = 4;
    // Band bucket the connected network is on.
    optional android.net.wifi.WifiBandBucket band = 5;
    // Authentication type.
    optional android.net.wifi.WifiAuthType auth_type = 6;
    // What triggered this connection attempt.
    optional Trigger trigger = 7;
    // Whether this network was used (successfully connected to) previously.
    optional bool network_used = 8;
    // Time taken from the last successful connection (or device boot if that's the first one).
    optional int32 time_since_last_connection_seconds = 9;
    // Whether the connection is carrier wifi.
    optional bool is_carrier_wifi = 10;
    // Whether the OOB pseeudonym is enabled for the current connection.
    optional bool is_oob_pseudonym_enabled = 11;
    // The client mode role for the connection, can use to determine the connection type.
    optional android.net.wifi.ClientModeRole role = 12;
    // The status code specific to each failure code.
    // - For FAILURE_ASSOCIATION_REJECTION, the value should be one of
    //   SupplicantStaIfaceHal.StaIfaceStatusCode.
    // - For FAILURE_NETWORK_DISCONNECTION, the value should be
    //   one of SupplicantStaIfaceHal.StaIfaceReasonCode.
    // - For FAILURE_AUTHENTICATION_EAP, the value should be a EAP failure code.
    // For all other failure codes, this should be 0.
    optional int32 failure_specific_status_code = 13;
    // Information only applicable for EAP networks.
    optional android.net.wifi.EapType eap_type = 14;
    optional android.net.wifi.EapInnerMethod eap_inner_method = 15;
    optional android.net.wifi.RoamingType passpoint_roaming_type = 16;
    // carrier ID of the network
    optional int32 carrier_id = 17;
    optional android.net.wifi.TofuConfiguration tofu_configuration = 18;
}

/**
 * Logs when a Wifi connection drops.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
 */
message WifiDisconnectReported {
    enum FailureCode {
        UNKNOWN = 0;

        // Wifi supplicant failure reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
        // See ISupplicantStaIfaceCallback.java:ReasonCode
        UNSPECIFIED = 1;
        PREV_AUTH_NOT_VALID = 2;
        DEAUTH_LEAVING = 3;
        DISASSOC_DUE_TO_INACTIVITY = 4;
        DISASSOC_AP_BUSY = 5;
        CLASS2_FRAME_FROM_NONAUTH_STA = 6;
        CLASS3_FRAME_FROM_NONASSOC_STA = 7;
        DISASSOC_STA_HAS_LEFT = 8;
        STA_REQ_ASSOC_WITHOUT_AUTH = 9;
        PWR_CAPABILITY_NOT_VALID = 10;
        SUPPORTED_CHANNEL_NOT_VALID = 11;
        BSS_TRANSITION_DISASSOC = 12;
        INVALID_IE = 13;
        MICHAEL_MIC_FAILURE = 14;
        FOURWAY_HANDSHAKE_TIMEOUT = 15;
        GROUP_KEY_UPDATE_TIMEOUT = 16;
        IE_IN_4WAY_DIFFERS = 17;
        GROUP_CIPHER_NOT_VALID = 18;
        PAIRWISE_CIPHER_NOT_VALID = 19;
        AKMP_NOT_VALID = 20;
        UNSUPPORTED_RSN_IE_VERSION = 21;
        INVALID_RSN_IE_CAPAB = 22;
        IEEE_802_1X_AUTH_FAILED = 23;
        CIPHER_SUITE_REJECTED = 24;
        TDLS_TEARDOWN_UNREACHABLE = 25;
        TDLS_TEARDOWN_UNSPECIFIED = 26;
        SSP_REQUESTED_DISASSOC = 27;
        NO_SSP_ROAMING_AGREEMENT = 28;
        BAD_CIPHER_OR_AKM = 29;
        NOT_AUTHORIZED_THIS_LOCATION = 30;
        SERVICE_CHANGE_PRECLUDES_TS = 31;
        UNSPECIFIED_QOS_REASON = 32;
        NOT_ENOUGH_BANDWIDTH = 33;
        DISASSOC_LOW_ACK = 34;
        EXCEEDED_TXOP = 35;
        STA_LEAVING = 36;
        END_TS_BA_DLS = 37;
        UNKNOWN_TS_BA = 38;
        TIMEOUT = 39;
        PEERKEY_MISMATCH = 45;
        AUTHORIZED_ACCESS_LIMIT_REACHED = 46;
        EXTERNAL_SERVICE_REQUIREMENTS = 47;
        INVALID_FT_ACTION_FRAME_COUNT = 48;
        INVALID_PMKID = 49;
        INVALID_MDE = 50;
        INVALID_FTE = 51;
        MESH_PEERING_CANCELLED = 52;
        MESH_MAX_PEERS = 53;
        MESH_CONFIG_POLICY_VIOLATION = 54;
        MESH_CLOSE_RCVD = 55;
        MESH_MAX_RETRIES = 56;
        MESH_CONFIRM_TIMEOUT = 57;
        MESH_INVALID_GTK = 58;
        MESH_INCONSISTENT_PARAMS = 59;
        MESH_INVALID_SECURITY_CAP = 60;
        MESH_PATH_ERROR_NO_PROXY_INFO = 61;
        MESH_PATH_ERROR_NO_FORWARDING_INFO = 62;
        MESH_PATH_ERROR_DEST_UNREACHABLE = 63;
        MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64;
        MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65;
        MESH_CHANNEL_SWITCH_UNSPECIFIED = 66;

        // ClientModeImpl error codes
        // Defined in /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
        IFACE_DESTROYED = 10000;
        WIFI_DISABLED = 10001;
        SUPPLICANT_DISCONNECTED = 10002;
        CONNECTING_WATCHDOG_TIMER = 10003;
        ROAM_WATCHDOG_TIMER = 10004;

        // New reasons tracking disconnections initiated by wifi framework
        DISCONNECT_GENERAL = 10005; // Framework disconnect, generic reason
        // Disconnecting due to unspecified IP reachability lost.
        DISCONNECT_NUD_FAILURE_GENERIC = 10006;
        // Disconnecting due to IP reachability lost from roaming
        DISCONNECT_NUD_FAILURE_ROAM = 10007;
        // Disconnecting due to IP reachability lost from the CONFIRM command
        DISCONNECT_NUD_FAILURE_CONFIRM = 10008;
        // Disconnecting due to IP reachability lost from kernel check
        DISCONNECT_NUD_FAILURE_ORGANIC = 10009;
        // Connectivity no longer wants this network
        DISCONNECT_UNWANTED_BY_CONNECTIVITY = 10010;
        // Timeout creating the IP client
        DISCONNECT_CREATE_IP_CLIENT_TIMEOUT = 10011;
        DISCONNECT_IP_PROVISIONING_FAILURE = 10012; // IP provisioning failure
        DISCONNECT_P2P_REQUESTED_DISCONNECT = 10013; // Disconnect by P2P
        // Network is removed from the WifiConfigManager
        DISCONNECT_NETWORK_REMOVED = 10014;
        DISCONNECT_NETWORK_UNTRUSTED = 10015; // Network is marked as untrusted
        DISCONNECT_NETWORK_METERED = 10016; // Network is marked as metered
        DISCONNECT_TEMP_DISABLED = 10017; // Network is temporarily disabled
        DISCONNECT_PERM_DISABLED = 10018; // Network is permanently disabled
        DISCONNECT_CARRIER_OFFLOAD_DISABLED = 10019;
        // Disconnecting due to Passpoint terms and conditions page
        DISCONNECT_PASSPOINT_TAC = 10020;
        // Disconnecting due to issues with terms and conditions URL
        DISCONNECT_VNC_REQUEST = 10021;
        // Connected to a network that is already removed
        DISCONNECT_UNKNOWN_NETWORK = 10022;
        // User initiated a new connection
        DISCONNECT_NEW_CONNECTION_USER = 10023;
        // New connection triggered by non-user
        DISCONNECT_NEW_CONNECTION_OTHERS = 10024;
    }

    // How long the session lasted from successful connection to disconnect.
    optional int32 connected_duration_seconds = 1;

    // Reason for the disconnect.
    optional FailureCode failure_code = 2;

    // Band bucket the connected network was on.
    optional android.net.wifi.WifiBandBucket band = 3;

    // Authentication type.
    optional android.net.wifi.WifiAuthType auth_type = 4;

    // Last seen RSSI before the disconnect.
    optional int32 last_rssi = 5;

    // Last seen link speed before the disconnect.
    optional int32 last_link_speed = 6;

    // Time since the last RSSI and link speed update.
    // Useful for filtering out very old data
    optional int32 time_since_last_rssi_poll_seconds = 7;

    // Time from the last NETWORK_CONNECTION_EVENT to the disconnect
    optional int32 connected_time_since_last_roam_seconds = 8;

    // The purpose the of the connection
    optional android.net.wifi.ClientModeRole role = 9;

    // The type of EAP authentication. Only applicable for EAP networks.
    optional android.net.wifi.EapType eap_type = 10;

    optional android.net.wifi.EapInnerMethod eap_inner_method = 11;

    optional android.net.wifi.RoamingType passpoint_roaming_type = 12;

    // Carrier id of the network.
    optional int32 carrier_id = 13;
}

/**
 * Logs when Wifi connection is established or dropped.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
 */
message WifiConnectionStateChanged {
    optional bool is_connected = 1 [
            (state_field_option).exclusive_state = true];

    // Band bucket the connected network was on.
    // Filled for both connected and disconnected cases.
    optional android.net.wifi.WifiBandBucket band = 2;

    // Authentication type.
    // Filled for both connected and disconnected cases.
    optional android.net.wifi.WifiAuthType auth_type = 3;
}

/**
 * Logged when wifi peer to peer connection happens
 */
message WifiP2pConnectionReported {
    enum Type {
        UNSPECIFIED = 0;
        // fresh new connection.
        FRESH = 1;
        // reinvoke a group.
        REINVOKE = 2;
        // create a group with the current device as the group owner locally.
        LOCAL = 3;
        // create a group or join a group with config.
        FAST = 4;
    }
    enum FailureCode {
        // Failure is unknown.
        UNKNOWN = 0;
        // No failure.
        NONE = 1;
        // Timeout for current connecting request.
        TIMEOUT = 2;
        // The connecting request is canceled by the user.
        CANCEL = 3;
        // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
        PROV_DISC_FAIL = 4;
        // Invitation failure, e.g. rejected by the peer.
        INVITATION_FAIL = 5;
        // Incoming request is rejected by the user.
        USER_REJECT = 6;
        // New connection request is issued before ending previous connecting request.
        NEW_CONNECTION_ATTEMPT = 7;
        // Group has been removed
        GROUP_REMOVED = 8;
        // Creating group failed
        CREATE_GROUP_FAILED = 9;
    }
    enum GroupRole {
        GROUP_UNKNOWN = 0;
        GROUP_OWNER = 1;
        GROUP_CLIENT = 2;
    }
    enum Band {
        // Unknown band/frequency
        BAND_UNKNOWN = 0;
        // any band
        BAND_AUTO = 1;
        // With 2G band
        BAND_2G = 2;
        // With 5G band
        BAND_5G = 3;
        // With 6G band
        BAND_6G = 4;
        // With a specific frequency
        BAND_FREQUENCY = 5;
    }
    // Type of the connection.
    optional Type type = 1;
    // Duration to connect in millis.
    optional int32 latency_ms= 2;
    // Duration to connect in step size of 200 millis.
    optional int32 latency_200ms= 3;
    // Failure code
    optional FailureCode failure_code = 4;
    // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
    // credential.
    optional GroupRole group_role = 5;
    // Group band preference
    optional Band band = 6;
    // Group frequency in MHz if positive. Otherwise, no frequency preference.
    optional int32 frequency_mhz = 7;
    // STA mode channel frequency. 0 means unknown.
    optional int32 sta_frequency_mhz = 8;
    // The uid of the app that initiates the connection.
    optional int32 uid = 9 [(is_uid) = true];
    // if the country code is in the world mode
    optional bool is_country_code_world_mode = 10;
    // fallback to negotiation if device receives invitation response status code "information is
    // currently unavailable"
    optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 11;
    // The try count of connection
    optional int32 try_count = 12;
}

/**
 * Logged when wifi setup failure or crash reported
 */
message WifiSetupFailureCrashReported {
    enum Type {
        UNKNOWN = 0;
        // Wifi HAL crash
        HAL_CRASH = 1;
        // Wificond crash
        WIFICOND_CRASH = 2;
        // Supplicant crash
        SUPPLICANT_CRASH = 3;
        // hostapd crash
        HOSTAPD_CRASH = 4;
        // HAL error on WifiNative.setupInterfaceForClientMode
        CLIENT_FAILURE_HAL = 5;
        // Wificond error on WifiNative.setupInterfaceForClientMode
        CLIENT_FAILURE_WIFICOND = 6;
        // Supplicant error on WifiNative.setupInterfaceForClientMode
        CLIENT_FAILURE_SUPPLICANT = 7;
        // HAL error on WifiNative.setupInterfaceForSoftApMode
        SOFT_AP_FAILURE_HAL = 8;
        // Wificond error on WifiNative.setupInterfaceForSoftApMode
        SOFT_AP_FAILURE_WIFICOND = 9;
        // Hostapd error on WifiNative.setupInterfaceForSoftApMode
        SOFT_AP_FAILURE_HOSTAPD = 10;
        // HAL error on WifiP2pNative.setupInterface
        P2P_FAILURE_HAL = 11;
        // Supplicant error on WifiP2pNative.setupInterface
        P2P_FAILURE_SUPPLICANT = 12;
    }
    // Type of failure
    optional Type type= 1;
}


/*
 * Logs metrics on bedtime mode state changed
 *
 * Logged From:
 *  frameworks/opt/wear/src/com/google/android/clockwork/healthservices/BedtimeModeController.java
*/
message BedtimeModeStateChanged {
    enum BedTimeModeState {
        BEDTIME_OFF = 0;
        BEDTIME_ON = 1;
    }
    // Log the bedtime mode state
    optional BedTimeModeState bedtime_mode_state = 1;
    enum State {
        OFF = 0;
        ON = 1;
    }
    // Current Wifi state when bedtime mode is toggled
    optional State current_wifi_state = 2;

    // Current LTE state when bedtime mode is toggled
    optional State current_cellular_state = 3;

    // Current BT state when bedtime mode is toggled
    optional State current_bluetooth_state = 4;

    // Current Battery level. Should be in [0, 100].
    optional int32 battery_level = 5;
}

/**
 * Logs when memory stats of a process is reported.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
 */
message ProcessMemoryStatReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    //TODO: remove this when validation is done
    optional int64 version = 9;
    optional int64 pss = 4;
    optional int64 uss = 5;
    optional int64 rss = 6;
    enum Type {
        ADD_PSS_INTERNAL_SINGLE = 0;
        ADD_PSS_INTERNAL_ALL_MEM = 1;
        ADD_PSS_INTERNAL_ALL_POLL = 2;
        ADD_PSS_EXTERNAL = 3;
        ADD_PSS_EXTERNAL_SLOW = 4;
    }
    optional Type type = 7;
    optional int64 duration_millis = 8;

    // The types of the components this process is hosting at the moment this
    // snapshot is taken.
    // See the available types in HostingComponentType in AppProtoEnums.
    optional int32 current_hosting_component_types = 10;

    // The historical types of the components this process is or was hosting
    // since it's born.
    // See the available types in HostingComponentType in AppProtoEnums.
    optional int32 historical_hosting_component_types = 11;
}

/**
 * Logs that a process started, finished, crashed, or ANRed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ProcessLifeCycleStateChanged {
    optional int32 uid = 1 [(is_uid) = true];

    // The process name (usually same as the app name).
    optional string process_name = 2;

    // What lifecycle state the process changed to.
    // This enum is specific to atoms.proto.
    enum State {
        FINISHED = 0;
        STARTED = 1;
        CRASHED = 2;
    }
    optional State state = 3;
}

/**
 * Logs when the ble scan state changes.
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
 */
message BleScanStateChanged {
    repeated AttributionNode attribution_node = 1
            [(state_field_option).primary_field_first_uid = true];

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2 [
        (state_field_option).exclusive_state = true,
        (state_field_option).default_state_value = 0 /* State.OFF */,
        (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
        (state_field_option).nested = true
    ];

    // Does the scan have a filter.
    optional bool is_filtered = 3 [(state_field_option).primary_field = true];
    // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
    optional bool is_first_match = 4 [(state_field_option).primary_field = true];
    // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
    optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
}

/**
 * Logs reporting of a ble scan finding results.
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
 */
// TODO: Consider also tracking per-scanner-id.
message BleScanResultReceived {
    repeated AttributionNode attribution_node = 1;

    // Number of ble scan results returned.
    optional int32 num_results = 2;
}

/**
 * Logs when a sensor state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message SensorStateChanged {
    repeated AttributionNode attribution_node = 1;

    // The id (int) of the sensor.
    optional int32 sensor_id = 2;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 3;
}

/**
 * Logs when GPS signal quality.
 *
 * Logged from:
 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
 */
message GpsSignalQualityChanged {
    optional android.server.location.GpsSignalQualityEnum level = 1;
}


/**
 * Logs when a sync manager sync state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message SyncStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the sync (as named in the app). Can be chosen at run-time.
    optional string sync_name = 2;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 3;
}

/*
 * Deferred job stats.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
*/
message DeferredJobStatsReported {
    repeated AttributionNode attribution_node = 1;

    // Number of jobs deferred.
    optional int32 num_jobs_deferred = 2;

    // Time since the last job runs.
    optional int64 time_since_last_job_millis = 3;
}

/**
 * Logs when a job scheduler job state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
 *   frameworks/base/services/core/java/com/android/server/job/JobServiceContext.java
 *
 * Next tag: 41
 */
message ScheduledJobStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the job (as named in the app)
    optional string job_name = 2;

    enum State {
        // A job started executing (passed through the STARTED state) and has finished.
        FINISHED = 0;
        // A scheduled job has just started executing.
        STARTED = 1;
        // An app just scheduled this job to be executed at some point in the future.
        SCHEDULED = 2;
        // The job was SCHEDULED but cancelled before it started executing (so it never went
        // through the STARTED state).
        CANCELLED = 3;
    }
    optional State state = 3;

    // The internal reason a job has stopped.
    // This is only applicable when the state is FINISHED.
    // The default value is INTERNAL_STOP_REASON_UNKNOWN.
    optional android.app.job.InternalStopReasonEnum internal_stop_reason = 4;

    // The publicly returned reason onStopJob() was called.
    // This is only applicable when the state is FINISHED, but may be undefined if
    // JobService.onStopJob() was never called for the job.
    // The default value is STOP_REASON_UNDEFINED.
    optional android.app.job.StopReasonEnum public_stop_reason = 17;

    // The standby bucket of the app that scheduled the job. These match the framework constants
    // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
    // already assigned 0.
    enum Bucket {
        UNKNOWN = -1;
        ACTIVE = 0;
        WORKING_SET = 1;
        FREQUENT = 2;
        RARE = 3;
        NEVER = 4;
        RESTRICTED = 5;
        EXEMPTED = 6;
    }
    optional Bucket standby_bucket = 5 [default = UNKNOWN];

    // On T- builds, this is the job id (as assigned by the app).
    // On U+ builds, this is generated by the system, factoring in the job's namespace.
    optional int64 job_id = 6;

    // One flag for each of the API constraints defined by JobScheduler. Does not include implicit
    // constraints as they are always assumed to be set.
    optional bool has_charging_constraint = 7;
    optional bool has_battery_not_low_constraint = 8;
    optional bool has_storage_not_low_constraint = 9;
    optional bool has_timing_delay_constraint = 10;
    optional bool has_deadline_constraint = 11;
    optional bool has_idle_constraint = 12;
    optional bool has_connectivity_constraint = 13;
    optional bool has_content_trigger_constraint = 14;
    optional bool is_prefetch = 18;
    optional bool is_periodic = 34;

    // True if the app has requested this run as an expedited job.
    optional bool is_requested_expedited_job = 15;
    // True if the job is running as an expedited job. Only valid for STARTED and FINISHED states.
    optional bool is_running_as_expedited_job = 16;

    // True if the app has requested this run as a user initiated job.
    optional bool is_requested_as_user_initiated_job = 32;
    // True if the job is running as a user initiated job. Only valid for STARTED/FINISHED states.
    optional bool is_running_as_user_initiated_job = 33;

    // The priority set by the app (via JobInfo.Builder.setPriority()).
    optional int32 requested_priority = 19;
    // The priority JobScheduler ran the job at. Only valid for STARTED and FINISHED states.
    optional int32 effective_priority = 20;

    // Number of times JobScheduler has tried to run this particular job. This value is incremented
    // when a job is stopped and rescheduled for various reasons (lost network, constraints no
    // longer satisfied, etc). For periodic jobs, this value is reset after a successful run.
    optional int32 num_previous_attempts = 21;

    // The deadline that the Job has requested.
    // This is only valid if has_deadline_constraint is true.
    optional int64 deadline_ms = 22;

    // The delay that the Job has requested.
    // This is only valid if has_timing_delay_constraint is true.
    optional int64 delay_ms = 35;

    // True if the Job hit its deadline
    optional bool is_deadline_constraint_satisfied = 23;

    optional bool is_charging_constraint_satisfied = 24;

    optional bool is_battery_not_low_constraint_satisfied = 25;

    optional bool is_storage_not_low_constraint_satisfied = 26;

    optional bool is_timing_delay_constraint_satisfied = 27;

    optional bool is_idle_constraint_satisfied = 28;

    optional bool is_connectivity_constraint_satisfied = 29;

    optional bool is_content_trigger_constraint_satisfied = 30;

    // The amount of time that elapsed between the job being scheduled (state = SCHEDULED)
    // and it being started (state = STARTED). Persisted jobs loaded at boot are considered
    // to be scheduled at boot, so all values are within the current boot cycle. Periodic
    // and other rescheduled jobs are considered to be newly scheduled and therefore this
    // value reflects the time since the most recent (re)schedule.
    // This is only valid for the STARTED and FINISHED states.
    optional int64 job_start_latency_ms = 31;

    // The amount of data the app estimated it would download.
    // This is only valid if has_connectivity_constraint is true.
    // If the job has JobWorkItems attached, this value will include the estimates from the items.
    optional int64 estimated_download_bytes = 36;

    // The amount of data the app estimated it would upload.
    // This is only valid if has_connectivity_constraint is true.
    // If the job has JobWorkItems attached, this value will include the estimates from the items.
    optional int64 estimated_upload_bytes = 37;

    // The number of JobWorkItems the app has attached to this job but not completed
    // (by calling JobParameters.completeWork()).
    optional int32 num_uncompleted_work_items = 38;

    // Proc state of the UID of the logged event
    optional android.app.ProcessStateEnum proc_state = 39 [default = PROCESS_STATE_UNKNOWN];

    // Hash of the namespace set via JobScheduler.forNamespace(String).
    optional string namespace_hash = 40;

    // System estimated/measured bytes that the job
    // downloaded over its runtime. Only valid for FINISHED
    // state. We measure here for the SOURCE UID
    optional int64 system_measured_source_download_bytes = 41;

    // System estimated/measured uploaded bytes that the job
    // uploaded over its runtime. Only valid for FINISHED
    // state. We measure here for the SOURCE UID
    optional int64 system_measured_source_upload_bytes = 42;

    // System estimated/measured bytes that the job
    // downloaded over its runtime. Only valid for FINISHED
    // state. We measure here for the CALLING UID
    optional int64 system_measured_calling_download_bytes = 43;

    // System estimated/measured uploaded bytes that the job
    // uploaded over its runtime. Only valid for FINISHED
    // state. We measure here for the CALLING UID
    optional int64 system_measured_calling_upload_bytes = 44;
}

/**
 * Logs when the audio state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message AudioStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the video codec state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message MediaCodecStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the flashlight state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message FlashlightStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the camera state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message CameraStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
 *
 * Logged from:
 *   TODO
 */
message WakelockStateChanged {
    repeated AttributionNode attribution_node = 1
            [(state_field_option).primary_field_first_uid = true];

    // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
    // From frameworks/proto_logging/stats/enums/os/enums.proto.
    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];

    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
    optional string tag = 3 [(state_field_option).primary_field = true];

    enum State {
        RELEASE = 0;
        ACQUIRE = 1;
        CHANGE_RELEASE = 2;
        CHANGE_ACQUIRE = 3;
    }
    optional State state = 4 [
        (state_field_option).exclusive_state = true,
        (state_field_option).default_state_value = 0,
        (state_field_option).nested = true
    ];

    optional android.app.ProcessStateEnum process_state = 5 [default = PROCESS_STATE_UNKNOWN];
}

/**
 * Logs when a partial wakelock is considered 'long' (over 1 min).
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message LongPartialWakelockStateChanged {
    repeated AttributionNode attribution_node = 1;

    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
    optional string tag = 2;

    // TODO: I have no idea what this is.
    optional string history_tag = 3;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 4;
}

/**
 * Logs when the device is interactive, according to the PowerManager Notifier.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
 */
message InteractiveStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * Logs Battery Saver state change.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message BatterySaverModeStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs Doze mode state change.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message DeviceIdleModeStateChanged {
    optional android.server.DeviceIdleModeEnum state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}


/**
 * Logs state change of Doze mode including maintenance windows.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message DeviceIdlingModeStateChanged {
    optional android.server.DeviceIdleModeEnum state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs screen brightness level.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ScreenBrightnessChanged {
    // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
    optional int32 level = 1;
}

/**
 * Logs battery level (percent full, from 0 to 100).
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message BatteryLevelChanged {
    // Battery level. Should be in [0, 100].
    optional int32 battery_level = 1;
}

/**
 * Logs change in charging status of the device.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message ChargingStateChanged {
    // State of the battery, from frameworks/proto_logging/stats/enums/os/enums.proto.
    optional android.os.BatteryStatusEnum state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs whether the device is plugged in, and what power source it is using.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PluggedStateChanged {
    // Whether the device is plugged in, from frameworks/proto_logging/stats/enums/os/enums.proto.
    optional android.os.BatteryPluggedStateEnum state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs whether the device is docked, and what type of dock it is using.
 *
 * Logged from:
 *   services/core/java/com/android/server/power/PowerManagerService.java
 */
message DockStateChanged {
    // The device dock state, from frameworks/proto_logging/stats/enums/server/enums.proto.
    optional android.server.DockStateEnum state = 1
    [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs when an app's wakeup alarm fires.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message WakeupAlarmOccurred {
    repeated AttributionNode attribution_node = 1;

    // Name of the wakeup alarm.
    optional string tag = 2;

    // Name of source package (for historical reasons, since BatteryStats tracked it).
    optional string package_name = 3;

    // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
    optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
}

/**
 * Logs when an an app causes the mobile radio to change state.
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message MobileRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
    optional android.telephony.DataConnectionPowerStateEnum state = 2;
}

/**
 * Logs when an an app causes the wifi radio to change state.
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message WifiRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
    optional android.telephony.DataConnectionPowerStateEnum state = 2;
}

/**
 * Logs kernel wakeup reasons and aborts.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message KernelWakeupReported {
    // Name of the kernel wakeup reason (or abort).
    optional string wakeup_reason_name = 1;

    // Duration (in microseconds) for the wake-up interrupt to be serviced.
    optional int64 duration_micros = 2;

    // The elapsed time when this wake-up was reported.
    optional int64 elapsed_millis = 3;
}

/**
 * Logs when Wifi is toggled on/off.
 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message WifiEnabledStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * This atom is deprecated starting in R.
 *
 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message WifiRunningStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs wifi locks held by an app.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message WifiLockStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    // WifiLock type, from frameworks/proto_logging/stats/enums/wifi/enums.proto.
    optional android.net.wifi.WifiModeEnum mode = 3;
}

/**
 * Logs wifi signal strength changes.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
 */
message WifiSignalStrengthChanged {
    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
    optional android.telephony.SignalStrengthEnum signal_strength = 1;
}

/**
 * Logs wifi scans performed by an app.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
 */
message WifiScanStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs wifi multicast locks held by an app
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
 */
message WifiMulticastLockStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    optional string tag = 3;
}

/**
 * Logs shutdown reason and duration on next boot.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/server/BootReceiver.java
 */
message ShutdownSequenceReported {
    // True if shutdown is for a reboot. Default: false if we do not know.
    optional bool reboot = 1;

    // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
    optional string reason = 2;

    // Beginning of shutdown time in ms using wall clock time since unix epoch.
    // Default: 0 if no start time received.
    optional int64 start_time_millis = 3;

    // Duration of shutdown in ms. Default: 0 if no duration received.
    optional int64 duration_millis = 4;
}


/**
 * Logs boot reason and duration.
 *
 * Logged from:
 *   system/core/bootstat/bootstat.cpp
 */
message BootSequenceReported {
    // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
    // Default: "<EMPTY>" if not available.
    optional string bootloader_reason = 1;

    // Reason for system boot. Eg. bootloader, reboot,userrequested
    // Default: "<EMPTY>" if not available.
    optional string system_reason = 2;

    // End of boot time in ms from unix epoch using system wall clock.
    optional int64 end_time_millis = 3;

    // Total boot duration in ms.
    optional int64 total_duration_millis = 4;

    // Bootloader duration in ms.
    optional int64 bootloader_duration_millis = 5;

    // Time since last boot in ms. Default: 0 if not available.
    optional int64 time_since_last_boot = 6;
}


/**
 * Logs call state and disconnect cause (if applicable).
 *
 * Logged from:
 *   packages/services/Telecomm/src/com/android/server/telecom/Call.java
 */
message CallStateChanged {
    // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
    optional android.telecom.CallStateEnum call_state = 1;

    // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
    // This value is only applicable when the call_state is DISCONNECTED, and
    // should always be UNKNOWN if the call_state is not DISCONNECTED.
    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
    optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;

    // True if the call is self-managed, which are apps that use the
    // telecom infrastructure to make their own calls.
    optional bool self_managed = 3;

    // True if call is external. External calls are calls on connected Wear
    // devices but show up in Telecom so the user can pull them onto the device.
    optional bool external_call = 4;

    // True if call is emergency call.
    optional bool emergency_call = 5;

    // UID of the package that has initiated the call.
    optional int32 uid = 6 [(is_uid) = true];

    // Elapsed time between CALL_STATE_ACTIVE to CALL_STATE_DISCONNECTED.
    // This value is only applicable when the call_state is DISCONNECTED,
    // 0 otherwise.
    optional int32 duration_seconds = 7;

    // Number of all existing calls when this call is created.
    optional int32 existing_call_count = 8;

    // Number of existing calls held by this call.
    // This value is set after a call is actually held, 0 otherwise.
    optional int32 held_call_count = 9;

    // The reason the call hasn't been started by device condition.
    // This value is only applicable when the call_state is DISCONNECTED,
    // and should always be NONE if the call_state is not DISCONNECTED.
    // From frameworks/base/core/proto/android/telecomm/enums.proto.
    optional android.telecom.CallFailureCauseEnum start_fail_cause = 10;
}

/*
 * Logs changes to the configuration of the device. The configuration is defined
 * in frameworks/base/core/java/android/content/res/Configuration.java
 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
 * Please go there to interpret the possible values each field can be.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message ResourceConfigurationChanged {
    // Bit mask of color capabilities of the screen.
    // Contains information about the color gamut and hdr mode of the screen.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
    optional int32 color_mode = 1;

    // The target screen density being rendered to.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
    optional int32 density_dpi = 2;

    // Current user preference for the scaling factor for fonts,
    // relative to the base density scaling.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
    optional float font_scale = 3;

    // Flag indicating whether the hard keyboard is hidden.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
    optional int32 hard_keyboard_hidden = 4;

    // The type of keyboard attached to the device.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
    optional int32 keyboard = 5;

    // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
    optional int32 keyboard_hidden = 6;

    // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
    // 0 if undefined.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
    optional int32 mcc = 7;

    // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
    // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
    // MNC_ZERO symbol defined in Configuration.java.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
    optional int32 mnc = 8;

    // The kind of navigation available on the device.
    // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
    optional int32 navigation = 9;

    // Flag indicating whether the navigation is available.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
    optional int32 navigation_hidden = 10;

    // Overall orientation of the screen.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
    optional int32 orientation = 11;

    // The current height of the available screen space, in dp units.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
    optional int32 screen_height_dp = 12;

    // Bit mask of overall layout of the screen.
    // Contains information about screen size, whether the screen is wider/taller
    // than normal, whether the screen layout is right-tl-left or left-to-right,
    // and whether the screen has a rounded shape.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
    optional int32 screen_layout = 13;

    // Current width of the available screen space, in dp units.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
    optional int32 screen_width_dp = 14;

    // The smallest screen size an application will see in normal operation.
    // This is the smallest value of both screenWidthDp and screenHeightDp
    // in portrait and landscape.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
    optional int32 smallest_screen_width_dp = 15;

    // The type of touch screen attached to the device.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
    optional int32 touchscreen = 16;

    // Bit mask of the ui mode.
    // Contains information about the overall ui mode of the device.
    // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
    // Also contains information about whether the device is in night mode.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
    optional int32 ui_mode = 17;
}


/**
 * Logs changes in the connection state of the mobile radio.
 *
 * Logged from:
 *    frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
 */
message MobileConnectionStateChanged {
    // States are from the state machine DataConnection.java.
    enum State {
        UNKNOWN = 0;
        // The connection is inactive, or disconnected.
        INACTIVE = 1;
        // The connection is being activated, or connecting.
        ACTIVATING = 2;
        // The connection is active, or connected.
        ACTIVE = 3;
        // The connection is disconnecting.
        DISCONNECTING = 4;
        // The connection is disconnecting after creating a connection.
        DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
    }
    optional State state  = 1;
    // For multi-sim phones, this distinguishes between the sim cards.
    optional int32 sim_slot_index = 2;
    // Used to identify the connection. Starts at 0 and increments by 1 for
    // every new network created. Resets whenever the device reboots.
    optional int32 data_connection_id = 3;
    // A bitmask for the capabilities of this connection.
    // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
    // Default value (if we have no information): 0
    optional int64 capabilities = 4;
    // If this connection has internet.
    // This just checks if the DEFAULT bit of capabilities is set.
    optional bool has_internet = 5;
}

/**
 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
 */
message MobileRadioTechnologyChanged {
    optional android.telephony.NetworkTypeEnum state = 1;
    // For multi-sim phones, this distinguishes between the sim cards.
    optional int32 sim_slot_index = 2;
}

/**
 * Logs the VID and PID of any connected USB devices.
 *
 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
 *
 * Logged by Vendor.
 */
message UsbDeviceAttached {
    optional int32 vid = 1;
    optional int32 pid = 2;
    optional bool has_audio = 3;
    optional bool has_hid = 4;
    optional bool has_storage = 5;
    enum State {
        STATE_DISCONNECTED = 0;
        STATE_CONNECTED = 1;
    }
    optional State state = 6;
    optional int64 last_connect_duration_millis = 7;
}


/**
 * Logs when Bluetooth is enabled and disabled.
 *
 * Logged from:
 *   services/core/java/com/android/server/BluetoothManagerService.java
 */
message BluetoothEnabledStateChanged {
    repeated AttributionNode attribution_node = 1;
    // Whether or not bluetooth is enabled on the device.
    enum State {
        UNKNOWN = 0;
        ENABLED = 1;
        DISABLED = 2;
    }
    optional State state = 2;
    // The reason for being enabled/disabled.
    // Eg. Airplane mode, crash, application request.
    optional android.bluetooth.EnableDisableReasonEnum reason = 3;
    // If the reason is an application request, this will be the package name.
    optional string pkg_name = 4;
}

/**
 * Logs when profiles on a Bluetooth device connects and disconnects.
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
 *
 * Next Tag: 6
 */
message BluetoothConnectionStateChanged {
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 1;
    // An identifier that can be used to match connect and disconnect events.
    // Currently is last two bytes of a hash of a device level ID and
    // the mac address of the bluetooth device that is connected.
    // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
    optional int32 obfuscated_id = 2 [deprecated = true];
    // The profile that is connected. Eg. GATT, A2DP, HEADSET.
    // From android.bluetooth.BluetoothAdapter.java
    // Default: 0 when not used
    optional int32 bt_profile = 3;
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
    // An index to group connection events by session. It's a counter generated by
    // each profile. e.g. Gatt server generate such id to identify Gatt apps
    optional int32 session_index = 6;
    // An identifier that indicates the connection failure reason
    optional int32 connection_reason = 7;
}

/**
 * Logs when a Bluetooth device connects and disconnects over ACL
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
 *
 * Next Tag: 4
 */
message BluetoothAclConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 2;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 3;
    // Used transport of this event.
    optional android.bluetooth.TransportTypeEnum transport = 4;
}

/**
 * Logs when a Bluetooth device connects and disconnects over SCO
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
 *
 * Next Tag: 5
 */
message BluetoothScoConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 2;
    // Codec used for this SCO connection
    // Default: UNKNOWN
    optional android.bluetooth.hfp.ScoCodec codec = 3;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 4;
}

/**
 * Logged when active device of a profile changes
 *
 * Logged from:
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
 */
message BluetoothActiveDeviceChanged {
    // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
    // From android.bluetooth.BluetoothProfile
    optional int32 bt_profile = 1;
    // An identifier that can be used to match events for this new active device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if there is no active device for this profile
    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 3;
}

// Logs when there is an event affecting Bluetooth device's link layer connection.
// - This event is triggered when there is a related HCI command or event
// - Users of this metrics can deduce Bluetooth device's connection state from these events
// - HCI commands are logged before the command is sent, after receiving command status, and after
//   receiving command complete
// - HCI events are logged when they arrive
//
// Low level log from system/bt
//
// Bluetooth classic commands:
// - CMD_CREATE_CONNECTION
// - CMD_DISCONNECT
// - CMD_CREATE_CONNECTION_CANCEL
// - CMD_ACCEPT_CONNECTION_REQUEST
// - CMD_REJECT_CONNECTION_REQUEST
// - CMD_SETUP_ESCO_CONNECTION
// - CMD_ACCEPT_ESCO_CONNECTION
// - CMD_REJECT_ESCO_CONNECTION
// - CMD_ENH_SETUP_ESCO_CONNECTION
// - CMD_ENH_ACCEPT_ESCO_CONNECTION
//
// Bluetooth low energy commands:
// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
// - CMD_BLE_CLEAR_WHITE_LIST
// - CMD_BLE_ADD_WHITE_LIST
// - CMD_BLE_REMOVE_WHITE_LIST
//
// Bluetooth classic events:
// - EVT_CONNECTION_COMP
// - EVT_CONNECTION_REQUEST
// - EVT_DISCONNECTION_COMP
// - EVT_ESCO_CONNECTION_COMP
// - EVT_ESCO_CONNECTION_CHANGED
//
// Bluetooth low energy meta events:
// - BLE_EVT_CONN_COMPLETE_EVT
// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
//
// Next tag: 10
message BluetoothLinkLayerConnectionEvent {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // Direction of the link
    // Default: DIRECTION_UNKNOWN
    optional android.bluetooth.DirectionEnum direction = 3;
    // Type of this link
    // Default: LINK_TYPE_UNKNOWN
    optional android.bluetooth.LinkTypeEnum type = 4;

    // Reason metadata for this link layer connection event, rules for interpretation:
    // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
    //    EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
    // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
    //    set and valid, ignore hci_ble_event

    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
    // HCI event associated with this event
    // Default: EVT_UNKNOWN
    optional android.bluetooth.hci.EventEnum hci_event = 6;
    // HCI BLE meta event associated with this event
    // Default: BLE_EVT_UNKNOWN
    optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 8;
    // HCI reason code associated with this event
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum reason_code = 9;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 10;
}

/**
 * Logs when a module is rolled back by Watchdog.
 *
 * Logged from: Rollback Manager
 */
message WatchdogRollbackOccurred {
    enum RollbackType {
        UNKNOWN = 0;
        ROLLBACK_INITIATE = 1;
        ROLLBACK_SUCCESS = 2;
        ROLLBACK_FAILURE = 3;
        ROLLBACK_BOOT_TRIGGERED = 4;
    }
    optional RollbackType rollback_type = 1;

    optional string package_name = 2;

    optional int32 package_version_code = 3;

    enum RollbackReasonType {
        REASON_UNKNOWN = 0;
        REASON_NATIVE_CRASH = 1;
        REASON_EXPLICIT_HEALTH_CHECK = 2;
        REASON_APP_CRASH = 3;
        REASON_APP_NOT_RESPONDING = 4;
        REASON_NATIVE_CRASH_DURING_BOOT = 5;
    }
    optional RollbackReasonType rollback_reason = 4;

    // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
    // is initiated. Empty if the package is unknown.
    optional string failing_package_name = 5;

    optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when there is a change in Bluetooth A2DP playback state
 *
 * Logged from:
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpPlaybackStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Current playback state
    // Default: PLAYBACK_STATE_UNKNOWN
    optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
    // Current audio coding mode
    // Default: AUDIO_CODING_MODE_UNKNOWN
    optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 4;
}

/**
 * Logs when there is a change in A2DP codec config for a particular remote device
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpCodecConfigChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
    // Default SOURCE_CODEC_TYPE_INVALID
    optional int32 codec_type = 2;
    // Codec priroity, the higher the more preferred, -1 for disabled
    // Default: CODEC_PRIORITY_DEFAULT
    optional int32 codec_priority = 3;
    // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
    // Default: SAMPLE_RATE_NONE
    optional int32 sample_rate = 4;
    // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
    // Default: BITS_PER_SAMPLE_NONE
    optional int32 bits_per_sample = 5;
    // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
    // Default: CHANNEL_MODE_NONE
    optional int32 channel_mode = 6;
    // Codec specific values
    // Default 0
    optional int64 codec_specific_1 = 7;
    optional int64 codec_specific_2 = 8;
    optional int64 codec_specific_3 = 9;
    optional int64 codec_specific_4 = 10;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 11;
}

/**
 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
 * Each codec's capability is logged separately due to statsd restriction
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpCodecCapabilityChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
    // Default SOURCE_CODEC_TYPE_INVALID
    optional int32 codec_type = 2;
    // Codec priroity, the higher the more preferred, -1 for disabled
    // Default: CODEC_PRIORITY_DEFAULT
    optional int32 codec_priority = 3;
    // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
    // in BluetoothCodecConfig
    // Default: empty and SAMPLE_RATE_NONE for individual item
    optional int32 sample_rate = 4;
    // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
    // in BluetoothCodecConfig
    // Default: empty and BITS_PER_SAMPLE_NONE for individual item
    optional int32 bits_per_sample = 5;
    // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
    // BluetoothCodecConfig
    // Default: empty and CHANNEL_MODE_NONE for individual item
    optional int32 channel_mode = 6;
    // Codec specific values
    // Default 0
    optional int64 codec_specific_1 = 7;
    optional int64 codec_specific_2 = 8;
    optional int64 codec_specific_3 = 9;
    optional int64 codec_specific_4 = 10;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 11;
}

/**
 * Logs when A2DP failed to read from PCM source.
 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
 *
 * Logged from:
 *     system/bt
 */
message BluetoothA2dpAudioUnderrunReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Encoding interval in nanoseconds
    // Default: 0
    optional int64 encoding_interval_nanos = 2;
    // Number of bytes of PCM data that could not be read from the source
    // Default: 0
    optional int32 num_missing_pcm_bytes = 3;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 4;
}

/**
 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
 * buffer queue is full and we have to drop data
 *
 * Logged from:
 *     system/bt
 */
message BluetoothA2dpAudioOverrunReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Encoding interval in nanoseconds
    // Default: 0
    optional int64 encoding_interval_nanos = 2;
    // Number of buffers dropped in this event
    // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
    // Default: 0
    optional int32 num_dropped_buffers = 3;
    // Number of encoded buffers dropped in this event
    // Default 0
    optional int32 num_dropped_encoded_frames = 4;
    // Number of encoded bytes dropped in this event
    // Default: 0
    optional int32 num_dropped_encoded_bytes = 5;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 6;
}

/**
 * Logs when we receive reports regarding a device's RSSI value
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceRssiReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 3;
    // BR/EDR
    //   Range: -128 ≤ N ≤ 127 (signed integer)
    //   Units: dB
    // LE:
    //   Range: -127 to 20, 127 (signed integer)
    //   Units: dBm
    // Invalid when an out of range value is reported
    optional int32 rssi = 4;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
}

/**
 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceFailedContactCounterReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 3;
    // Number of consecutive failed contacts for a connection corresponding to the Handle
    // Range: uint16_t, 0-0xFFFF
    // Default: 0xFFFFF
    optional int32 failed_contact_counter = 4;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
}

/**
 * Logs when we receive reports regarding the tranmit power level used for a specific connection
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceTxPowerLevelReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggered by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 3;
    // Range: -30 ≤ N ≤ 20
    // Units: dBm
    // Invalid when an out of range value is reported
    optional int32 transmit_power_level = 4;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
}

/**
 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
 * receiving an HCI command from the host
 *
 * Logged from: system/bt
 */
message BluetoothHciTimeoutReported {
    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_command = 1;
}

/**
 * Logs when we receive Bluetooth Link Quality Report event from the controller
 * See Android Bluetooth HCI specification for more details
 *
 * Note: all count and bytes field are counted since last event
 *
 * Logged from: system/bt
 */
message BluetoothQualityReportReported {
    // Quality report ID
    // Original type: uint8_t
    // Default: BQR_ID_UNKNOWN
    optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
    // Packet type of the connection
    // Original type: uint8_t
    // Default: BQR_PACKET_TYPE_UNKNOWN
    optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
    // Connection handle of the connection
    // Original type: uint16_t
    optional int32 connection_handle = 3;
    // Performing Role for the connection
    // Original type: uint8_t
    optional int32 connection_role = 4;
    // Current Transmit Power Level for the connection. This value is the same as the controller's
    // response to the HCI_Read_Transmit_Power_Level HCI command
    // Original type: uint8_t
    optional int32 tx_power_level = 5;
    // Received Signal Strength Indication (RSSI) value for the connection. This value is an
    // absolute receiver signal strength value
    // Original type: int8_t
    optional int32 rssi = 6;
    // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
    // channels used by the link currently
    // Original type: uint8_t
    optional int32 snr = 7;
    // Indicates the number of unused channels in AFH_channel_map
    // Original type: uint8_t
    optional int32 unused_afh_channel_count = 8;
    // Indicates the number of the channels which are interfered and quality is bad but are still
    // selected for AFH
    // Original type: uint8_t
    optional int32 afh_select_unideal_channel_count = 9;
    // Current Link Supervision Timeout Setting
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint16_t
    optional int32 lsto = 10;
    // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
    // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
    // 0x01 (Piconet Clock)
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 connection_piconet_clock = 11;
    // The count of retransmission
    // Original type: uint32_t
    optional int64 retransmission_count = 12;
    // The count of no RX
    // Original type: uint32_t
    optional int64 no_rx_count = 13;
    // The count of NAK (Negative Acknowledge)
    // Original type: uint32_t
    optional int64 nak_count = 14;
    // Controller timestamp of last TX ACK
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 last_tx_ack_timestamp = 15;
    // The count of Flow-off (STOP)
    // Original type: uint32_t
    optional int64 flow_off_count = 16;
    // Controller timestamp of last Flow-on (GO)
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 last_flow_on_timestamp = 17;
    // Buffer overflow count (how many bytes of TX data are dropped) since the last event
    // Original type: uint32_t
    optional int64 buffer_overflow_bytes = 18;
    // Buffer underflow count (in byte) since last event
    // Original type: uint32_t
    optional int64 buffer_underflow_bytes = 19;
}

/**
 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
 *
 * Notes:
 * - Each event can be partially filled as we might learn different pieces of device
 *   information at different time
 * - Multiple device info events can be combined to give more complete picture
 * - When multiple device info events tries to describe the same information, the
 *   later one wins
 *
 * Logged from:
 *     packages/apps/Bluetooth
 */
message BluetoothDeviceInfoReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Where is this device info obtained from
    optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
    // Name of the data source
    // For EXTERNAL: package name of the data source
    // For INTERNAL: null for general case, component name otherwise
    optional string source_name = 3;
    // Name of the manufacturer of this device
    optional string manufacturer = 4;
    // Model of this device
    optional string model = 5;
    // Hardware version of this device
    optional string hardware_version = 6;
    // Software version of this device
    optional string software_version = 7;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 8;
    // A flag indicating if the MAC address of the remote device is public or
    // random.
    optional android.bluetooth.AddressTypeEnum address_type = 9;
    // The first byte of MAC address
    optional int32 byte1 = 10;
    // The second byte of MAC address
    optional int32 byte2 = 11;
    // The third byte of MAC address
    optional int32 byte3 = 12;

}

/**
 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
 * device, as documented by the Bluetooth Core HCI specification
 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
 * Vol 2, Part E, Page 1118
 *
 * Logged from:
 *     system/bt
 */
message BluetoothRemoteVersionInfoReported {
    // Connection handle of the connection
    // Original type: uint16_t
    optional int32 connection_handle = 1;
    // HCI command status code
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 2;
    // 1 byte Version of current LMP in the remote controller
    optional int32 lmp_version = 3;
    // 2 bytes LMP manufacturer code of the remote controller
    // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
    optional int32 lmp_manufacturer_code = 4;
    // 4 bytes subversion of the LMP in the remote controller
    optional int32 lmp_subversion = 5;
}

/**
 * Logs when certain Bluetooth SDP attributes are discovered
 * Constant definitions are from:
 *     https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
 *
 * Current logged attributes:
 * - BluetoothProfileDescriptorList
 * - Supported Features Bitmask
 *
 * Logged from:
 *     system/bt
 */
message BluetoothSdpAttributeReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
    // Original type: uint16_t
    optional int32 protocol_uuid = 2;
    // Short form UUIDs used to identify Bluetooth SDP attribute types
    // Original type: uint16_t
    optional int32 attribute_id = 3;
    // Attribute value for the particular attribute
    optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
}

/**
* Logs the user created Bluetooth device's name.
* It is pushed at Bluetooth pairing and connection.
*
* Logged from:
*     packages/modules/Bluetooth
*/
message BluetoothDeviceNameReported {
   // An identifier that can be used to match events for this device.
   // The incremental identifier is locally generated and guaranteed not derived
   // from any globally unique hardware id.
   // For paired devices, it stays consistent between Bluetooth toggling for the
   // same remote device.
   // For unpaired devices, it stays consistent within the same Bluetooth adapter
   // session for the same remote device.
   // Default: 0 if the device's metric id is unknown.
   optional int32 metric_id = 1;

   // Name of the Bluetooth device. It is created by the user.
   optional string device_name = 2;
}

/**
 * Logs when bond state of a Bluetooth device changes
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
 */
message BluetoothBondStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Preferred transport type to remote dual mode device
    // Default: TRANSPORT_AUTO means no preference
    optional android.bluetooth.TransportTypeEnum transport = 2;
    // The type of this Bluetooth device (Classic, LE, or Dual mode)
    // Default: UNKNOWN
    optional android.bluetooth.DeviceTypeEnum type = 3;
    // Current bond state (NONE, BONDING, BONDED)
    // Default: BOND_STATE_UNKNOWN
    optional android.bluetooth.BondStateEnum bond_state = 4;
    // Bonding sub state
    // Default: BOND_SUB_STATE_UNKNOWN
    optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
    // Unbond Reason
    // Default: UNBOND_REASON_UNKNOWN
    optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 7;
}

/**
 * Logs there is an event related Bluetooth classic pairing
 *
 * Logged from:
 *     system/bt
 */
message BluetoothClassicPairingEventReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
    // HCI event associated with this event
    // Default: EVT_UNKNOWN
    optional android.bluetooth.hci.EventEnum hci_event = 4;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 5;
    // HCI reason code associated with this event
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum reason_code = 6;
    // A status value related to this specific event
    // Default: 0
    optional int64 event_value = 7;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 8;
}

/**
 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
 *
 * Logged from:
 *     system/bt
 */
message BluetoothSmpPairingEventReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // SMP command sent or received over L2CAP
    // Default: CMD_UNKNOWN
    optional android.bluetooth.smp.CommandEnum smp_command = 2;
    // Whether this command is sent or received
    // Default: DIRECTION_UNKNOWN
    optional android.bluetooth.DirectionEnum direction = 3;
    // SMP failure reason code
    // Default: PAIRING_FAIL_REASON_DEFAULT
    optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 5;
}

/**
 * Logs when a Bluetooth socket’s connection state changed
 *
 * Logged from:
 *   system/bt
 */
message BluetoothSocketConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if this is a server listener socket
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Temporary port of this socket for the current connection or session only
    // Default 0 when unknown or don't care
    optional int32 port = 2;
    // Socket type as mentioned in
    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
    // Default: SOCKET_TYPE_UNKNOWN
    optional android.bluetooth.SocketTypeEnum type = 3;
    // Socket connection state
    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
    optional android.bluetooth.SocketConnectionstateEnum state = 4;
    // Number of bytes sent to remote device during this connection
    optional int64 tx_bytes = 5;
    // Number of bytes received from remote device during this connection
    optional int64 rx_bytes = 6;
    // Socket owner's UID
    optional int32 uid = 7 [(is_uid) = true];
    // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
    // |port| must be spawned by |server_port|
    // Default 0 when unknown or don't care
    optional int32 server_port = 8;
    // Whether this is a server listener socket
    optional android.bluetooth.SocketRoleEnum is_server = 9;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 10;
}

/**
 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
 *
 */
message BluetoothClassOfDeviceReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if this is a server listener socket
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Class of Device (CoD) value including both Major, Minor device class and service class
    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
    // Default: 0
    optional int32 class_of_device = 2;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 3;
}

/**
 * Logs when there is a crash in hardware abstraction layer (HAL)
 *
 * Logged from:
 *   system/bt
 *
 */
message BluetoothHALCrashReasonReported {
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 1;
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Bluetooth HAL crash reason error code.
    // Original type: uint8_t
    // Default: 0x00 (DEFAULT)
    optional int32 error_code = 3;
    // Bluetooth HAL crash reason vendor error code.
    // Original type: uint8_t
    // Default: 0x00 (DEFAULT)
    optional int32 vendor_error_code = 4;
}

/**
 * Logs when an LE Audio connection session ended
 *
 * Logged from:
 *   packages/modules/Bluetooth
 *
 */
message LeAudioConnectionSessionReported {
    // Size of this CSIS group
    optional int32 group_size = 1;
    // An identifier that can be used to match events for this CSIS group.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired groups, it stays consistent between Bluetooth toggling for the
    // same remote group.
    // For unpaired groups, it stays consistent within the same Bluetooth adapter
    // session for the same remote group.
    // Default: 0 if the group's metric id is unknown.
    optional int32 group_metric_id = 2;
    // Total duration of this LeAudioConnectionSession
    optional int64 duration_nanos = 3;

    // Connecting timestamp offset to the beginning of this session of each device session
    repeated int64 device_connecting_offset_nanos = 4;
    // Connected timestamp offset to the beginning of this session of each device session
    repeated int64 device_connected_offset_nanos = 5;
    // Duration of each device session
    repeated int64 device_connection_duration_nanos = 6;
    // Connection status of each device session
    repeated android.bluetooth.leaudio.ConnectionStatus device_connection_status = 7;
    // Disconnection status of each device session
    repeated android.bluetooth.leaudio.ConnectionStatus device_disconnection_status = 8;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    repeated int32 device_metric_id = 9;

    // Streaming beginning timestamp offset to the beginning of this session
    repeated int64 streaming_session_offset_nanos = 10;
    // Streaming ending timestamp offset to the beginning of this session
    repeated int64 streaming_session_duration_nanos = 11;
    // Streaming context type of each steaming session
    repeated android.bluetooth.leaudio.ContextType streaming_context_type = 12;
}

/**
 * Logs when an LE Audio broadcast session ended
 *
 * Logged from:
 *   packages/modules/Bluetooth
 *
 */
message LeAudioBroadcastSessionReported {
    // Broadcast duration
    optional int64 duration_nanos = 1;
}

/**
 * Logs when the counter is incremented
 *
 * Logged from:
 *   system/bt
 *   packages/apps/Bluetooth
 *
 */
message BluetoothCodePathCounter {
    // Keys of events with enum ranges to be defined
    optional android.bluetooth.CodePathCounterKeyEnum key = 1;
    // Number of frequency of events
    optional int64 number = 2;
}

/**
 * Logs when an application attempts to start a Bluetooth Low Energy scan.
 * It only happens when the scan is initiated and does not repeatedly call
 * while the scan is running.
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/GattService.java
 *
 */
message BluetoothLeBatchScanReportDelay {
    optional int32 application_uid = 1;
    optional int64 application_report_delay_millis = 2;
}

message BluetoothLocalVersionsReported {
    // Chip Manufacturer name
    optional int32 lmp_manufacturer_name = 1;
    // LMP Version
    optional int32 lmp_version = 2;
    // LMP Subversion
    optional int32 lmp_subversion = 3;
    // HCI Version
    optional int32 hci_version = 4;
    // HCI Revision
    optional int32 hci_revision = 5;
}

message BluetoothRemoteSupportedFeaturesReported {
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 1;
    // Page of the feature bit masks
    optional int32 page = 2;
    // Bit mask of features
    optional int64 features_page2 = 3;
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 4;
}

message BluetoothLocalSupportedFeaturesReported {
    // Page of the feature bit masks
    optional int32 page_num = 1;
    // Bit mask of features
    optional int64 features_page = 2;
}

message BluetoothDisconnectionReasonReported {
    // Disconnection reason
    optional int32 reason = 1;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 2;
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 3;
}

message BluetoothGattAppInfo {
    // An index to group connection events by session. It's a counter generated by
    // each profile. e.g. Gatt server generate such id to identify Gatt apps
    optional int32 session_index = 1;
    // An identifier that can be used to match events for this device.
    // The incremental identifier is locally generated and guaranteed not derived
    // from any globally unique hardware id.
    // For paired devices, it stays consistent between Bluetooth toggling for the
    // same remote device.
    // For unpaired devices, it stays consistent within the same Bluetooth adapter
    // session for the same remote device.
    // Default: 0 if the device's metric id is unknown.
    optional int32 metric_id = 2;
    // UID of the GATT app
    optional int32 uid = 3 [(is_uid) = true];
}

/**
 * Logs when something is plugged into or removed from the USB-C connector.
 *
 * Logged from:
 *  UsbService
 */
message UsbConnectorStateChanged {
    enum State {
        STATE_DISCONNECTED = 0;
        STATE_CONNECTED = 1;
    }
    optional State state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
    optional string id = 2 [(state_field_option).primary_field = true];
    // Last active session in ms.
    // 0 when the port is in connected state.
    optional int64 last_connect_duration_millis = 3;
}

/**
 * Logs the reported speaker impedance.
 *
 * Logged from:
 *  Vendor audio implementation.
 */
message SpeakerImpedanceReported {
    optional int32 speaker_location = 1;
    optional int32 impedance = 2;
}

/**
 * Logs the report of a failed hardware.
 *
 * Logged from:
 *  Vendor HALs.
 *
 */
message HardwareFailed {
    enum HardwareType {
        HARDWARE_FAILED_UNKNOWN = 0;
        HARDWARE_FAILED_MICROPHONE = 1;
        HARDWARE_FAILED_CODEC = 2;
        HARDWARE_FAILED_SPEAKER = 3;
        HARDWARE_FAILED_FINGERPRINT = 4;
    }
    optional HardwareType hardware_type = 1;

   /**
    * hardware_location allows vendors to differentiate between multiple instances of
    * the same hardware_type.  The specific locations are vendor defined integers,
    * referring to board-specific numbering schemes.
    */
    optional int32 hardware_location = 2;

    /**
     * failure_code is specific to the HardwareType of the failed hardware.
     * It should use one of the enum values defined below.
     */
    enum HardwareErrorCode {
        UNKNOWN = 0;
        COMPLETE = 1;
        SPEAKER_HIGH_Z = 2;
        SPEAKER_SHORT = 3;
        FINGERPRINT_SENSOR_BROKEN = 4;
        FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
        DEGRADE = 6;
    }
    optional int32 failure_code = 3;
}

/**
 * Log an event when the device has been physically dropped.
 * Reported from the /vendor partition.
 */
message PhysicalDropDetected {
    // Confidence that the event was actually a drop, 0 -> 100
    optional int32 confidence_pctg = 1;
    // Peak acceleration of the drop, in 1/1000s of a g.
    optional int32 accel_peak_thousandths_g = 2;
    // Duration of freefall in ms
    optional int32 freefall_time_millis = 3;
}

/**
 * Log bucketed battery charge cycles.
 *
 * Each bucket represents cycles of the battery past
 * a given charge point.  For example, if 10 cycle buckets are
 * initialized, bucket 1 is the lowest 1/10th of the battery,
 * and bucket 10 is 100%.
 *
 * Logged from:
 * /sys/class/power_supply/bms/cycle_count, via Vendor.
 */
message ChargeCyclesReported {
    optional int32 cycle_bucket_1 = 1;
    optional int32 cycle_bucket_2 = 2;
    optional int32 cycle_bucket_3 = 3;
    optional int32 cycle_bucket_4 = 4;
    optional int32 cycle_bucket_5 = 5;
    optional int32 cycle_bucket_6 = 6;
    optional int32 cycle_bucket_7 = 7;
    optional int32 cycle_bucket_8 = 8;
    optional int32 cycle_bucket_9 = 9;
    optional int32 cycle_bucket_10 = 10;
}

/**
 * Log battery health snapshot.
 *
 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
 * are snapshotted periodically over 24hrs.
 */
message BatteryHealthSnapshot {
    enum BatterySnapshotType {
        UNKNOWN = 0;
        MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
        MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
        MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
        MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
        MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
        MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
        MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
        MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
        MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
        MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
        AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
    }
    optional BatterySnapshotType type = 1;
    // Temperature, in 1/10ths of degree C.
    optional int32 temperature_deci_celsius = 2;
    // Voltage Battery Voltage, in microVolts.
    optional int32 voltage_micro_volt = 3;
    // Current Battery current, in microAmps.
    optional int32 current_micro_amps = 4;
    // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
    optional int32 open_circuit_micro_volt = 5;
    // Resistance Battery Resistance, in microOhms.
    optional int32 resistance_micro_ohm = 6;
    // Level Battery Level, as % of full.
    optional int32 level_percent = 7;
}

/**
 * Log slow I/O operations on the primary storage.
 */
message SlowIo {
    // Classifications of IO Operations.
    enum IoOperation {
        UNKNOWN = 0;
        READ = 1;
        WRITE = 2;
        UNMAP = 3;
        SYNC = 4;
    }
    optional IoOperation operation = 1;

    // The number of slow IO operations of this type over 24 hours.
    optional int32 count = 2;
}

/**
 * Log battery caused shutdown with the last recorded voltage.
 */
message BatteryCausedShutdown {
    // The last recorded battery voltage prior to shutdown.
    optional int32 last_recorded_micro_volt = 1;
}

/**
 * Logs when ThermalService receives throttling events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
 */
message ThermalThrottlingSeverityStateChanged {
    // The type of temperature being reported (CPU, GPU, SKIN, etc)
    optional android.os.TemperatureTypeEnum sensor_type = 1;

    // The name of the temperature source. Eg. CPU0
    optional string sensor_name = 2;

    // Temperature in tenths of a degree C.
    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
    optional int32 temperature_deci_celsius = 3;

    // Relative severity of the throttling, see enum definition.
    optional android.os.ThrottlingSeverityEnum severity = 4;
}

/**
 * Logs phone signal strength changes.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PhoneSignalStrengthChanged {
    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
    optional android.telephony.SignalStrengthEnum signal_strength = 1;
}


/**
 * Logs when the phone state, sim state or signal strength changes
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PhoneServiceStateChanged {
    optional android.telephony.ServiceStateEnum state = 1;
    optional android.telephony.SimStateEnum sim_state = 2;
    optional android.telephony.SignalStrengthEnum signal_strength = 3;
}

/**
 * Logs when the phone becomes on or off.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
 */
message PhoneStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

message ExclusionRectStateChanged {
    optional string component_name = 1;    // if not available, simply packageName
    optional int32 requested_height = 2;   // px
    optional int32 rejected_height = 3;    // px

    enum WindowHorizontalLocation {
        DEFAULT_LOCATION = 0;
        LEFT = 1;
        RIGHT = 2;
    }
    optional WindowHorizontalLocation x_location = 4;
    optional bool landscape = 5;
    optional bool splitscreen = 6 [deprecated = true];
    optional int32 duration_millis = 7;
}

/**
 * Logs when Wallpaper or ThemePicker UI has changed.
 *
 * Logged from:
 *   packages/apps/ThemePicker
 *   packages/apps/WallpaperPicker2
 */
message StyleUIChanged {
    optional android.stats.style.Action action = 1;
    optional int32 color_package_hash = 2;
    optional int32 font_package_hash  = 3;
    optional int32 shape_package_hash = 4;
    optional int32 clock_package_hash = 5;
    optional int32 launcher_grid = 6;
    optional int32 wallpaper_category_hash = 7;
    optional int32 wallpaper_id_hash = 8;
    optional int32 color_preference = 9;
    optional android.stats.style.LocationPreference location_preference = 10;
    optional android.stats.style.DatePreference date_preference = 11;
    optional android.stats.style.LaunchedPreference launched_preference = 12;
    optional android.stats.style.EffectPreference effect_preference = 13;
    optional int32 effect_id_hash = 14;
    optional int32 lock_wallpaper_category_hash = 15;
    optional int32 lock_wallpaper_id_hash = 16;
    optional int32 first_launch_date_since_setup = 17;
    optional int32 first_wallpaper_apply_date_since_setup = 18;
    optional int32 app_launch_count = 19;
    optional int32 color_variant = 20;
    optional int64 time_elapsed_millis = 21;
    optional int32 effect_status_code = 22;
    optional int32 app_session_id = 23;
    optional android.stats.style.SetWallpaperEntryPoint set_wallpaper_entry_point = 24;
    optional android.stats.style.WallpaperDestination wallpaper_destination = 25;
    optional android.stats.style.ColorSource color_source = 26;
    optional int32 seed_color = 27;
    optional android.stats.style.ClockSize clock_size = 28;
    optional bool toggle_on = 29;
    optional string shortcut = 30;
    optional string shortcut_slot_id = 31;
}

/**
 * Logs when Settings UI has changed.
 *
 * Logged from:
 *   packages/apps/Settings
 */
message SettingsUIChanged {
    /**
     * Where this SettingsUIChange event comes from. For example, if
     * it's a PAGE_VISIBLE event, where the page is opened from.
     */
    optional android.app.settings.PageId attribution = 1;

    /**
     * What the UI action is.
     */
    optional android.app.settings.Action action = 2;

    /**
     * Where the action is happening
     */
    optional android.app.settings.PageId page_id = 3;

    /**
     * What preference changed in this event.
     */
    optional string changed_preference_key = 4;

    /**
     * The new value of the changed preference.
     */
    optional int64 changed_preference_int_value = 5;

    /**
     * Data about elapsed time since setup wizard finished.
     */
    optional int64 elapsed_time_millis = 6;
}

/**
 * Logs that a setting was updated.
 * Logged from:
 *   frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
 * The tag and is_default allow resetting of settings to default values based on the specified
 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
 */
message SettingChanged {
    // The name of the setting.
    optional string setting = 1;

    // The change being imposed on this setting. May represent a number, eg "3".
    optional string value = 2;

    // The new value of this setting. For most settings, this is same as value. For some settings,
    // value is +X or -X where X represents an element in a set. For example, if the previous value
    // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
    // The +/- feature is currently only used for location_providers_allowed.
    optional string new_value = 3;

    // The previous value of this setting.
    optional string prev_value = 4;

    // The tag used with the is_default for resetting sets of settings. This is generally null.
    optional string tag = 5;

    // True if this setting with tag should be resettable.
    optional bool is_default = 6;

    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
    optional int32 user = 7;

    enum ChangeReason {
        UPDATED = 1; // Updated can be an insertion or an update.
        DELETED = 2;
    }
    optional ChangeReason reason = 8;
}

/**
 * Logs activity going to foreground or background
 *
 * Logged from:
  *   frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
 */
message ActivityForegroundStateChanged {
    optional int32 uid = 1 [(is_uid) = true];
    optional string pkg_name = 2;
    optional string class_name = 3;

    enum State {
        BACKGROUND = 0;
        FOREGROUND = 1;
    }
    optional State state = 4;
}

/**
 * Logs when a volume entered low Storage state.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
 */
message LowStorageStateChanged {
    // Volume that ran out of storage.
    optional string volume_description = 1;

    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
    }
    optional State state = 2;
}

/**
 * Logs when an app is downgraded.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
 */
message AppDowngraded {
    optional string package_name = 1;
    // Size of the package (all data) before being downgraded.
    optional int64 size_in_bytes_before = 2;
    // Size of the package (all data) after being downgraded.
    optional int64 size_in_bytes_after = 3;

    optional bool aggressive = 4;
}

/**
 * Logs when an app is optimized after being downgraded.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
 */
message AppOptimizedAfterDowngraded {
    optional string package_name = 1;
}

/**
 * Logs whenever an app is installed on external storage.
 * Logged from:
        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
 */
message AppInstallOnExternalStorageReported {
    // The type of external storage.
    optional android.stats.storage.ExternalStorageType storage_type = 1;
    // The name of the package that is installed on the sd card.
    optional string package_name = 2;
}

/**
 * Logs when an app crashes.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppCrashOccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string event_type = 2;

    // The name of the process.
    // system_server if it is not by an app
    optional string process_name = 3;

    // The pid if available. -1 means not available.
    optional int32 pid = 4;

    optional string package_name = 5;

    enum InstantApp {
        UNAVAILABLE = 0;
        FALSE = 1;
        TRUE = 2;
    }
    optional InstantApp is_instant_app = 6;

    enum ForegroundState {
        UNKNOWN = 0;
        BACKGROUND = 1;
        FOREGROUND = 2;
    }
    optional ForegroundState foreground_state = 7;

    optional android.server.ErrorSource error_source = 8;

    optional bool is_incremental = 9;

    optional float loading_progress = 10;

    optional int64 millis_since_oldest_pending_read = 11;

    // Status code to represent the health of the file system backing storage, as defined in
    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
    // Value -1 if the app is not installed on Incremental
    optional int32 storage_health_code = 12;

    // Status code to represent the status of data loader, as defined in
    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
    // Value -1 if the app is not installed on Incremental
    optional int32 data_loader_status_code = 13;

    // Whether read logs collection is enabled
    optional bool read_logs_enabled = 14;

    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
    // -1 means the app is not installed on Incremental.
    optional int64 millis_since_last_data_loader_bind = 15;

    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
    optional int64 data_loader_bind_delay_millis = 16;

    // Total count of delayed reads, as reported by Incremental File System.
    optional int32 total_delayed_reads = 17;

    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
    optional int32 total_failed_reads = 18;

    // UID of the process that tried to read a page from the app but failed.
    // This shows whether the read was initiated by the system, the app itself, or some other apps.
    // -1 means there was no read error or the app is not installed on Incremental.
    optional int32 last_read_error_uid = 19;

    // Duration since that last read failure.
    // -1 means there was no read error or the app is not installed on Incremental.
    optional int64 last_read_error_millis_since = 20;

    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
    // and other positive values for other errors. -1 means app is not installed on Incremental.
    optional int32 last_read_error_code = 21;

    // Total duration of delayed reads in milliseconds
    optional int64 total_delayed_reads_duration_millis = 22;
}

/**
 * Logs when a WTF (What a Terrible Failure) happened.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message WTFOccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string tag = 2;

    // The name of the process.
    // system_server if it is not by an app
    optional string process_name = 3;

    // The pid if available. -1 means not available.
    optional int32 pid = 4;

    optional android.server.ErrorSource error_source = 5;
}

/**
 * Logs when system server reports low memory.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message LowMemReported {
}

/**
 * Logs when an app ANR (App Not Responding) occurs.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
 */
message ANROccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string process_name = 2;

    optional string short_component_name = 3;

    optional string reason = 4;

    enum InstantApp {
        UNAVAILABLE = 0;
        FALSE = 1;
        TRUE = 2;
    }
    optional InstantApp is_instant_app = 5;

    enum ForegroundState {
        UNKNOWN = 0;
        BACKGROUND = 1;
        FOREGROUND = 2;
    }
    optional ForegroundState foreground_state = 6;

    optional android.server.ErrorSource error_source = 7;

    optional string package_name = 8;

    optional bool is_incremental = 9;

    optional float loading_progress = 10;

    optional int64 millis_since_oldest_pending_read = 11;

    // Status code to represent the health of the file system backing storage, as defined in
    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
    // Value -1 if the app is not installed on Incremental
    optional int32 storage_health_code = 12;

    // Status code to represent the status of data loader, as defined in
    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
    // Value -1 if the app is not installed on Incremental
    optional int32 data_loader_status_code = 13;

    // Whether read logs collection is enabled
    optional bool read_logs_enabled = 14;

    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
    // -1 means the app is not installed on Incremental.
    optional int64 millis_since_last_data_loader_bind = 15;

    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
    optional int64 data_loader_bind_delay_millis = 16;

    // Total count of delayed reads, as reported by Incremental File System.
    optional int32 total_delayed_reads = 17;

    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
    optional int32 total_failed_reads = 18;

    // UID of the process that tried to read a page from the app but failed.
    // This shows whether the read was initiated by the system, the app itself, or some other apps.
    // -1 means there was no read error or the app is not installed on Incremental.
    optional int32 last_read_error_uid = 19;

    // Duration since that last read failure.
    // -1 means there was no read error or the app is not installed on Incremental.
    optional int64 last_read_error_millis_since = 20;

    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
    // and other positive values for other errors. -1 means app is not installed on Incremental.
    optional int32 last_read_error_code = 21;

    // Total duration of delayed reads in milliseconds
    optional int64 total_delayed_reads_duration_millis = 22;
}

/**
 * Logs immediately after an app ANR (App Not Responding) occurs. In contrast, ANROccurred (the
 * atom above) logs some time (not necessarily immediately) after the ANR is detected.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
 */
message ANROccurredProcessingStarted {
  optional string process_name = 1;
}

/**
 * Logs when the vibrator state changes.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/vibrator/VibratorManagerService.java
 */
message VibratorStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    // Duration (in milliseconds) requested to keep the vibrator on.
    // Only applicable for State == ON.
    optional int64 duration_millis = 3;
}

/**
 * Logs vibration request.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/vibrator/VibratorManagerService.java
 */
// Next tag: 26
message VibrationReported {
  repeated AttributionNode attribution_node = 1;

  enum VibrationType {
    UNKNOWN = 0;
    SINGLE = 1;
    REPEATED = 2;
    EXTERNAL = 3;
  }

  // Vibration identifiers for aggregation.
  optional VibrationType vibration_type = 2;
  // One of VibrationAttributes.USAGE_* constant values.
  optional int32 vibration_usage = 3;
  optional int32 vibration_status = 4;

  // Vibration completion causes.
  // Flag indicating if the vibration was canceled by the same process
  // or superseded/canceled by another vibration from the same process.
  optional bool ended_by_same_uid = 5;
  // Usage value of the vibration that superseded/canceled this one.
  optional int32 ended_by_usage = 6;
  // Usage value of the vibration that was superseded/canceled by this one.
  optional int32 interrupted_usage = 7;

  // Vibration execution counters.
  optional int32 repeat_count = 8;
  // Total duration of this vibration at the service, including setup and cleanup.
  optional int64 vibration_duration_millis = 9;
  // Total duration the vibrator motor was active with non-zero amplitude.
  optional int64 vibrator_on_duration_millis = 10;
  // Delta between the incoming binder call to vibrate and the first step in the
  // vibration conductor (closest measure of starting HAL interactions).
  optional int64 start_latency_millis = 11;
  // Delta between the HAL reporting the last vibrate operation has completed and
  // vibrator service has finished the vibration and become idle.
  optional int64 end_latency_millis = 12;

  // Vibrator hardware HAL API interaction counters.
  // The majority of vibrations will populate only a couple of the fields below.
  optional int32 hal_compose_count = 13;
  optional int32 hal_compose_pwle_count = 14;
  optional int32 hal_on_count = 15;
  optional int32 hal_off_count = 16;
  optional int32 hal_perform_count = 17;
  optional int32 hal_set_amplitude_count = 18;
  optional int32 hal_set_external_control_count = 19;

  // Vibrator hardware HAL API constants used (deduped).
  // Values from CompositionPrimitive.aidl successfully triggered by this vibration at least once.
  repeated int32 hal_supported_composition_primitives_used = 20;
  // Values from Effect.aidl triggered by this vibration at least once.
  repeated int32 hal_supported_effects_used = 21;
  // Values from CompositionPrimitive.aidl triggered but not supported by the device.
  repeated int32 hal_unsupported_composition_primitives_used = 22;
  // Values from Effect.aidl triggered but not supported by the device.
  repeated int32 hal_unsupported_effects_used = 23;
  // Vibrator hardware HAL argument sizes (total).
  optional int32 hal_composition_size = 24;
  optional int32 hal_pwle_size = 25;
}

/*
 * Allows other apps to push events into statsd.
 * Logged from:
 *      frameworks/base/core/java/android/util/StatsLog.java
 */
message AppBreadcrumbReported {
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];

    // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
    optional int32 label = 2;

    // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
    // predicates for the metrics).
    enum State {
        UNKNOWN = 0;
        UNSPECIFIED = 1;  // For events that are known to not represent START/STOP.
        STOP = 2;
        START = 3;
    }
    optional State state = 3;
}

/**
 * Logs the wall-clock time when a significant wall-clock time shift occurs.
 * For example, this could be due to the user manually changing the time.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
 */
message WallClockTimeShifted {
    // New wall-clock time in milliseconds, according to System.currentTimeMillis().
    optional int64 wall_clock_timestamp_millis = 1;
}

/**
 * Logs when statsd detects an anomaly.
 *
 * Logged from:
 *   frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
 */
message AnomalyDetected {
    // Uid that owns the config whose anomaly detection alert fired.
    optional int32 config_uid = 1 [(is_uid) = true];

    // Id of the config whose anomaly detection alert fired.
    optional int64 config_id = 2;

    // Id of the alert (i.e. name of the anomaly that was detected).
    optional int64 alert_id = 3;
}

message AppStartOccurred {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
        RELAUNCH = 4;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;

    // The name of the calling app. Empty if not set.
    optional string calling_pkg_name = 5;

    // Whether the app is an instant app.
    optional bool is_instant_app = 6;

    // Device uptime when activity started. Deprecated: use activity_start_timestamp_millis instead.
    optional int64 activity_start_millis = 7 [deprecated = true];

    optional android.app.AppTransitionReasonEnum reason = 8;

    optional int32 transition_delay_millis = 9;
    // -1 if not set.
    optional int32 starting_window_delay_millis = 10;
    // -1 if not set.
    optional int32 bind_application_delay_millis = 11;
    optional int32 windows_drawn_delay_millis = 12;

    // Empty if not set.
    optional string launch_token = 13;

    // The reason why the package was optimized.
    optional int32 package_optimization_compilation_reason = 14;

    // The compiler filter used when when the package was optimized.
    optional int32 package_optimization_compilation_filter = 15;

    enum SourceType {
        UNAVAILABLE = 0;
        LAUNCHER = 1;
        NOTIFICATION = 2;
        LOCKSCREEN = 3;
        RECENTS_ANIMATION = 4;
    }
    // The type of the startup source.
    optional SourceType source_type = 16;

    // The time from the startup source to the beginning of handling the startup event.
    // -1 means not available.
    optional int32 source_event_delay_millis = 17;

    // Whether the app is hibernating when it started
    optional bool is_hibernating = 18;

    // Whether the app is installed on Incremental File System.
    optional bool is_incremental = 19;

    // Whether the app is still being streamed.
    optional bool is_loading = 20;

    // The hash value of the activity name.
    optional int32 activity_name_hash = 21;

    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
    optional int64 activity_start_timestamp_millis = 22;

    /**
     * The process state of apps, keep in sync with
     * frameworks/base/core/java/android/app/ActivityManager.java
     */
    enum AppProcessState {
        PROCESS_STATE_UNKNOWN = -1;
        PROCESS_STATE_PERSISTENT = 0;
        PROCESS_STATE_PERSISTENT_UI = 1;
        PROCESS_STATE_TOP = 2;
        PROCESS_STATE_BOUND_TOP = 3;
        PROCESS_STATE_FOREGROUND_SERVICE = 4;
        PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 5;
        PROCESS_STATE_IMPORTANT_FOREGROUND = 6;
        PROCESS_STATE_IMPORTANT_BACKGROUND = 7;
        PROCESS_STATE_TRANSIENT_BACKGROUND = 8;
        PROCESS_STATE_BACKUP = 9;
        PROCESS_STATE_SERVICE = 10;
        PROCESS_STATE_RECEIVER = 11;
        PROCESS_STATE_TOP_SLEEPING = 12;
        PROCESS_STATE_HEAVY_WEIGHT = 13;
        PROCESS_STATE_HOME = 14;
        PROCESS_STATE_LAST_ACTIVITY = 15;
        PROCESS_STATE_CACHED_ACTIVITY = 16;
        PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 17;
        PROCESS_STATE_CACHED_RECENT = 18;
        PROCESS_STATE_CACHED_EMPTY = 19;
        PROCESS_STATE_NONEXISTENT = 20;
    }

    // The process state of the launching activity prior to the launch.
    optional AppProcessState process_state = 23;

    // The oom adj score of the launching activity prior to the launch.
    optional int32 process_oom_adj = 24;

    // The stopped state (if any) the package was in before the launch
    optional PackageStoppedState package_stopped_state = 25;

    // Reserved for b/281564325.
    reserved 26;
}

message AppStartCanceled {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
        RELAUNCH = 4;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;
}

message AppStartFullyDrawn {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WITH_BUNDLE = 1;
        WITHOUT_BUNDLE = 2;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;

    optional bool transition_process_running = 5;

    // App startup time (until call to Activity#reportFullyDrawn()).
    optional int64 app_startup_time_millis = 6;

    // The reason why the package was optimized.
    optional int32 package_optimization_compilation_reason = 7;

    // The compiler filter used when when the package was optimized.
    optional int32 package_optimization_compilation_filter = 8;

    enum SourceType {
        UNAVAILABLE = 0;
        LAUNCHER = 1;
        NOTIFICATION = 2;
        LOCKSCREEN = 3;
    }
    // The type of the startup source.
    optional SourceType source_type = 9;

    // The time from the startup source to the beginning of handling the startup event.
    // -1 means not available.
    optional int32 source_event_delay_millis = 10;

    // Whether the app is installed on Incremental File System.
    optional bool is_incremental = 11;

    // Whether the app is still being streamed.
    optional bool is_loading = 12;

    // The hash value of the activity name.
    optional int32 activity_name_hash = 13;

    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
    optional int64 activity_start_timestamp_millis = 14;
}

/**
 * Logs when an app enters a different App Compat state.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
 */
message AppCompatStateChanged {
    // UID of the package whose state changed.
    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];

    enum State {
        UNKNOWN = 0;
        // The app is not visible or has been closed.
        NOT_VISIBLE = 1;
        // The app’s bounds aren’t letterboxed.
        NOT_LETTERBOXED = 2;
        // The app’s bounds are letterboxed because of size-compat-mode.
        LETTERBOXED_FOR_SIZE_COMPAT_MODE = 3;
        // The app’s bounds are letterboxed because of fixed orientation.
        LETTERBOXED_FOR_FIXED_ORIENTATION = 4;
        // The app’s bounds are letterboxed because of aspect ratio restrictions.
        LETTERBOXED_FOR_ASPECT_RATIO = 5;
    }

    // Position of the letterbox
    enum Position {
        UNKNOWN_POSITION = 0;
        NOT_LETTERBOXED_POSITION = 1;
        CENTER = 2;
        LEFT = 3;
        RIGHT = 4;
        TOP = 5;
        BOTTOM = 6;
    }

    // The state that was entered.
    optional State state = 2 [
      (state_field_option).exclusive_state = true,
      (state_field_option).nested = false];

    optional Position letterbox_position = 3;
}

/**
 * Logs when an app that is letterboxed changes position.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
 */

message LetterboxPositionChanged {
    // UID of the package that is letterboxed.
    optional int32 uid = 1 [(is_uid) = true];

    // The new position of the letterbox
    enum PositionChange {
        UNKNOWN = 0;
        CENTER_TO_LEFT = 1;
        LEFT_TO_CENTER = 2;
        CENTER_TO_RIGHT= 3;
        RIGHT_TO_CENTER = 4;
        CENTER_TO_TOP = 5;
        TOP_TO_CENTER = 6;
        CENTER_TO_BOTTOM = 7;
        BOTTOM_TO_CENTER = 8;
    }

    optional PositionChange position_change = 2;

}

/**
 * Logs events reported for the Size Compat restart button of an app.
 *
 * Logged from:
 *   frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
 */
message SizeCompatRestartButtonEventReported {
    // UID of the package that has the button.
    optional int32 uid = 1 [(is_uid) = true];

    enum Event {
        UNKNOWN = 0;
        APPEARED = 1;
        CLICKED = 2;
    }

    // The event that was reported.
    optional Event event = 2;
}

/**
 * Logs events reported for the Camera App Compat control, which is used to
 * correct stretched viewfinder in apps that don't handle all possible
 * configurations, and changes between them, correctly.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
 */
message CameraCompatControlEventReported {
  // UID of the package that has the control.
  optional int32 uid = 1 [(is_uid) = true];

  enum Event {
    UNKNOWN = 0;
    // Button to apply the treatment appeared.
    APPEARED_APPLY_TREATMENT = 1;
    // Button to revert the treatment appeared.
    APPEARED_REVERT_TREATMENT = 2;
    // Users clicked on the button to apply the treatment.
    CLICKED_APPLY_TREATMENT = 3;
    // Users clicked on the button to revert the treatment.
    CLICKED_REVERT_TREATMENT = 4;
    // Users clicked on the button to dismiss the control.
    CLICKED_DISMISS = 5;
  }

  // The event that was reported.
  optional Event event = 2;
}

/**
 * Logs a picture-in-picture action
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 *      frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
 *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
 */
message PictureInPictureStateChanged {
    // -1 if it is not available
    optional int32 uid = 1 [(is_uid) = true];

    optional string short_name = 2;

    enum State {
        ENTERED = 1;
        EXPANDED_TO_FULL_SCREEN = 2;
        MINIMIZED = 3;
        DISMISSED = 4;
    }
    optional State state = 3;
}

/**
 * Logs overlay action
 * Logged from:
 *     services/core/java/com/android/server/wm/Session.java
 */
message OverlayStateChanged {
    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];

    optional string package_name = 2 [(state_field_option).primary_field = true];

    optional bool using_alert_window = 3;

    enum State {
        ENTERED = 1;
        EXITED = 2;
    }
    optional State state = 4
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
}

/**
 * Logs foreground service starts and stops.
 * Note that this is not when a service starts or stops, but when it is
 * considered foreground.
 * Logged from
 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
 */
message ForegroundServiceStateChanged {
    optional int32 uid = 1 [(is_uid) = true];
    // package_name + "/" + class_name
    optional string short_name = 2;

    enum State {
        UNKNOWN_STATE = 0;
        ENTER = 1;
        EXIT = 2;
        DENIED = 3;
        API_CALL = 4; // this event is to annotate API call.
        TIMED_OUT = 5; // SHORT_SERVICE timed out.
    }
    optional State state = 3;

    // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
    // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
    optional bool allow_while_in_use_permission = 4;
    // the reason why FGS is allowed or denied to start. The reason code is defined as
    // PowerExemptionManager#ReasonCode.
    optional int32 fgs_start_reason_code = 5;
    // FGS service's targetSdkVersion.
    optional int32 target_sdk_version = 6;
    // uid of the app that start/bind this service.
    optional int32 calling_uid = 7;
    // targetSdkVersion of the app that start/bind this service.
    optional int32 caller_target_sdk_version = 8;
    // uid of the app that set the temp-allowlist, INVALID_UID (-1) if not in any
    // temp-allowlist.
    optional int32 temp_allow_list_calling_uid = 9;
    // FGS notification was deferred.
    optional bool fgs_notification_deferred = 10;
    // FGS notification was shown before the FGS finishes, or it wasn't deferred in the first place.
    optional bool fgs_notification_shown = 11;
    // The duration from state ENTER to state EXIT. Only meaningful when the state is EXIT.
    optional int32 fgs_duration_ms = 12;
    // Number of times startForeground() is called on this service.
    optional int32 fgs_start_count = 13;
    // SHA-1 hashed short_name combined with ANDROID_ID.
    optional int32 short_name_hash = 14;
    // Whether this FGS package had permission to notify the user.
    optional bool fgs_has_notification_permission = 15;

    // Keep in sync with frameworks/base/core/java/android/content/pm/ServiceInfo.java
    enum ForegroundServiceType {
        FOREGROUND_SERVICE_TYPE_NONE = 0;
        FOREGROUND_SERVICE_TYPE_DATA_SYNC = 0x0001; // 1 << 0
        FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 0x0002; // 1 << 1
        FOREGROUND_SERVICE_TYPE_PHONE_CALL = 0x0004; //1 << 2
        FOREGROUND_SERVICE_TYPE_LOCATION = 0x0008; // 1 << 3
        FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 0x0010; // 1 << 4
        FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 0x0020; // 1 << 5
        FOREGROUND_SERVICE_TYPE_CAMERA = 0x0040; // 1 << 6
        FOREGROUND_SERVICE_TYPE_MICROPHONE = 0x0080; // 1 << 7
        FOREGROUND_SERVICE_TYPE_HEALTH = 0x0100; // 1 << 8
        FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING = 0x0200; // 1 << 9
        FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 0x0400; // 1 << 10
        FOREGROUND_SERVICE_TYPE_SHORT_SERVICE = 0x0800; // 1 << 11
        FOREGROUND_SERVICE_TYPE_SPECIAL_USE = 0x40000000; // 1 << 30
    }

    // The foreground service types, must be one or a combination of the types
    // in the ForegroundServiceType above.
    optional int32 fgs_types = 16;
    // The result check code for the fgs type enforcement.
    optional android.app.FgsTypePolicyCheckEnum fgs_type_check_code = 17;
    // If true, this FGS service is a delegate (instead of real FGS).
    optional bool is_delegate = 18;
    // The actual client app's uid.
    optional int32 delegate_client_uid = 19 [(is_uid) = true];
    // The service module that start/stop the delegate, could be
    // MediaSessionService, VOIP, Camera, Audio, Location etc.
    // The enum is defined in interface
    // ForegroundServiceDelegationOptions.DelegationService
    optional int32 delegation_service = 20;

    enum ApiJourneyState {
    	  UNKNOWN_JOURNEY_STATE = 0;
        ENTER_WITH_FGS = 1;
        EXIT_WITH_FGS = 2;
        EXIT_WITHOUT_FGS = 3;
        PAUSE = 4;
        RESUME = 5;
    }

    optional ApiJourneyState api_state = 21;

    enum ApiType {
    	  UNKNOWN_API_TYPE = 0;
        CAMERA = 1;
        BLUETOOTH = 2;
        LOCATION = 3;
        MEDIA_PLAYBACK = 4;
        AUDIO = 5;
        MICROPHONE = 6;
        PHONE_CALL = 7;
        USB = 8;
        CDM = 9;
    }

    repeated ApiType api_type = 22;

    repeated int64 api_timestamp = 23;

    optional int64 api_before_fgs_start_duration_millis = 28;

    optional int64 api_after_fgs_end_duration_millis = 29;

    // Keep it in sync with ActivityManager.ProcessCapability.
    enum ProcessCapability {
        PROCESS_CAPABILITY_NONE = 0;
        PROCESS_CAPABILITY_FOREGROUND_LOCATION = 1;
        PROCESS_CAPABILITY_FOREGROUND_CAMERA = 2;
        PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 4;
        PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK = 8;
        PROCESS_CAPABILITY_BFSL = 16;
        PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK = 32;
    }

    optional android.app.ProcessStateEnum service_uid_state = 24 [default = PROCESS_STATE_UNKNOWN];
    optional ProcessCapability service_uid_capabilities = 25;

    optional android.app.ProcessStateEnum calling_uid_state = 26 [default = PROCESS_STATE_UNKNOWN];
    optional ProcessCapability calling_uid_capabilities = 27;

    optional int32 while_in_use_reason_code_no_binding = 30;
    optional int32 while_in_use_reason_code_in_bind_service = 31;
    optional int32 while_in_use_reason_code_by_bindings = 32;
    optional int32 fgs_start_reason_code_no_binding = 33;
    optional int32 fgs_start_reason_code_in_bind_service = 34;
    optional int32 fgs_start_reason_code_by_bindings = 35;

    enum FgsStartApi {
        // Not available -- used in atoms that are unrelated to this selection.
        FGSSTARTAPI_NA = 0;
        // The FGS was not started. (likely it's bound.)
        FGSSTARTAPI_NONE = 1;
        // The FGS was started with Context.startService().
        FGSSTARTAPI_START_SERVICE = 2;
        // The FGS was started with Context.startForegroundService().
        FGSSTARTAPI_START_FOREGROUND_SERVICE = 3;
        // It's a delegate FGS.
        FGSSTARTAPI_DELEGATE = 4;

    }
    optional FgsStartApi fgs_start_api = 36;

    // Whether setFgsRestrictionLocked() was called in Service.startForeground().
    optional bool fgs_restriction_recalculated = 37;
}

/**
 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
 * A foreground service session is any continuous period during which the uid holds at least one
 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
 * Accesses initiated while the uid is in the TOP state are ignored.
 * Sessions with no attempted accesses are not logged.
 * Logged from
 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
 */
message ForegroundServiceAppOpSessionEnded {
    optional int32 uid = 1 [(is_uid) = true];

    // The operation's name.
    // Only following four ops are logged
    // COARSE_LOCATION = 0
    // FINE_LOCATION = 1
    // CAMERA = 26
    // RECORD_AUDIO = 27
    optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];

    // The uid's permission mode for accessing the AppOp during this fgs session.
    enum Mode {
        MODE_UNKNOWN = 0;
        MODE_ALLOWED = 1; // Always allowed
        MODE_IGNORED = 2; // Denied
        MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
    }
    optional Mode app_op_mode = 3;

    // Number of times this AppOp was requested and allowed.
    optional int32 count_ops_accepted = 4;
    // Number of times this AppOp was requested but denied.
    optional int32 count_ops_rejected = 5;
}

/**
 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
 * attributed back to the parent (host) uid. One example is Chrome.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message IsolatedUidChanged {
    // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
    // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
    // This field is ignored when event == REMOVED.
    optional int32 parent_uid = 1;

    optional int32 isolated_uid = 2;

    // We expect an isolated uid to be removed before if it's used for another parent uid.
    enum Event {
        REMOVED = 0;
        CREATED = 1;
    }
    optional Event event = 3;
}

/*
 * Logs the reception of an incoming network packet causing the main system to wake up for
 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
 * and processed by WakeupController.cpp.
 */
message PacketWakeupOccurred {
    // The uid owning the socket into which the packet was delivered, or -1 if the packet was
    // delivered nowhere.
    optional int32 uid = 1 [(is_uid) = true];
    // The interface name on which the packet was received.
    optional string iface = 2;
    // The ethertype value of the packet.
    optional int32 ethertype = 3;
    // String representation of the destination MAC address of the packet.
    optional string destination_hardware_address = 4;
    // String representation of the source address of the packet if this was an IP packet.
    optional string source_ip = 5;
    // String representation of the destination address of the packet if this was an IP packet.
    optional string destination_ip = 6;
    // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
    // field if this was an IPv6 packet. The range of possible values is the same for both IP
    // families.
    optional int32 ip_next_header = 7;
    // The source port if this was a TCP or UDP packet.
    optional int32 source_port = 8;
    // The destination port if this was a TCP or UDP packet.
    optional int32 destination_port = 9;
}

/*
 * Logs the memory stats for an app on startup.
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppStartMemoryStateCaptured {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    optional string process_name = 2;

    // The activity name.
    optional string activity_name = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    optional int64 rss_in_bytes = 6;

    // CACHE
    optional int64 cache_in_bytes = 7;

    // SWAP
    optional int64 swap_in_bytes = 8;
}

/*
 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
 * for LMK event.
 * Logged from:
 *      system/core/lmkd/lmkd.c
 */
message LmkStateChanged {
    enum State {
        UNKNOWN = 0;
        START = 1;
        STOP = 2;
    }
    optional State state = 1;
}

/*
 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
 * Logged from:
 *      system/core/lmkd/lmkd.c
 */
message LmkKillOccurred {
    enum Reason {
        UNKNOWN = 0;
        PRESSURE_AFTER_KILL = 1;
        NOT_RESPONDING = 2;
        LOW_SWAP_AND_THRASHING = 3;
        LOW_MEM_AND_SWAP = 4;
        LOW_MEM_AND_THRASHING = 5;
        DIRECT_RECL_AND_THRASHING = 6;
        LOW_MEM_AND_SWAP_UTIL = 7;
        LOW_FILECACHE_AFTER_THRASHING = 8;
        LOW_MEM = 9;
    }

    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    optional string process_name = 2;

    // oom adj score.
    optional int32 oom_adj_score = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    optional int64 rss_in_bytes = 6;

    // CACHE
    optional int64 cache_in_bytes = 7;

    // SWAP
    optional int64 swap_in_bytes = 8;

    // The elapsed real time of start of the process.
    optional int64 process_start_time_nanos = 9;

    // Min oom adj score considered by lmkd.
    optional int32 min_oom_score = 10;

    // Free physical memory on device at LMK time.
    optional int32 free_mem_kb = 11;

    // Free swap on device at LMK time.
    optional int32 free_swap_kb = 12;

    // What triggered the LMK event.
    optional Reason reason = 13;

    // Current thrashing levels (workingset_refaults/filecache in %).
    optional int32 thrashing = 14;

    // Max thrashing levels (workingset_refaults/filecache in %).
    optional int32 max_thrashing = 15;

    // How many active foreground services across the system
    optional int32 total_foreground_services = 16;

    // How many processes hosting foreground services
    optional int32 procs_with_foreground_services = 17;
}

/*
 * Logs when the ActivityManagerService detects that an app died.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppDied {
    // timestamp(elapsedRealtime) of record creation
    optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
}

/**
 * An atom for generic metrics logging. Available from Android Q.
 */
message GenericAtom {
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];

    // An event_id indicates the type of event.
    optional android.stats.EventType event_id = 2;
}

/**
 * Atom for simple logging of user interaction and impression events, such as "the user touched
 * this button" or "this dialog was displayed".
 * Keep the UI event stream clean: don't use for system or background events.
 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/
 */
message UiEventReported {
    // The event_id.
    optional int32 event_id = 1;
    // The event's source or target uid and package, if applicable.
    // For example, the package posting a notification, or the destination package of a share.
    optional int32 uid = 2 [(is_uid) = true];
    optional string package_name = 3;
    // An identifier used to disambiguate which logs refer to a particular instance of some
    // UI element. Useful when there might be multiple instances simultaneously active.
    optional int32 instance_id = 4;
}

/**
 * Atom for logging Dream user interaction and impression events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/
 */
message DreamUiEventReported {
    // The event's source or target uid, if applicable.
    optional int32 uid = 1 [(is_uid) = true];
    // The event_id (as for UiEventReported).
    optional int32 event_id = 2;
    // An identifier used to disambiguate which logs refer to a particular instance of some
    // UI element. Useful when there might be multiple instances simultaneously active.
    optional int32 instance_id = 3;

    // The name of the dream component, which identifies the type of the dream.
    optional string dream_component_name = 4;
}

/**
 * Reports a notification was created or updated.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/notification/
 */
message NotificationReported {
    // The event_id (as for UiEventReported).
    optional int32 event_id = 1;
    // The notifying app's uid and package.
    optional int32 uid = 2 [(is_uid) = true];
    optional string package_name = 3;
    // A small system-assigned identifier for the notification.
    // Locally probably-unique, but expect collisions across users and/or days.
    optional int32 instance_id = 4;
    optional int32 notification_id_hash = 5;  // Small hash of the app-assigned notif ID + tag
    optional int32 channel_id_hash = 6;  // Small hash of app-assigned channel ID

    // Grouping information
    optional int32 group_id_hash = 7;  // Small hash of the group ID of the notification
    optional int32 group_instance_id = 8;  // Instance_id of the group-summary notification
    optional bool is_group_summary = 9;  // Tags the group-summary notification

    // Attributes
    optional string category = 10;   // App-assigned notification category (API-defined strings)
    optional int32 style = 11;       // App-assigned notification style
    optional int32 num_people = 12;  // Number of Person records attached to the notification

    // Ordering, importance and interruptiveness

    optional int32 position = 13;    // Position in NotificationManager's list

    optional android.stats.sysui.NotificationImportance importance = 14;
    optional int32 alerting = 15;    // Bitfield, 1=buzz 2=beep 4=blink

    enum NotificationImportanceExplanation {
        IMPORTANCE_EXPLANATION_UNKNOWN = 0;
        IMPORTANCE_EXPLANATION_APP = 1;     // App-specified channel importance.
        IMPORTANCE_EXPLANATION_USER = 2;    // User-specified channel importance.
        IMPORTANCE_EXPLANATION_ASST = 3;    // Notification Assistant override.
        IMPORTANCE_EXPLANATION_SYSTEM = 4;  // System override.
        // Like _APP, but based on pre-channels priority signal.
        IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
    }

    optional NotificationImportanceExplanation importance_source = 16;
    optional android.stats.sysui.NotificationImportance importance_initial = 17;
    optional NotificationImportanceExplanation importance_initial_source = 18;
    optional android.stats.sysui.NotificationImportance importance_asst = 19;
    optional int32 assistant_hash = 20;
    optional float assistant_ranking_score = 21;

    // Fields for tracking ongoing and foreground service notifications
    optional bool is_ongoing = 22;
    optional bool is_foreground_service = 23;
    // Fields to know about the timeout for notifications.
    optional int64 timeout_millis = 24;

    // Field for tracking whether the notification is non-dismissible
    optional bool is_non_dismissible = 25;

    // Time elapsed between the notify() API call and the NLSes being told about the notification.
    // Will be 0 for NotificationReported protos that do not correspond to a notify() call.
    optional int64 post_duration_millis = 26;

    // State of the full screen intent posted with this notification.
    enum FsiState {
        // This notification was not posted with a full screen intent.
        NO_FSI = 0;
        // This notification was posted with a full screen intent and the FSI permission is granted.
        FSI_ALLOWED = 1;
        // This notification was posted with a full screen intent but the FSI permission is denied.
        FSI_DENIED = 2;
    }
    optional FsiState fsi_state = 27;

    // True if the device was locked or showing unlocked AOD.
    optional bool is_locked = 28;

    // Age of the notification in minutes.
    optional int32 age_in_minutes = 29;
}

/**
 * Reports a notification channel, or channel group, was created, updated, or deleted.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/notification/
 */
message NotificationChannelModified {
    // The event_id (as for UiEventReported).
    optional int32 event_id = 1;
    // The notifying app's uid and package.
    optional int32 uid = 2 [(is_uid) = true];
    optional string package_name = 3;
    // Hash of app-assigned notification channel ID or channel-group ID
    optional int32 channel_id_hash = 4;
    // Previous importance setting, if applicable
    optional android.stats.sysui.NotificationImportance old_importance = 5;
    // New importance setting
    optional android.stats.sysui.NotificationImportance importance = 6;
    // whether or not this channel represents a conversation
    optional bool is_conversation = 7;
    // Hash of app-assigned notification conversation id
    optional int32 conversation_id_hash = 8;
    // whether or not the user demoted this channel out of the conversation space
    optional bool is_conversation_demoted = 9;
    // whether this conversation is marked as being a priority
    optional bool is_conversation_priority = 10;
}

/**
 * Logged when notification are dismissed. If multiple notifications are dismissed together,
 * this is only logged once per style per UID.
 * Logged from
 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
 */
message NotificationDismissed {
    // UID if the application (can be mapped to package and version)
    optional int32 uid = 1 [(is_uid) = true];
    // Integer enum value showing aggregated notification style.
    optional android.stats.sysui.NotificationStyle style = 2;
    // Reason for dismissal, based on REASON_ constants in
    // frameworks/base/core/java/android/service/notification/NotificationListenerService.java
    optional int32 reason = 3;
    // Number of notifications dismissed.
    optional int32 count = 4;
    // Memory use of Notification object being dismissed, in KB.
    optional int32 notificationObjectMemoryUse = 5;
    // Memory use of Notification views being dismissed, in KB.
    optional int32 notificationViewMemoryUse = 6;
    // Current memory use of SystemUI, RSS Anon in KB.
    optional int32 systemUiMemoryUse = 7;
}

/**
 * Logs when a biometric acquire event occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricAcquired {
    // Biometric modality that was acquired.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
    optional int32 user = 2;
    // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
    optional bool is_crypto = 3;
    // Action that the device is performing. Acquired messages are only expected for enroll and
    // authenticate. Other actions may indicate an error.
    optional android.hardware.biometrics.ActionEnum action = 4;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 5;
    // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
    optional int32 acquire_info = 6;
    // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
    optional int32 acquire_info_vendor = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
    // The ID of the biometric sensor associated with this action.
    optional int32 sensor_id = 9;
    // The ID of the session this event occurred in (if any)
    optional int32 session_id = 10;
    // The type of session (i.e. CUJ)
    optional android.hardware.biometrics.SessionTypeEnum session_type = 11;
    // If the AoD was on when this event occurred.
    optional bool is_aod = 12;
    // If the display is on when this event occurred.
    optional bool is_display_on = 13;
    // The dock state when this event occurred.
    optional android.server.DockStateEnum dock_state = 14;
    // The orientation of the device when this event occurred
    optional android.hardware.biometrics.OrientationEnum orientation = 15;
    // The fold state of the device when this event occurred
    optional android.hardware.biometrics.FoldStateEnum fold_state = 16;
    // The order this event was processed by the framework, if part of a session
    optional int32 session_order = 17;
    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 18;
}

/**
 * Logs when a biometric authentication event occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricAuthenticated {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
    // storage.
    optional bool is_crypto = 3;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 4;
    // If authentication requires user confirmation. See BiometricPrompt's
    // setRequireConfirmation(bool) method.
    optional bool require_confirmation = 5;

    enum State {
        UNKNOWN = 0;
        REJECTED = 1;
        PENDING_CONFIRMATION = 2;
        CONFIRMED = 3;
    }

    // State of the current auth attempt.
    optional State state = 6;
    // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
    // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
    // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
    // CONFIRMED.
    optional int64 latency_millis = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
    // The ID of the biometric sensor associated with this action.
    optional int32 sensor_id = 9;
    // The ambient light lux when authenticated.
    optional float ambient_light_lux = 10;
    // The ID of the session this event occurred in (if any)
    optional int32 session_id = 11;
    // The type of session (i.e. CUJ)
    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
    // If the AoD was on when this event occurred.
    optional bool is_aod = 13;
    // If the display is on when this event occurred.
    optional bool is_display_on = 14;
    // The dock state when this event occurred.
    optional android.server.DockStateEnum dock_state = 15;
    // The orientation of the device when this event occurred
    optional android.hardware.biometrics.OrientationEnum orientation = 16;
    // The fold state of the device when this event occurred
    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
    // The order this event was processed by the framework, if part of a session
    optional int32 session_order = 18;
    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
}

/**
 * Logs when a biometric error occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricErrorOccurred {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
    optional bool is_crypto = 3;
    // Action that the device is performing.
    optional android.hardware.biometrics.ActionEnum action = 4;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 5;
    // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
    // are unique to modality.
    optional int32 error_info = 6;
    // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
    // by the vendor and not specified by the HIDL interface.
    optional int32 error_info_vendor = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
    // Time spent during the authentication attempt.
    optional int64 latency_millis = 9;
    // The ID of the biometric sensor associated with this action.
    optional int32 sensor_id = 10;
    // The ID of the session this event occurred in (if any)
    optional int32 session_id = 11;
    // The type of session (i.e. CUJ)
    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
    // If the AoD was on when this event occurred.
    optional bool is_aod = 13;
    // If the display is on when this event occurred.
    optional bool is_display_on = 14;
    // The dock state when this event occurred.
    optional android.server.DockStateEnum dock_state = 15;
    // The orientation of the device when this event occurred
    optional android.hardware.biometrics.OrientationEnum orientation = 16;
    // The fold state of the device when this event occurred
    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
    // The order this event was processed by the framework, if part of a session
    optional int32 session_order = 18;
    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
}

/**
 * Logs when a system health issue is detected.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricSystemHealthIssueDetected {
    // Biometric modality.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // Type of issue detected.
    optional android.hardware.biometrics.IssueEnum issue = 2;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 3;
    // The ID of the biometric sensor associated with this action.
    optional int32 sensor_id = 4;
}

/**
 * Logs when a biometric enrollment occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricEnrolled {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // The amount of time the enrollment took in milliseconds.
    optional int64 latency_millis = 3;
    // Whether or not the enrollment was successful.
    optional bool success = 4;
    // The ID of the biometric sensor associated with this action.
    optional int32 sensor_id = 5;
    // The ambient light lux when the user enrolled.
    optional float ambient_light_lux = 6;
}

/*
 * Logs when one of the BiometricPrompt#authenticate() method variants is called.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 *
 */
 message AuthPromptAuthenticateInvoked {
    // Whether an explicit CryptoObject was passed to the biometric prompt.
    optional bool is_crypto = 1;
    // The value passed to setConfirmationRequired(boolean), or true if not set.
    optional bool is_confirmation_required = 2;
    // The value passed to setDeviceCredentialAllowed(boolean), or false if not set.
    optional bool is_credential_allowed = 3;
    // Whether a value was passed to setAllowedAuthenticators(int).
    optional bool is_allowed_authenticators_set = 4;
    // The value passed to setAllowedAuthenticators(int), if any.
    optional int32 allowed_authenticators = 5;
}

/*
 * Logs when one of the BiometricPrompt#canAuthenticate() method variants is called.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 *
 */
message AuthManagerCanAuthenticateInvoked {
    // Whether a bit field of allowed authenticator types was provided as an argument.
    optional bool is_allowed_authenticators_set = 1;
    // The bit field of allowed authenticator types provided, if any.
    optional int32 allowed_authenticators = 2;
    // The authentication status code that was returned.
    optional int32 result_code = 3;
}

/*
 * Logs when Biometric enrollment is requested via the ACTION_BIOMETRIC_ENROLL intent action.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 *
 */
message AuthEnrollActionInvoked {
    // Whether a Class 3 (strong) biometric was previously enrolled on this device.
    optional bool is_strong_biometric_enrolled = 1;
    // Whether a Class 2 (weak) biometric was previously enrolled on this device.
    optional bool is_weak_biometric_enrolled = 2;
    // Whether a PIN/pattern/password was previously enrolled on this device.
    optional bool is_device_credential_enrolled = 3;
    // Whether a bit field of allowed authenticator types was provided as an extra.
    optional bool is_allowed_authenticators_set = 4;
    // The bit field of allowed authenticator types provided, if any.
    optional int32 allowed_authenticators = 5;
}

/*
 * Logs when an application uses a deprecated biometric or authentication API feature.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
 message AuthDeprecatedAPIUsed {
    enum APIEnum {
        API_UNKNOWN = 0;
        // android.hardware.fingerprint.FingerprintManager#authenticate(CryptoObject,
        // CancellationSignal, int, AuthenticationCallback, Handler)
        API_FINGERPRINT_MANAGER_AUTHENTICATE = 1;
        // android.hardware.fingerprint.FingerprintManager#hasEnrolledFingerprints()
        API_FINGERPRINT_MANAGER_HAS_ENROLLED_FINGERPRINTS = 2;
        // android.hardware.fingerprint.FingerprintManager#isHardwareDetected()
        API_FINGERPRINT_MANAGER_IS_HARDWARE_DETECTED = 3;
        // android.hardware.biometrics.BiometricManager#canAuthenticate()
        API_BIOMETRIC_MANAGER_CAN_AUTHENTICATE = 4;
    }

     // The deprecated API feature that was used.
     optional APIEnum deprecated_api = 1;
     // The UID of the application that used the deprecated API.
     optional int32 app_uid = 2;
     // The target SDK version (API level) of the application that used the deprecated API.
     optional int32 target_sdk = 3;
 }

/*
 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
 */
message FlagFlipUpdateOccurred {
    // If the event is from a flag config package, specify the package name.
    optional string flag_flip_package_name = 1;

    // The order id of the package
    optional int64 order_id = 2;
}

/**
 * Potential experiment ids that goes with a train install.
 * Should be kept in sync with experiment_ids.proto.
 */
message TrainExperimentIds {
    repeated int64 experiment_id = 1;
}

/*
 * Logs when a binary push state changes.
 * Logged by the installer via public api.
 */
message BinaryPushStateChanged {
    // Name of the train.
    optional string train_name = 1;
    // Version code for a "train" of packages that need to be installed atomically
    optional int64 train_version_code = 2;
    // After installation of this package, device requires a restart.
    optional bool requires_staging = 3;
    // Rollback should be enabled for this install.
    optional bool rollback_enabled = 4;
    // Requires low latency monitoring if possible.
    optional bool requires_low_latency_monitor = 5;

    enum State {
        UNKNOWN = 0;
        INSTALL_REQUESTED = 1;
        INSTALL_STARTED = 2;
        INSTALL_STAGED_NOT_READY = 3;
        INSTALL_STAGED_READY = 4;
        INSTALL_SUCCESS = 5;
        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
        // and INSTALL_FAILURE_COMMIT.
        INSTALL_FAILURE = 6  [deprecated = true];
        // This enum is for installs that are manually cancelled via the Manual Update UI.
        INSTALL_CANCELLED = 7;
        INSTALLER_ROLLBACK_REQUESTED = 8;
        INSTALLER_ROLLBACK_INITIATED = 9;
        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
        INSTALLER_ROLLBACK_STAGED = 11;
        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
        INSTALLER_ROLLBACK_SUCCESS = 15;
        INSTALLER_ROLLBACK_FAILURE = 16;
        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
        INSTALL_STAGED_CANCEL_REQUESTED = 20;
        INSTALL_STAGED_CANCEL_SUCCESS = 21;
        INSTALL_STAGED_CANCEL_FAILURE = 22;
        INSTALL_FAILURE_DOWNLOAD = 23;
        INSTALL_FAILURE_STATE_MISMATCH = 24;
        INSTALL_FAILURE_COMMIT = 25;
        REBOOT_TRIGGERED = 26;
        // Logged after INSTALL_REQUESTED for devices installing a train that
        // contains no module requiring reboot.
        REBOOT_NOT_REQUIRED = 27;
        // Logged after INSTALL_REQUESTED for devices that are installing a train
        // which requires reboot and eligible for soft restart.
        SOFT_RESTART_ELIGIBLE = 28;
        // Logged after INSTALL_REQUESTED for devices that are installing a train
        // which requires reboot and eligible for notification restart.
        NOTIFICATION_RESTART_ELIGIBLE = 29;
        // Logged after INSTALL_REQUESTED for devices that are installing a train
        // which requires reboot and not eligible for any reboot promotion strategy
        // (e.g. soft restart, notification restart).
        NO_REBOOT_PROMOTION_STRATEGY_ELIGIBLE = 30;
        REBOOT_TRIGGER_FAILURE = 31;
        // Logged after INSTALL_REQUESTED for devices installing a train which
        // requires reboot and eligible for unattended reboot.
        UNATTENDED_REBOOT_ELIGIBLE = 32;
        // Logged when Phonesky trys to prepare LSKF.
        LSKF_PREPARATION_INITITATED = 33;
        // Logged when LSKF preparation succeeded.
        LSKF_PREPARATION_SUCCESS = 34;
        // Logged when LSKF preparation failed.
        LSKF_PREPARATION_FAILURE = 35;
        // Logged when Phonesky cannot schedule reboot job on a unattended reboot
        // eligible device.
        UNATTENDED_REBOOT_NOT_TRIGGERED = 36;
        // Logged when SIM PIN recovery preparation succeeded.
        SIM_PIN_PREPARATION_SUCCESS = 37;
        // Logged when SIM PIN recovery preparation failed.
        SIM_PIN_PREPARATION_FAILURE = 38 [deprecated = true];
        // Logged when unattended reboot is aborted and falls back to organic
        // reboot.
        UNATTENDED_REBOOT_ABORT = 39;
        // Logged when Phonesky re-prepares LSKF.
        LSKF_PREPARATION_RETRY = 40;
        // Logged when the device doesn’t support checkpoint and cannot stage
        // multiple sessions.
        CHECKPOINT_NOT_SUPPORTED = 41;
        // Logged when Phonesky instructs Android platform to monitor reboot
        // readiness signal.
        PENDING_REBOOT_MARKED = 42;
        // Logged when Phonesky instructs Android platform to stop monitoring reboot
        // readiness signal.
        PENDING_REBOOT_CANCELLED = 43 [deprecated = true];
        // Logged when Phonesky receives reboot readiness broadcast and the device
        // is ready to reboot.
        SIGNAL_READY_TO_REBOOT_RECEIVED = 44;
        // Logged when Phonesky receives reboot readiness broadcast and the device
        // is not ready to reboot.
        SIGNAL_NOT_READY_TO_REBOOT_RECEIVED = 45;
        // Logged when Phonesky cancels an untracked train.
        UNTRACKED_TRAIN_CANCELLED = 46;
    }
    optional State state = 6;
    // Possible experiment ids for monitoring this push.
    optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
    // Index of the Android User. E.g. 0 for primary profile, 10, 11, 12
    // for guest and secondary profiles. Not PII.
    optional int32 user_id = 8;
    // Log additional info for a state when needed.
    // When state = REBOOT_TRIGGERED, this field logs the reboot type:
    //  USERSPACE_REBOOT = 1.
    //  FORCED_REBOOT = 2.
    //  NOTIFICATION_RESTART_REBOOT = 3.
    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 4.
    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 5.
    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 6.
    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 7.
    // When state = INSTALL_FAILURE, this field logs the Install errors related
    // statusCode
    // When state = UNATTENDED_REBOOT_ABORT, this field logs the cancellation
    // reason:
    //  LSKF_RETRY_EXCEED_MAXIMUM = 1.
    //  SIM_PIN_NOT_PREPARED = 2.
    // When state = UNATTENDED_REBOOT_ELIGIBLE, this field logs the cancellation
    // reason:
    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 1.
    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 2.
    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 3.
    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 4.
    // When state = UNATTENDED_REBOOT_NOT_TRIGGERED, this field logs the
    // cancellation reason:
    //  LSKF_NOT_PREPARED = 1.
    //  REBOOT_NOT_READY = 2.
    // When state = PENDING_REBOOT_CANCELLED, this field logs the cancellation
    // reason:
    //  LSKF_NOT_PREPARED = 1.
    //  NO_STAGED_TRAIN = 2.
    //  HAS_SIM_PIN_AND_SIM_PIN_STORAGE_DISABLED = 3.
    optional int32 reason = 9;
    // Whether or not this is a rollback event.
    optional bool is_rollback = 10;
}

/* Test atom, is not logged anywhere */
message TestAtomReported {
    repeated AttributionNode attribution_node = 1;
    optional int32 int_field = 2;
    optional int64 long_field = 3;
    optional float float_field = 4;
    optional string string_field = 5;
    optional bool boolean_field = 6;
    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
    }
    optional State state = 7;
    optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
    repeated int32 repeated_int_field = 9;
    repeated int64 repeated_long_field = 10;
    repeated float repeated_float_field = 11;
    repeated string repeated_string_field = 12;
    repeated bool repeated_boolean_field = 13;
    repeated State repeated_enum_field = 14;
}

/** Represents USB port overheat event. */
message UsbPortOverheatEvent {
    /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
    optional int32 plug_temperature_deci_c = 1;

    /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
    optional int32 max_temperature_deci_c = 2;

    /* Time between USB plug event and overheat threshold trip, in seconds. */
    optional int32 time_to_overheat_secs = 3;

    /* Time between overheat threshold trip and hysteresis, in seconds. */
    optional int32 time_to_hysteresis_secs = 4;

    /* Time between hysteresis and active mitigation ending, in seconds. */
    optional int32 time_to_inactive_secs = 5;
};

/**
 * Logs total effective full charge and discharge cycles on a battery.
 * Here are some examples of one effective cycle:
 *   1) the battery charges from 0% to 100% and drains back to 0%,
 *   2) charging from 50% to 100% and draining back to 50% twice.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryCycleCount {
    /* Number of total charge and discharge cycles on the system battery. */
    optional int32 cycle_count = 1;
}

/**
 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
 * others), its type (public or private) and the size in bytes.
 * Pulled from:
 *   StatsCompanionService
 */

message ExternalStorageInfo {

    enum VolumeType {
        UNKNOWN = 0;
        PUBLIC = 1;
        PRIVATE = 2;
        OTHER = 3;
    }

    // The type of external storage.
    optional android.stats.storage.ExternalStorageType storage_type = 1;
    // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
    optional VolumeType volume_type = 2;
    // Total size of the sd card in bytes.
    optional int64 size_bytes = 3;
}

/*
 * Logs when a connection becomes available and lost.
 * Logged in StatsCompanionService.java
 */
message ConnectivityStateChanged {
  // Id of the network.
  optional int32 net_id = 1;

  enum State {
    UNKNOWN = 0;
    CONNECTED = 1;
    DISCONNECTED = 2;
  }
  // Connected state of a network.
  optional State state = 2;
}

/**
 * Logs when a service starts and stops.
 * Logged from:
 *   services/core/java/com/android/server/am/ActiveServices.java
 */
message ServiceStateChanged {

    optional int32 uid = 1 [(is_uid) = true];

    optional string package_name = 2;

    optional string service_name = 3;

    enum State {
        START = 1;
        STOP = 2;
    }

    optional State state = 4;
}

/**
 * Logs when a service is launched.
 * Logged from:
 *   services/core/java/com/android/server/am/ActiveServices.java
 */
message ServiceLaunchReported {

    optional int32 uid = 1 [(is_uid) = true];

    optional string package_name = 2;

    optional string service_name = 3;
}

/**
 * The type of process start. It's the same as ProcessStartTime.StartType but we
 * can't re-type that for background compatibility.
 */
enum ProcessStartType {
    PROCESS_START_TYPE_UNKNOWN = 0;
    PROCESS_START_TYPE_WARM = 1;
    PROCESS_START_TYPE_HOT = 2;
    PROCESS_START_TYPE_COLD = 3;
}

/**
 * The stopped state of a package.
 */
enum PackageStoppedState {
    PACKAGE_STATE_UNKNOWN = 0;
    PACKAGE_STATE_NORMAL = 1; // The package is not in any stopped state
    PACKAGE_STATE_STOPPED = 2; // ApplicationInfo.FLAG_STOPPED
}

/**
 * Logs when a service request is made.
 * Logged from:
 *   services/core/java/com/android/server/am/ActiveServices.java
 */
message ServiceRequestEventReported {
    /** The package uid of the service host. */
    optional int32 uid = 1 [(is_uid) = true];

    /** The package uid of the service launch request. */
    optional int32 requester_uid = 2 [(is_uid) = true];

    /** The action name of the service request. */
    optional string action_name = 3;

    /**
     * The types of the requests to the service.
     */
    enum RequestType {
        UNKNOWN = 0;
        START = 1;
        BIND = 2;
    }

    /** The type of the current request to the service.*/
    optional RequestType request_type = 4;

    /** Whether or not it's requested to start as a foreground service. */
    optional bool fg_required = 5;

    /** The start type of the host process. */
    optional ProcessStartType proc_start_type = 6;

    /** The process name who requests the service launch */
    optional string request_process_name = 7;

    /** The service component name, here consists of the class name part only */
    optional string service_component_name = 8;

    /** The state the package was in when the service was requested */
    optional PackageStoppedState package_stopped_state = 9;

    /** The package name of the service host */
    optional string package_name = 10;

    /** The package name of the service lunch request */
    optional string requester_package_name = 11;

    /** The process state of the requester */
    optional android.app.ProcessStateEnum requester_process_state = 12;

    /** The process state of the service host before this service request */
    optional android.app.ProcessStateEnum service_process_state = 13;
}

/**
 * Logs indicating a broadcast is being delivered to a receiver.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
 */
message BroadcastDeliveryEventReported {
    /** The package uid of the broadcast receiver. */
    optional int32 uid = 1 [(is_uid) = true];

    /** The package uid of the broadcast sender. */
    optional int32 sender_uid = 2 [(is_uid) = true];

    /** The action name of the broadcast. */
    optional string action_name = 3;

    /**
     * The types of the broadcast receivers.
     */
    enum ReceiverType {
        UNKNOWN = 0;
        RUNTIME = 1;
        MANIFEST = 2;
    }

    /** The type of the current broadcast receiver. */
    optional ReceiverType receiver_type = 4;

    /** The start type of the host process. */
    optional ProcessStartType proc_start_type = 5;

    /** The delay in ms from enqueue to dispatch of this intent to the set of receivers. */
    optional int64 dispatch_delay = 6;

    /** The delay in ms from beginning of dispatch to this specific receiver. */
    optional int64 receive_delay = 7;

    /** The delay in ms from dispatch to finish the handling of this intent. */
    optional int64 finish_delay = 8;

    /** The stopped state (if any) the package was in before the broadcast was delivered */
    optional PackageStoppedState package_stopped_state = 9;

    /** The package name of the broadcast receiver */
    optional string package_name = 10;

    /** The package name of the broadcast sender */
    optional string sender_package_name = 11;

    /** The type of the broadcast */
    optional int32 broadcast_type = 12;

    /** Delivery group policy set for the broadcast */
    optional android.app.BroadcastDeliveryGroupPolicy delivery_group_policy = 13;

    /** Flags set in the broadcast intent */
    optional int32 intent_flags = 14;

    /** The intent filter priority of the broadcast receiver */
    optional int32 filter_priority = 15;

    /** The procstate of the broadcast sender */
    optional android.app.ProcessStateEnum sender_proc_state = 16;

    /** The procstate of the broadcast receiver before receiving this broadcast */
    optional android.app.ProcessStateEnum receiver_process_state = 17;
}

/**
 * Logs indicating a client is requesting to acquire a provider,
 * this doesn't include the case where the provider has been installed in the
 * client's process space and it's just increasing a ref count.
 *
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
 */
message ProviderAcquisitionEventReported {
    /** The package uid of the content provider host. */
    optional int32 uid = 1 [(is_uid) = true];

    /** The package uid of the content provider client who makes the request. */
    optional int32 client_uid = 2 [(is_uid) = true];

    /** The start type of the host process. */
    optional ProcessStartType proc_start_type = 3;

    /** The stopped state (if any) the package was in when acquiring the provider */
    optional PackageStoppedState package_stopped_state = 4;

    /** The package name of the content provider host. */
    optional string package_name = 5;

    /** The package name of the content provider client who makes the request. */
    optional string client_package_name = 6;

    /** The process state of the client */
    optional android.app.ProcessStateEnum client_process_state = 7;

    /** The process state of the content provider host before being acquired */
    optional android.app.ProcessStateEnum provider_process_state = 8;
}

/**
 * Logs when a hidden API is used.
 *
 * Logged from:
 *     libcore/libart/src/main/java/dalvik/system/VMRuntime.java
 */
message HiddenApiUsed {
    // The uid of the app making the hidden access.
    optional int32 uid = 1 [(is_uid) = true];

    // Signature of the method or field accessed.
    optional string signature = 2;

    enum AccessMethod {
        NONE = 0;
        REFLECTION = 1;
        JNI = 2;
        LINKING = 3;
    }

    // Type of access.
    optional AccessMethod access_method = 3;

    // Whether the access was prevented or not.
    optional bool access_denied = 4;
}

/**
 * Logs user interaction with the Privacy Indicators added in Q. In particular:
 * - When user sees privacy chip
 * - When user clicks privacy chip
 * - How does the user exit the Privacy Dialog
 * Logged from:
 *   packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
 */
message PrivacyIndicatorsInteracted {

    enum Type {
        UNKNOWN = 0;
        CHIP_VIEWED = 1;
        CHIP_CLICKED = 2;
        reserved 3; // Used only in beta builds, never shipped
        DIALOG_DISMISS = 4;
        DIALOG_LINE_ITEM = 5;
    }

    optional Type type = 1 [(state_field_option).exclusive_state = true];
}

/**
 * Logs information about a package that is moved from the internal to external storage and vice
 * versa.
 * It logs the package name, the type of the external storage where the package is installed
 * (if moved to external storage, or UNKNOWN if moved to internal storage),
 * and the move type: if it's from internal to external or the other way around.
 *
 * Logged from:
        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
 */
message AppMovedStorageReported {
    enum MoveType {
        UNKNOWN = 0;
        TO_EXTERNAL = 1;
        TO_INTERNAL = 2;
    }
    // The type of the external storage.
    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
    // The type of move.
    optional MoveType move_type = 2;
    // The name of the package that was moved.
    optional string package_name = 3;
}

/**
 * Logs when system server watchdog occurs.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
 */
message SystemServerWatchdogOccurred {
    optional string subject = 1;
}

/**
 * Logs when system server pre-watchdog occurs.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
 */
message SystemServerPreWatchdogOccurred {
}

/**
 * Logs when new file added to tombstones.
 * Logged from:
 *      frameworks/base/core/java/com/android/server/BootReceiver.java
 */
message TombStoneOccurred {
}

/*
 * Information about a role request
 *
 * Logged from:
 *   packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
 */
message RoleRequestResultReported {
    // UID of application requesting the role
    optional int32 requesting_uid = 1;

    // Package name of application requesting the role
    optional string requesting_package_name = 2;

    // The role to be granted
    optional string role_name = 3;

    // The count of applications qualifying for the role
    optional int32 qualifying_count = 4;

    // UID of application current granted the role
    optional int32 current_uid = 5;

    // Package name of application current granted the role
    optional string current_package_name = 6;

    // UID of another application that user chose to grant the role to, instead of the requesting
    // application
    optional int32 granted_another_uid = 7;

    // Package name of another application that user chose to grant the role to, instead of the
    // requesting application
    optional string granted_another_package_name = 8;

    enum Result {
        UNDEFINED = 0;
        // role request was ignored
        IGNORED = 1;
        // role request was ignored because it's already granted
        IGNORED_ALREADY_GRANTED = 2;
        // role request was ignored because the application isn't qualified
        IGNORED_NOT_QUALIFIED = 3;
        // role request was ignored because user said it should be always denied
        IGNORED_USER_ALWAYS_DENIED = 4;
        // role was granted by user action
        USER_GRANTED = 5;
        // role was denied by user action
        USER_DENIED = 6;
        // role was denied by user granting another application the role
        USER_DENIED_GRANTED_ANOTHER = 7;
        // role was denied and set to be always denied by the user
        USER_DENIED_WITH_ALWAYS = 8;
        // role request was ignored because the user is blocked from changing
        // roles via DISALLOW_CONFIG_DEFAULT_APPS user restriction
        IGNORED_USER_RESTRICTION = 9;
    }
    // The result of the role request
    optional Result result = 9;
}

/**
 * Logs when a Vehicle Maps Service client's connection state has changed
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
 */
message VmsClientConnectionStateChanged {
    // The UID of the VMS client app
    optional int32 uid = 1 [(is_uid) = true];

    enum State {
        UNKNOWN = 0;
        // Attempting to connect to the client
        CONNECTING = 1;
        // Client connection established
        CONNECTED = 2;
        // Client connection closed unexpectedly
        DISCONNECTED = 3;
        // Client connection closed by VMS
        TERMINATED = 4;
        // Error establishing the client connection
        CONNECTION_ERROR = 5;
    }

    optional State state  = 2;
}

message MimeTypes {
    repeated string mime_types = 1;
}

/**
 * Logs statistics regarding accesses to external storage.
 * All stats are normalized for one day period.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
 */
message GeneralExternalStorageAccessStats {
    optional int32 uid = 1 [(is_uid) = true];
    // Total number of accesses like creation, open, delete and rename/update.
    // Includes file path and ContentResolver accesses
    optional uint32 total_accesses = 2;
    // Number of file path accesses, as opposed to file path and ContentResolver.
    optional uint32 file_path_accesses = 3;
    // Number of accesses on secondary volumes like SD cards.
    // Includes file path and ContentResolver accesses
    optional uint32 secondary_storage_accesses = 4;
    // Comma-separated list of mime types that were accessed.
    optional MimeTypes mime_types_accessed = 5 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when MediaProvider has successfully finished scanning a storage volume.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
 */
message MediaProviderScanOccurred {
    enum Reason {
        // Scan triggered due to unknown reason
        UNKNOWN = 0;
        // Scan triggered due to storage volume being mounted
        MOUNTED = 1;
        // Scan triggered due to explicit user action or app request
        DEMAND = 2;
        // Scan triggered due to idle maintenance
        IDLE = 3;
    }

    // Volume type that this event pertains to
    optional android.stats.mediaprovider.VolumeType volume_type = 1;
    // Reason why this scan was triggered
    optional Reason reason = 2;
    // Total number of files scanned
    optional int64 item_count = 3;
    // Duration of scan, normalized per file
    optional float normalized_duration_millis = 4;
    // Number of database inserts, normalized per file
    optional float normalized_insert_count = 5;
    // Number of database updates, normalized per file
    optional float normalized_update_count = 6;
    // Number of database deletes, normalized per file
    optional float normalized_delete_count = 7;
}

/**
 * Logs when an app has asked MediaProvider to delete media belonging to the user.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
 */
message MediaContentDeleted {
    // Volume type that this event pertains to
    optional android.stats.mediaprovider.VolumeType volume_type = 1;
    // UID of app that requested deletion
    optional int32 uid = 2 [(is_uid) = true];
    // Number of items that were deleted
    optional int32 item_count = 3;
}

/**
 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
 */
message MediaProviderPermissionRequested {
    enum Result {
        UNKNOWN = 0;
        USER_GRANTED = 1;
        AUTO_GRANTED = 2;
        USER_DENIED = 3;
        USER_DENIED_WITH_PREJUDICE = 4;
        AUTO_DENIED = 5;
    }

    // Volume type that this event pertains to
    optional android.stats.mediaprovider.VolumeType volume_type = 1;
    // UID of app that requested permission
    optional int32 uid = 2 [(is_uid) = true];
    // Number of items that were requested
    optional int32 item_count = 3;
    // Result of this request
    optional Result result = 4;
}

/**
 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
 */
message MediaProviderSchemaChanged {
    // Volume type that this event pertains to
    optional android.stats.mediaprovider.VolumeType volume_type = 1;
    // Old database version code
    optional int32 version_from = 2;
    // New database version code
    optional int32 version_to = 3;
    // Total number of files in database
    optional int64 item_count = 4;
    // Duration of schema change, normalized per file
    optional float normalized_duration_millis = 5;
}

/**
 * Logs when MediaProvider has finished an idle maintenance job.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
 */
message MediaProviderIdleMaintenanceFinished {
    // Volume type that this event pertains to
    optional android.stats.mediaprovider.VolumeType volume_type = 1;

    // Total number of files in database
    optional int64 item_count = 2;
    // Duration of idle maintenance, normalized per file
    optional float normalized_duration_millis = 3;
    // Number of thumbnails found to be stale, normalized per file
    optional float normalized_stale_thumbnails = 4;
    // Number of items found to be expired, normalized per file
    optional float normalized_expired_media = 5;
}

/**
 * Represents boot time event with duration in ms.
 *
 * Logged from: bootstat and various system server components. Check each enums for details.
 */
message BootTimeEventDuration {
    enum DurationEvent {
        UNKNOWN = 0;
        // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
        ABSOLUTE_BOOT_TIME = 1;
        // Bootloader's 1st stage execution time.
        // Logged from bootstat.
        BOOTLOADER_FIRST_STAGE_EXEC = 2;
        // Bootloader's 1st stage loading time.
        // Logged from bootstat.
        BOOTLOADER_FIRST_STAGE_LOAD = 3;
        // Bootloader's kernel loading time.
        // Logged from bootstat.
        BOOTLOADER_KERNEL_LOAD = 4;
        // Bootloader's 2nd stage execution time.
        // Logged from bootstat.
        BOOTLOADER_SECOND_STAGE_EXEC = 5;
        // Bootloader's 2nd stage loading time.
        // Logged from bootstat.
        BOOTLOADER_SECOND_STAGE_LOAD = 6;
        // Duration for Bootloader to show unlocked device's warning UI. This should not happen
        // for locked device.
        // Logged from bootstat.
        BOOTLOADER_UI_WAIT = 7;
        // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
        // Logged from bootstat.
        BOOTLOADER_TOTAL = 8;
        // Shutdown duration inside init for the reboot before the current boot up.
        // Logged from f/b/services/.../BootReceiver.java.
        SHUTDOWN_DURATION = 9;
        // Total time for mounting of disk devices during bootup.
        // Logged from f/b/services/.../BootReceiver.java.
        MOUNT_DEFAULT_DURATION = 10;
        // Total time for early stage mounting of disk devices during bootup.
        // Logged from f/b/services/.../BootReceiver.java.
        MOUNT_EARLY_DURATION = 11;
        // Total time for late stage mounting of disk devices during bootup.
        // Logged from f/b/services/.../BootReceiver.java.
        MOUNT_LATE_DURATION = 12;
        // Average time to scan non-system app after OTA
        // Logged from f/b/services/.../PackageManagerService.java
        OTA_PACKAGE_MANAGER_INIT_TIME = 13;
        // Time to initialize Package manager after OTA
        // Logged from f/b/services/.../PackageManagerService.java
        OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
        // Time to scan all system app from Package manager after OTA
        // Logged from f/b/services/.../PackageManagerService.java
        OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
        // Init's total time for cold boot stage.
        // Logged from bootstat.
        COLDBOOT_WAIT = 16;
        // Init's total time for initializing selinux.
        // Logged from bootstat.
        SELINUX_INIT = 17;
        // Time since last factory reset.
        // Logged from bootstat.
        FACTORY_RESET_TIME_SINCE_RESET = 18;
        // Init's total time spent for completing the 1st stage.
        // Logged from bootstat.
        ANDROID_INIT_STAGE_1 = 19;
    }

    // Type of the event.
    optional DurationEvent event = 1;
    // Duration of the event in ms.
    optional int64 duration_millis = 2;
}

/**
 * Represents the start of specific boot time event during bootup in ms. This is usually a time
 * since boot-up.
 *
 * Logged from: bootstat and various system server components. Check each enums for details.
 */
message BootTimeEventElapsedTime {
    enum ElapsedTimeEvent {
        UNKNOWN = 0;
        // Time when init starts 1st stage. Logged from bootstat.
        ANDROID_INIT_STAGE_1 = 1;
        // Time when sys.boot_completed prop is set.
        // Logged from bootstat.
        BOOT_COMPLETE = 2;
        // BOOT_COMPLETE for a device that uses full-disk encryption.  Note that
        // no devices running Android 13 or later use full-disk encryption, as
        // it has been replaced by file-based encryption.
        BOOT_COMPLETE_ENCRYPTION = 3;
        // BOOT_COMPLETE for a device that doesn't use full-disk encryption.
        BOOT_COMPLETE_NO_ENCRYPTION = 4;
        // Adjusted BOOT_COMPLETE for a device that uses full-disk encryption,
        // omitting the decryption time.
        BOOT_COMPLETE_POST_DECRYPT = 5;
        // BOOT_COMPLETE after factory reset.
        FACTORY_RESET_BOOT_COMPLETE = 6;
        // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
        FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
        // BOOT_COMPLETE_POST_DECRYPT after factory reset.
        FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
        // BOOT_COMPLETE after OTA.
        OTA_BOOT_COMPLETE = 9;
        // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
        OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
        // BOOT_COMPLETE_POST_DECRYPT after OTA.
        OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
        // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
        // Logged from  f/b/services/.../UserController.java
        FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
        // Time when the system starts sending BOOT_COMPLETED broadcast.
        // Logged from  f/b/services/.../UserController.java
        FRAMEWORK_BOOT_COMPLETED = 13;
        // Time when the package manager starts init.
        // Logged from f/b/services/.../SystemServer.java
        PACKAGE_MANAGER_INIT_START = 14;
        // Time when package manager is ready
        // Logged from f/b/services/.../SystemServer.java
        PACKAGE_MANAGER_INIT_READY = 15;
        // Represents the time when user has entered unlock credential for system with user pin.
        // Logged from bootstat.
        POST_DECRYPT = 16;
        // Represents the start of zygote's init.
        // Logged from zygote itself.
        ZYGOTE_INIT_START = 17;
        // Represents the start of secondary zygote's init.
        // TODO: add logging to zygote
        SECONDARY_ZYGOTE_INIT_START = 18;
        // Represents the start of system server's init.
        // Logged from f/b/services/.../SystemServer.java
        SYSTEM_SERVER_INIT_START = 19;
        // Represents the completion of system server's init.
        // Logged from f/b/services/.../SystemServer.java
        SYSTEM_SERVER_READY = 20;
        // Represents the start of launcher during boot-up.
        // TODO: add logging
        LAUNCHER_START = 21;
        // Represents the completion of launcher's initial rendering. User can use other apps from
        // launcher from this point.
        // TODO: add logging
        LAUNCHER_SHOWN = 22;
    }

    // Type of the event.
    optional ElapsedTimeEvent event = 1;
    // Time since bootup for the event.
    // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
    optional int64 time_millis = 2;
}

/**
 * Boot time events with UTC time.
 *
 * Logged from: bootstat and various system server components. Check each enums for details.
 */
message BootTimeEventUtcTime {
    enum UtcTimeEvent {
        UNKNOWN = 0;
        // Time of the bootstat's marking of 1st boot after the last factory reset.
        // Logged from bootstat.
        FACTORY_RESET_RESET_TIME = 1;
        // The time when bootstat records FACTORY_RESET_* events. This is close to
        // BOOT_COMPLETE time for the current bootup.
        // Logged from bootstat.
        FACTORY_RESET_CURRENT_TIME = 2;
        // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
        // Logged from bootstat.
        FACTORY_RESET_RECORD_VALUE = 3;
    }

    // Type of the event.
    optional UtcTimeEvent event = 1;
    // UTC time for the event.
    optional int64 utc_time_secs = 2;
}

/**
 * Boot time events representing specific error code during bootup.
 * Meaning of error code can be different per each event type.
 *
 * Logged from: bootstat and various system server components. Check each enums for details.
 */
message BootTimeEventErrorCode {
    enum ErrorCodeEvent {
        UNKNOWN = 0;
        // Linux error code for time() call to get the current UTC time.
        // Logged from bootstat.
        FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
        // Represents UmountStat before the reboot for the current boot up. Error codes defined
        // as UMOUNT_STAT_* from init/reboot.cpp.
        // Logged from f/b/services/.../BootReceiver.java.
        SHUTDOWN_UMOUNT_STAT = 2;
        // Reprepsents fie system mounting error code of /data partition for the current boot.
        // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
        // Logged from f/b/services/.../BootReceiver.java.
        FS_MGR_FS_STAT_DATA_PARTITION = 3;
    }

    // Type of the event.
    optional ErrorCodeEvent event = 1;
    // error code defined per each event type.
    // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
    // FS_MGR_FS_STAT.
    optional int32 error_code = 2;
}

/**
 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
 * after an OTA.
 *
 * Logged from:
 *  - system/update_engine/cleanup_previous_update_action.cc
 */
message SnapshotMergeReported {
    // Keep in sync with
    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
    enum UpdateState {
        // No update or merge is in progress.
        NONE = 0;
        // An update is applying; snapshots may already exist.
        INITIATED = 1;
        // An update is pending, but has not been successfully booted yet.
        UNVERIFIED = 2;
        // The kernel is merging in the background.
        MERGING = 3;
        // Post-merge cleanup steps could not be completed due to a transient
        // error, but the next reboot will finish any pending operations.
        MERGE_NEEDS_REBOOT = 4;
        // Merging is complete, and needs to be acknowledged.
        MERGE_COMPLETED = 5;
        // Merging failed due to an unrecoverable error.
        MERGE_FAILED = 6;
        // The update was implicitly cancelled, either by a rollback or a flash
        // operation via fastboot. This state can only be returned by WaitForMerge.
        CANCELLED = 7;
    };

    // Status codes correspond to specific failure conditions in
    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.cpp
    //
    // Keep in sync with
    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
    enum MergeFailureCode {
        OK = 0;
        READ_STATUS = 1;
        GET_TABLE_INFO = 2;
        UNKNOWN_TABLE = 3;
        GET_TABLE_PARAMS = 4;
        ACTIVATE_NEW_TABLE = 5;
        ACQUIRE_LOCK = 6;
        LIST_SNAPSHOTS = 7;
        WRITE_STATUS = 8;
        UNKNOWN_TARGET_TYPE = 9;
        QUERY_SNAPSHOT_STATUS = 10;
        EXPECTED_MERGE_TARGET = 11;
        UNMERGED_SECTORS_AFTER_COMPLETION = 12;
        UNEXPECTED_MERGE_STATE = 13;
        GET_COW_PATH_CONSISTENCY_CHECK = 14;
        OPEN_COW_CONSISTENCY_CHECK = 15;
        PARSE_COW_CONSISTENCY_CHECK = 16;
        OPEN_COW_DIRECT_CONSISTENCY_CHECK = 17;
        MEM_ALIGN_CONSISTENCY_CHECK = 18;
        DIRECT_READ_CONSISTENCY_CHECK = 19;
        WRONG_MERGE_COUNT_CONSISTENCY_CHECK = 20;
    };

    // Status of the update after the merge attempts.
    optional UpdateState final_state = 1;

    // Time to complete a merge operation in milliseconds.
    // A negative value corresponds to the case in which the merge operation
    // was interrupted and resumed (e.g. in case of a system reboot during the
    // merge).
    optional int64 duration_millis = 2;

    // Number of reboots that occurred after issuing and before completing the
    // merge of all the snapshot devices.
    optional int32 intermediate_reboots = 3;

    // The device has been upgraded to Virtual A/B.
    optional bool is_vab_retrofit = 4;

    // Space that has been temporarily allocated in the /data partition
    // containing the dm-snapshot's copy-on-write data generated during a
    // Virtual A/B update.
    optional int64 cow_file_size_bytes = 5;

    // Whether the device enables Virtual A/B compression.
    optional bool vab_compression_enabled = 6;

    // Whether this update attempt uses Virtual A/B compression.
    optional bool vab_compression_used = 7;

    // Total size used by COWs, including /data and the super partition.
    optional int64 total_cow_size_bytes = 8;

    // Sum of the estimated COW fields in the OTA manifest.
    optional int64 estimated_cow_size_bytes = 9;

    // Time from boot to sys.boot_completed, in milliseconds.
    optional int32 boot_complete_time_millis = 10;

    // Time from sys.boot_completed to merge start, in milliseconds.
    optional int32 boot_complete_to_merge_start_time_millis = 11;

    optional MergeFailureCode merge_failure_code = 12;

    // Build fingerprint at the time the OTA was downloaded.
    optional string source_build_fingerprint = 13;

    // Build fingerprint at the time the merge was initiated.
    optional string target_build_fingerprint = 14;

    // Whether the device enabled userspace snapshots.
    optional bool userspace_snapshots_enabled = 15;

    // Whether this update attempt used userspace snapshots.
    optional bool userspace_snapshots_used = 16;

    // Whether the device enabled XOR compression.
    optional bool xor_compression_enabled = 17;

    // Whether this update attempt used XOR compression.
    optional bool xor_compression_used = 18;

    // Whether this update attempt used io_uring.
    optional bool iouring_used = 19;
}

/**
 * Event representing when BlobStoreManager.Session#commit() is called
 *
 * Logged from:
 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
 */
message BlobCommitted {
    // Uid of the Blob committer
    optional int32 uid = 1 [(is_uid) = true];

    // Id of the Blob committed
    optional int64 blob_id = 2;

    // Size of the Blob
    optional int64 size = 3;

    enum Result {
        UNKNOWN = 0;
        // Commit Succeeded
        SUCCESS = 1;
        // Commit Failed: Error occurred during commit
        ERROR_DURING_COMMIT = 2;
        // Commit Failed: Digest of the data did not match Blob digest
        DIGEST_MISMATCH = 3;
        // Commit Failed: Allowed count limit exceeded
        COUNT_LIMIT_EXCEEDED = 4;
    }
    optional Result result = 4;
}

/**
 * Event representing when BlobStoreManager#acquireLease() is called
 *
 * Logged from:
 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
 */
message BlobLeased{
    // Uid of the Blob leasee
    optional int32 uid = 1 [(is_uid) = true];

    // Id of the Blob leased or 0 if the Blob does not exist
    optional int64 blob_id = 2;

    // Size of the Blob or 0 if the Blob does not exist
    optional int64 size = 3;

    enum Result {
        UNKNOWN = 0;
        // Lease Succeeded
        SUCCESS = 1;
        // Lease Failed: Blob does not exist
        BLOB_DNE = 2;
        // Lease Failed: Leasee does not have access to the Blob
        ACCESS_NOT_ALLOWED = 3;
        // Lease Failed: Leasee requested an invalid expiry duration
        LEASE_EXPIRY_INVALID = 4;
        // Lease Failed: Leasee has exceeded the total data lease limit
        DATA_SIZE_LIMIT_EXCEEDED = 5;
        // Leasee Failed: Allowed count limit exceeded
        COUNT_LIMIT_EXCEEDED = 6;
    }
    optional Result result = 4;
}

/**
 * Event representing when BlobStoreManager#openBlob() is called
 *
 * Logged from:
 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
 */
message BlobOpened{
    // Uid of the Blob opener
    optional int32 uid = 1 [(is_uid) = true];

    // Id of the Blob opened or 0 if the Blob does not exist
    optional int64 blob_id = 2;

    // Size of the Blob or 0 if the Blob does not exist
    optional int64 size = 3;

    enum Result {
        UNKNOWN = 0;
        // Open Succeeded
        SUCCESS = 1;
        // Open Failed: Blob does not exist
        BLOB_DNE = 2;
        // Open Failed: Opener does not have access to the Blob
        ACCESS_NOT_ALLOWED = 3;
    }
    optional Result result = 4;
}

/**
 * Event to track Jank for various system interactions.
 *
 * Logged from:
 *  frameworks/base/core/java/com/android/internal/jank/FrameTracker.java
 *
 * Next Tag: 10
 */
message UIInteractionFrameInfoReported {
    optional android.jank.InteractionType interaction_type = 1;

    optional android.jank.DisplayResolution display_resolution = 8;

    optional android.jank.DisplayRefreshRate display_refresh_rate = 9;

    // Number of frames rendered during the interaction.
    optional int64 total_frames = 2;

    // Number of frames that were skipped in rendering during the interaction.
    optional int64 missed_frames = 3;

    // Number of frames that were missed in Surface Flinger during the interaction.
    optional int64 sf_missed_frames = 5;

    // Number of frames that were missed in the app during the interaction.
    optional int64 app_missed_frames = 6;

    // Maximum time it took to render a single frame during the interaction.
    optional int64 max_frame_time_nanos = 4;

    // Maximum number of successive frames missed.
    optional int64 max_successive_missed_frames = 7;
}

/**
 * Event to track various latencies in SystemUI.
 *
 * Logged from:
 *  frameworks/base/core/java/com/android/internal/util/LatencyTracker.java
 */
message UIActionLatencyReported {
    optional android.jank.ActionType action = 1;

    optional int64 latency_millis = 2;
}

//////////////////////////////////////////////////////////////////////
// Pulled atoms below this line //
//////////////////////////////////////////////////////////////////////

/**
 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
 */
message WifiBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;
}

/**
 * Pulls bytes transferred via wifi (separated by foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
 */
message WifiBytesTransferByFgBg {
    optional int32 uid = 1 [(is_uid) = true];

    // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
    optional bool is_foreground = 2;

    optional int64 rx_bytes = 3;

    optional int64 rx_packets = 4;

    optional int64 tx_bytes = 5;

    optional int64 tx_packets = 6;
}

/**
 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
 */
message MobileBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;
}

/**
 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
 */
message MobileBytesTransferByFgBg {
    optional int32 uid = 1 [(is_uid) = true];

    // 1 denotes foreground and 0 denotes background. This is called Set in
    // NetworkStats.
    optional bool is_foreground = 2;

    optional int64 rx_bytes = 3;

    optional int64 rx_packets = 4;

    optional int64 tx_bytes = 5;

    optional int64 tx_packets = 6;
}

/**
 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
 * Note that the data is expected to be sliced into more dimensions in future. In other words,
 * the caller must not assume any row of data is one full report when filtering with a set of
 * matching conditions, because future data may represent with multiple rows what is currently
 * represented by one.
 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
 * query all the existing columns.
 *
 * Pulled from:
 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
 */
message DataUsageBytesTransfer {
    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
    // states combined, not including debug states. See NetworkStats#SET_*.
    optional int32 state = 1;

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;

    // Radio Access Technology (RAT) type of this record, should be one of
    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
    // the record is for all rat types combined.
    optional int32 rat_type = 6;

    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
    // record is combined across subscriptions.
    optional string sim_mcc = 7;
    optional string sim_mnc = 8;

    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
    // See TelephonyManager#getSimCarrierId.
    optional int32 carrier_id = 9;

    // Enumeration of opportunistic states with an additional ALL state indicates the record is
    // combined regardless of the boolean value in its field.
    enum DataSubscriptionState {
        UNKNOWN = 0; // For server side backward compatibility.
        ALL = 1;
        OPPORTUNISTIC = 2;
        NOT_OPPORTUNISTIC = 3;
    }
    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
    // record is combined across opportunistic data subscriptions.
    // See {@link SubscriptionManager#setOpportunistic}.
    optional DataSubscriptionState opportunistic_data_sub = 10;

    // Indicate whether NR is connected, server side could use this with RAT type to determine if
    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
    // connected.
    optional bool is_nr_connected = 11;
}

/**
 * Note: This is a copy from DataUsageBytesTransfer and add a metered field.
 * TODO: DataUsageBytesTransfer should be eventually replaced with DataUsageBytesTransferV2.
 *
 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
 * Note that the data is expected to be sliced into more dimensions in future. In other words,
 * the caller must not assume any row of data is one full report when filtering with a set of
 * matching conditions, because future data may represent with multiple rows what is currently
 * represented by one.
 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
 * query all the existing columns.
 *
 * Pulled from:
 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
 */
message DataUsageBytesTransferV2 {
    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
    // states combined, not including debug states. See NetworkStats#SET_*.
    optional int32 state = 1;

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;

    // Radio Access Technology (RAT) type of this record, should be one of
    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
    // the record is for all rat types combined.
    optional int32 rat_type = 6;

    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
    // record is combined across subscriptions.
    optional string sim_mcc = 7;
    optional string sim_mnc = 8;

    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
    // See TelephonyManager#getSimCarrierId.
    optional int32 carrier_id = 9;

    // Enumeration of opportunistic states with an additional DSS_ALL state indicates the record is
    // combined regardless of the boolean value in its field.
    enum DataSubscriptionState {
        DSS_UNKNOWN = 0; // For server side backward compatibility.
        DSS_ALL = 1;
        DSS_OPPORTUNISTIC = 2;
        DSS_NOT_OPPORTUNISTIC = 3;
    }
    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
    // record is combined across opportunistic data subscriptions.
    // See {@link SubscriptionManager#setOpportunistic}.
    optional DataSubscriptionState opportunistic_data_sub = 10;

    // Indicate whether NR is connected, server side could use this with RAT type to determine if
    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
    // connected.
    optional bool is_nr_connected = 11;

    // Enumeration of metered states.
    enum MeteredState {
        METERED_UNKNOWN = 0;
        METERED_ALL = 1;
        METERED_NO = 2;
        METERED_YES = 3;
    }
    // Mark the reported data is metered or non-metered, and METERED_ALL indicates the record is
    // combined across metered data.
    optional MeteredState metered = 12;
}

/**
 * Pulls bytes transferred via OEM managed networks. Data is split up by which
 * type of OEM managed network it is, what transport it went over, and if it was
 * in the foreground or background.
 *
 * Pulled from:
 *   StatsPullAtomService
 */
 message OemManagedBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    // 1 denotes foreground and 0 denotes background. This is called Set in
    // NetworkStats.
    optional bool is_foreground = 2;

    // Corresponds to the type of OEM managed network, see
    // {@link NetworkTemplate#OEM_MANAGED_ANY} and {@code NetworkIdentity#OEM_*}.
    optional int32 oem_managed_type = 3;

    // Corresponds to the type of transport the bytes were transferred over, see
    // {@link NetworkTemplate#transportToMatchRule} and
    // {@code NetworkCapabilities#TRANSPORT_*}
    optional int32 transport_type = 4;

    optional int64 rx_bytes = 5;

    optional int64 rx_packets = 6;

    optional int64 tx_bytes = 7;

    optional int64 tx_packets = 8;
  }

/**
 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
 *
 * Pulled from:
 *   StatsCompanionService
 */
message BluetoothBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 tx_bytes = 3;
}

/**
 * Pulls the kernel wakelock durations. This atom is adapted from
 * android/internal/os/KernelWakelockStats.java
 *
 * Pulled from:
 *   StatsCompanionService using KernelWakelockReader.
 */
message KernelWakelock {
    optional string name = 1;

    optional int32 count = 2;

    optional int32 version = 3;

    optional int64 time_micros = 4;
}

/**
 * Pulls power state information.
 * Pulled from:
 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
 */
message SubsystemSleepState {
    // Subsystem name
    optional string subsystem_name = 1;
    // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
    // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
    // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
    //    powerEntityStateName from the corresponding PowerEntityStateInfo.
    optional string subname = 2;
    // The number of times it entered, or voted for entering the sleep state
    optional uint64 count = 3;
    // The length of time spent in, or spent voting for, the sleep state
    optional uint64 time_millis = 4;
}

/**
 * Pulls on-device power measurement information.
 * Pulled from:
 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
 */
message OnDevicePowerMeasurement {
    // Name of the subsystem (to which the rail belongs).
    optional string subsystem_name = 1;

    // Rail name. The rail lies within the subsystem.
    optional string rail_name = 2;

    // Time (in ms since boot) at which the rail energy value was measured.
    // This may differ slightly from the time that statsd logs this information.
    optional uint64 measurement_timestamp_millis = 3;

    // Accumulated energy used via the rail since device boot in uWs.
    optional uint64 energy_microwatt_secs = 4;
}

/**
 * Pulls Cpu time per cluster per frequency.
 * This is tracked by the timeInState eBPF program.
 */
message CpuTimePerClusterFreq {
    optional uint32 cluster = 1;
    optional uint32 freq_khz = 2;
    // Time spent at this frequency excluding sleep since tracking started.
    optional uint64 time_millis = 3;
}

/**
 * Pulls Cpu Time Per Uid.
 * Note that isolated process uid time should be attributed to host uids.
 */
message CpuTimePerUid {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint64 user_time_micros = 2;
    optional uint64 sys_time_micros = 3;
}

/**
 * Pulls Cpu Cycles Per Uid Per Cluster.
 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
 * because they are recycled and removed from the underlying data source. All uids are normalized
 * to their base uids.
 */
message CpuCyclesPerUidCluster {
    optional int32 uid = 1 [(is_uid) = true];
    optional int32 cluster = 2;
    // Megacycles, i.e. millions of cycles.
    optional int64 mcycles = 3;
    // Time excluding sleep since tracking started.
    optional int64 time_millis = 4;
    // Power estimate: time * average power for frequency / 1000.
    optional int64 power_profile_estimate = 5;
}

/**
 * Pulls Cpu Time Per Uid per frequency.
 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
 * because they are recycled and removed from the underlying data source. All uids are normalized
 * to their base uids.
 */
message CpuTimePerUidFreq {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint32 freq_index = 2;
    optional uint64 time_millis = 3;
}

/**
  * Pulls Cpu Cycles Per ThreadGroup Per Cluster.
  * This is tracked by the timeInState eBPF program.
  */
message CpuCyclesPerThreadGroupCluster {
    enum ThreadGroup {
        UNKNOWN_THREAD_GROUP = 0;

        // System server threads serving Binder calls.
        SYSTEM_SERVER_BINDER = 1;

        // All system server threads.
        SYSTEM_SERVER = 2;

        // All surface flinger threads.
        SURFACE_FLINGER = 3;
    }
    optional ThreadGroup thread_group = 1;

    optional int32 cluster = 2;

    // Megacycles, i.e. millions of cycles.
    optional int64 mcycles = 3;
    // Time excluding sleep since tracking started.
    optional int64 time_millis = 4;
}

/**
 * Pulls Wifi Controller Activity Energy Info
 */
message WifiActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // stack reported state
    // TODO: replace this with proto enum
    optional int32 stack_state = 2;
    // tx time in millis
    optional uint64 controller_tx_time_millis = 3;
    // rx time in millis
    optional uint64 controller_rx_time_millis = 4;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 5;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 controller_energy_used = 6;
}

/**
 * Pulls Modem Activity Energy Info
 */
message ModemActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // sleep time in millis.
    optional uint64 sleep_time_millis = 2;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 3;
    /**
     * Tx power index
     * index 0 = tx_power < 0dBm
     * index 1 = 0dBm < tx_power < 5dBm
     * index 2 = 5dBm < tx_power < 15dBm
     * index 3 = 15dBm < tx_power < 20dBm
     * index 4 = tx_power > 20dBm
     */
    // tx time in ms at power level 0
    optional uint64 controller_tx_time_pl0_millis = 4;
    // tx time in ms at power level 1
    optional uint64 controller_tx_time_pl1_millis = 5;
    // tx time in ms at power level 2
    optional uint64 controller_tx_time_pl2_millis = 6;
    // tx time in ms at power level 3
    optional uint64 controller_tx_time_pl3_millis = 7;
    // tx time in ms at power level 4
    optional uint64 controller_tx_time_pl4_millis = 8;
    // rx time in ms at power level 5
    optional uint64 controller_rx_time_millis = 9;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 energy_used = 10 [deprecated=true];
}

/**
 * Pulls Bluetooth Activity Energy Info
 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
 */
message BluetoothActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // bluetooth stack state
    optional int32 bluetooth_stack_state = 2;
    // tx time in millis
    optional uint64 controller_tx_time_millis = 3;
    // rx time in millis
    optional uint64 controller_rx_time_millis = 4;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 5;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 energy_used = 6;
}

/*
 * Logs the memory stats for a process.
 *
 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
 */
message ProcessMemoryState {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Usually package name, "system" for system server.
    // Provided by ActivityManagerService.
    optional string process_name = 2;

    // Current OOM score adjustment. Value read from ProcessRecord.
    optional int32 oom_adj_score = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    // Value is read from memory.stat, field total_rss if per-app memory
    // cgroups are enabled. Otherwise, value from /proc/pid/stat.
    optional int64 rss_in_bytes = 6;

    // CACHE
    // Value is read from memory.stat, field total_cache if per-app memory
    // cgroups are enabled. Otherwise, 0.
    optional int64 cache_in_bytes = 7;

    // SWAP
    // Value is read from memory.stat, field total_swap if per-app memory
    // cgroups are enabled. Otherwise, 0.
    optional int64 swap_in_bytes = 8;

    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
    optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];

    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
    optional int64 start_time_nanos = 10 [deprecated = true];

    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
    optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
}

/*
 * Logs the memory high-water mark for a process.
 *
 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
 * and for selected native processes.
 *
 * Pulling this atom resets high-water mark counters for all processes.
 */
message ProcessMemoryHighWaterMark {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Usually package name or process cmdline.
    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
    optional string process_name = 2;

    // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
    // computed by converting kilobytes to bytes.
    optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];

    // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
    // /proc/PID/status.
    optional int32 rss_high_water_mark_in_kilobytes = 4;
}

/*
 * Logs the memory stats for a process.
 *
 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
 * and for selected native processes.
 */
message ProcessMemorySnapshot {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Usually package name or process cmdline.
    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
    optional string process_name = 2;

    // The pid of the process.
    // Allows to disambiguate instances of the process.
    optional int32 pid = 3;

    // The current OOM score adjustment value.
    // Read from ProcessRecord for managed processes.
    // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
    optional int32 oom_score_adj = 4;

    // The current RSS of the process.
    // VmRSS from /proc/pid/status.
    optional int32 rss_in_kilobytes = 5;

    // The current anon RSS of the process.
    // RssAnon from /proc/pid/status.
    optional int32 anon_rss_in_kilobytes = 6;

    // The current swap size of the process.
    // VmSwap from /proc/pid/status.
    optional int32 swap_in_kilobytes = 7;

    // The sum of rss_in_kilobytes and swap_in_kilobytes.
    optional int32 anon_rss_and_swap_in_kilobytes = 8;

    // GPU memory usage as measured by the kernel tracepoints
    // Equivalent to dumpsys gpu --gpumem
    optional int32 gpu_memory_kb = 9;

    // Whether or not this process is hosting one or more foregound services.
    optional bool has_foreground_services = 10;

    // The current rss memory in shared space.
    optional int32 shmem_kb = 11;

    // The types of the components this process is hosting at the moment this
    // snapshot is taken.
    // See the available types in HostingComponentType in AppProtoEnums.
    optional int32 current_hosting_component_types = 12;

    // The historical types of the components this process is or was hosting
    // since it's born.
    // See the available types in HostingComponentType in AppProtoEnums.
    optional int32 historical_hosting_component_types = 13;
}

/*
 * Elapsed real time from SystemClock.
 */
message SystemElapsedRealtime {
    optional uint64 time_millis = 1;
}

/*
 * Up time from SystemClock.
 */
message SystemUptime {
    // Milliseconds since the system was booted.
    // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
    // for external input).
    // It is not affected by clock scaling, idle, or other power saving mechanisms.
    optional uint64 uptime_millis = 1;
}

/*
 * Reads from /proc/uid_concurrent_active_time which has the format:
 * active: X (X is # cores)
 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
 * [uid1]: [time-0] [time-1] [time-2] ... ...
 * ...
 * Time-N means the CPU time a UID spent running concurrently with N other processes.
 * The file contains a monotonically increasing count of time for a single boot.
 */
message CpuActiveTime {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint64 time_millis = 2;
}

/**
 * Reads from /proc/uid_concurrent_policy_time which has the format:
 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
 * ...
 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
 * The file contains a monotonically increasing count of time for a single boot.
 */
message CpuClusterTime {
    optional int32 uid = 1 [(is_uid) = true];
    optional int32 cluster_index = 2;
    optional uint64 time_millis = 3;
}

/*
 * Pulls free disk space, for data, system partition and temporary directory.
 */
message DiskSpace {
    // available bytes in data partition
    optional uint64 data_available_bytes = 1;
    // available bytes in system partition
    optional uint64 system_available_bytes = 2;
    // available bytes in download cache or temp directories
    optional uint64 temp_available_bytes = 3;
}

/**
 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
 *
 * Pulled from StatsCompanionService.java
 */
message RemainingBatteryCapacity {
    optional int32 charge_micro_ampere_hour = 1;
}

/**
 * Pulls battery capacity, which is the battery capacity when full in uAh.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message FullBatteryCapacity {
    optional int32 capacity_micro_ampere_hour = 1;
}

/**
 * Pulls battery voltage.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryVoltage {
    // The voltage of the battery, in millivolts.
    optional int32 voltage_millivolt = 1;
}

/**
 * Pulls battery level (percent full, from 0 to 100).
 *
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryLevel {
    // Battery level. Should be in [0, 100].
    optional int32 battery_level = 1;
}

/**
 * Pulls the temperature of various parts of the device.
 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
 *
 * Pulled from StatsCompanionService.java
 */
message Temperature {
    // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
    optional android.os.TemperatureTypeEnum sensor_location = 1;

    // The name of the temperature source. Eg. CPU0
    optional string sensor_name = 2;

    // Temperature in tenths of a degree C.
    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
    optional int32 temperature_deci_celsius = 3;

    // Relative severity of the throttling, see enum definition.
    optional android.os.ThrottlingSeverityEnum severity = 4;
}

/**
 * Pulls the statistics of calls to Binder.
 *
 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
 * config on the device.
 *
 * Next tag: 15
 */
message BinderCalls {
    // UID of the process responsible for the binder transaction. It will be set if the process
    // executing the binder transaction attribute the transaction to another uid using
    // Binder.setThreadWorkSource().
    //
    // If not set, the value will be -1.
    optional int32 uid = 1 [(is_uid) = true];
    // UID of the process executing the binder transaction.
    optional int32 direct_caller_uid = 14;
    // Fully qualified class name of the API call.
    //
    // This is a system server class name.
    //
    // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
    // gets recycled and we have isolated uids, we might attribute the data incorrectly.
    // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
    // commonly used APIs.
    optional string service_class_name = 2;
    // Method name of the API call. It can also be a transaction code if we cannot
    // resolve it to a name. See Binder#getTransactionName.
    //
    // This is a system server method name.
    optional string service_method_name = 3;
    // Total number of API calls.
    optional int64 call_count = 4;
    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
    optional bool screen_interactive = 13;
    // Total number of API calls we have data recorded for. If we collected data for all the calls,
    // call_count will be equal to recorded_call_count.
    //
    // If recorded_call_count is different than call_count, it means data collection has been
    // sampled. All the fields below will be sampled in this case.
    optional int64 recorded_call_count = 12;
    // Number of exceptions thrown by the API.
    optional int64 recorded_exception_count = 5;
    // Total latency of all API calls.
    // Average can be computed using total_latency_micros / recorded_call_count.
    optional int64 recorded_total_latency_micros = 6;
    // Maximum latency of one API call.
    optional int64 recorded_max_latency_micros = 7;
    // Total CPU usage of all API calls.
    // Average can be computed using total_cpu_micros / recorded_call_count.
    // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
    optional int64 recorded_total_cpu_micros = 8;
    // Maximum CPU usage of one API call.
    optional int64 recorded_max_cpu_micros = 9;
    // Maximum parcel reply size of one API call.
    optional int64 recorded_max_reply_size_bytes = 10;
    // Maximum parcel request size of one API call.
    optional int64 recorded_max_request_size_bytes = 11;
}

/**
 * Pulls the statistics of exceptions during calls to Binder.
 *
 * Binder stats are cumulative from boot unless somebody reset the data using
 * > adb shell dumpsys binder_calls_stats --reset
 */
message BinderCallsExceptions {
    // Exception class name, e.g. java.lang.IllegalArgumentException.
    //
    // This is an exception class name thrown by the system server.
    optional string exception_class_name = 1;
    // Total number of exceptions.
    optional int64 exception_count = 2;
}

/**
 * Pulls the statistics of message dispatching on HandlerThreads.
 *
 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
 * config on the device.
 *
 * Next tag: 11
 */
message LooperStats {
    // The uid that made a call to the System Server and caused the message to be enqueued.
    optional int32 uid = 1 [(is_uid) = true];

    // Fully qualified class name of the handler target class.
    //
    // This field does not contain PII. This is a system server class name.
    optional string handler_class_name = 2;

    // The name of the thread that runs the Looper.
    //
    // This field does not contain PII. This is a system server thread name.
    optional string looper_thread_name = 3;

    // The name of the dispatched message.
    //
    // This field does not contain PII. This is a system server constant or class
    // name.
    optional string message_name = 4;

    // Total number of successfully dispatched messages.
    optional int64 message_count = 5;

    // Total number of messages that failed dispatching.
    optional int64 exception_count = 6;

    // Total number of processed messages we have data recorded for. If we
    // collected data for all the messages, message_count will be equal to
    // recorded_message_count.
    //
    // If recorded_message_count is different than message_count, it means data
    // collection has been sampled. The fields below will be sampled in this case.
    optional int64 recorded_message_count = 7;

    // Total latency of all processed messages.
    // Average can be computed using recorded_total_latency_micros /
    // recorded_message_count.
    optional int64 recorded_total_latency_micros = 8;

    // Total CPU usage of all processed message.
    // Average can be computed using recorded_total_cpu_micros /
    // recorded_message_count. Total can be computed using
    // recorded_total_cpu_micros / recorded_message_count * message_count.
    optional int64 recorded_total_cpu_micros = 9;

    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
    optional bool screen_interactive = 10;

    // Max recorded CPU usage of all processed messages.
    optional int64 recorded_max_cpu_micros = 11;

    // Max recorded latency of all processed messages.
    optional int64 recorded_max_latency_micros = 12;

    // Total number of messages we tracked the dispatching delay for. If we
    // collected data for all the messages, message_count will be equal to
    // recorded_delay_message_count.
    //
    // If recorded_delay_message_count is different than message_count, it means data
    // collection has been sampled or/and not all messages specified the target dispatch time.
    // The fields below will be sampled in this case.
    optional int64 recorded_delay_message_count = 13;

    // Total dispatching delay of all processed messages.
    // Calculated as a difference between the target dispatching time (Message.when)
    // and the actual dispatching time.
    // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
    optional int64 recorded_total_delay_millis = 14;

    // Max dispatching delay of all processed messages.
    // Calculated as a difference between the target dispatching time (Message.when)
    // and the actual dispatching time.
    optional int64 recorded_max_delay_millis = 15;
}

/**
 * Pulls disk information, such as write speed and latency.
 */
message DiskStats {
    // Time taken to open, write 512B to, and close a file.
    // -1 if error performing the check.
    optional int64 data_write_latency_millis = 1;

    optional bool file_based_encryption = 2;

    // Recent disk write speed in kB/s.
    // -1 if error querying storageed.
    // 0 if data is unavailable.
    optional int32 recent_disk_write_speed = 3;
}


/**
 * Free and total bytes of the Data, Cache, System, and Metadata partitions.
 */
message DirectoryUsage {
    enum Directory {
        UNKNOWN = 0;
        DATA = 1;
        CACHE = 2;
        SYSTEM = 3;
        METADATA = 4;
    }
    optional Directory directory = 1;
    optional int64 free_bytes = 2;
    optional int64 total_bytes = 3;
}


/**
 * Size of an application: apk size, data size, and cache size.
 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
 * Information is only reported for apps with the primary user (user 0).
 * Sizes are aggregated by package name.
 */
message AppSize {
    // Including uids will involve modifying diskstats logic.
    optional string package_name = 1;
    // App size in bytes. -1 if unavailable.
    optional int64 app_size_bytes = 2;
    // App data size in bytes. -1 if unavailable.
    optional int64 app_data_size_bytes = 3;
    // App cache size in bytes. -1 if unavailable.
    optional int64 app_cache_size_bytes = 4;
    // Time that the cache file was produced.
    // Uses System.currentTimeMillis(), which is wall clock time.
    optional int64 cache_time_millis = 5;
}


/**
 * Size of a particular category. Eg: photos, videos.
 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
 */
message CategorySize {
    enum Category {
        UNKNOWN = 0;
        APP_SIZE = 1;
        APP_DATA_SIZE = 2;
        APP_CACHE_SIZE = 3;
        PHOTOS = 4;
        VIDEOS = 5;
        AUDIO = 6;
        DOWNLOADS = 7;
        SYSTEM = 8;
        OTHER = 9;
    }
    optional Category category = 1;
    // Category size in bytes.
    optional int64 size_bytes = 2;
    // Time that the cache file was produced.
    // Uses System.currentTimeMillis(), which is wall clock time.
    optional int64 cache_time_millis = 3;
}

/**
 * Pulls per uid I/O stats. The stats are cumulative since boot.
 *
 * Read/write bytes are I/O events from a storage device
 * Read/write chars are data requested by read/write syscalls, and can be
 *   satisfied by caching.
 *
 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
 */
message DiskIo {
    optional int32 uid = 1 [(is_uid) = true];
    optional int64 fg_chars_read = 2;
    optional int64 fg_chars_write = 3;
    optional int64 fg_bytes_read = 4;
    optional int64 fg_bytes_write = 5;
    optional int64 bg_chars_read = 6;
    optional int64 bg_chars_write = 7;
    optional int64 bg_bytes_read = 8;
    optional int64 bg_bytes_write = 9;
    optional int64 fg_fsync = 10;
    optional int64 bg_fsync= 11;
}


/**
 * Pulls the number of fingerprints for each user.
 *
 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
 */
message NumFingerprintsEnrolled {
    // The associated user. Eg: 0 for owners, 10+ for others.
    // Defined in android/os/UserHandle.java
    optional int32 user = 1;
    // Number of fingerprints registered to that user.
    optional int32 num_fingerprints_enrolled = 2;
}

/**
 * Pulls the number of faces for each user.
 *
 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
 */
message NumFacesEnrolled {
    // The associated user. Eg: 0 for owners, 10+ for others.
    // Defined in android/os/UserHandle.java
    optional int32 user = 1;
    // Number of faces registered to that user.
    optional int32 num_faces_enrolled = 2;
}
/**
 * A mapping of role holder -> role
 */
message RoleHolder {
    // uid of the role holder
    optional int32 uid = 1 [(is_uid) = true];

    // package name of the role holder
    optional string package_name = 2;

    // the role held
    optional string role = 3;
}

message AggStats {
    // These are all in byte resolution.
    optional int64 min = 1 [deprecated = true];
    optional int64 average = 2 [deprecated = true];
    optional int64 max = 3 [deprecated = true];

    // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
    // int64 fields.
    optional int32 mean_kb = 4;
    optional int32 max_kb = 5;
}

// A reduced subset of process states; reducing the number of possible states allows more
// aggressive device-side aggregation of statistics and hence reduces metric upload size.
enum ProcessStateAggregated {
    PROCESS_STATE_UNKNOWN = 0;
    // Persistent system process.
    PROCESS_STATE_PERSISTENT = 1;
    // Top activity; actually any visible activity.
    PROCESS_STATE_TOP = 2;
    // Process binding to top or a foreground service.
    PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
    // Processing running a foreground service.
    PROCESS_STATE_FGS = 4;
    // Important foreground process (ime, wallpaper, etc).
    PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
    // Important background process.
    PROCESS_STATE_BACKGROUND = 6;
    // Process running a receiver.
    PROCESS_STATE_RECEIVER = 7;
    // All kinds of cached processes.
    PROCESS_STATE_CACHED = 8;
}

// Next tag: 13
message ProcessStatsStateProto {
    optional android.service.procstats.ScreenState screen_state = 1;

    optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];

    // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
    // and not frameworks/base/core/java/android/app/ActivityManager.java
    optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];

    optional ProcessStateAggregated process_state_aggregated = 10;

    // Millisecond uptime duration spent in this state
    optional int64 duration_millis = 4 [deprecated = true];
    // Same as above, but with minute resolution so it fits into an int32.
    optional int32 duration_minutes = 11;

    // Millisecond elapsed realtime duration spent in this state
    optional int64 realtime_duration_millis = 9 [deprecated = true];
    // Same as above, but with minute resolution so it fits into an int32.
    optional int32 realtime_duration_minutes = 12;

    // # of samples taken
    optional int32 sample_size = 5;

    // PSS is memory reserved for this process
    optional AggStats pss = 6 [deprecated = true];

    // USS is memory shared between processes, divided evenly for accounting
    optional AggStats uss = 7 [deprecated = true];

    // RSS is memory resident for this process
    optional AggStats rss = 8;
}

// Next Tag: 8
message ProcessStatsProto {
    // Name of process.
    optional string process = 1;

    // Uid of the process.
    optional int32 uid = 2 [(is_uid) = true];

    // Information about how often kills occurred
    message Kill {
        // Count of excessive CPU kills
        optional int32 cpu = 1;

        // Count of kills when cached
        optional int32 cached = 2;

        // PSS stats during cached kill
        optional AggStats cached_pss = 3;
    }
    optional Kill kill = 3 [deprecated = true];

    // Time and memory spent in various states.
    repeated ProcessStatsStateProto states = 5;

    // Total time process has been running...  screen_state, memory_state, and process_state
    // will not be set.
    optional ProcessStatsStateProto total_running_state = 6;

    // Association data for this process in this state;
    // each entry here is one association.
    repeated ProcessStatsAssociationProto assocs = 7;
}

// Next Tag: 6
message ProcessStatsAssociationProto {
    // Procss Name of the associated process (client process of service binding)
    optional string assoc_process_name = 1;

    // Package Name of the associated package (client package of service binding)
    optional string assoc_package_name = 2 [deprecated = true];

    // UID of the associated process/package (client package of service binding)
    optional int32 assoc_uid = 5 [(is_uid) = true];

    // Total count of the times this association (service binding) appeared.
    optional int32 total_count = 3;

    // Uptime total duration in seconds this association (service binding) was around.
    optional int32 total_duration_secs = 4;
}

message PackageServiceOperationStatsProto {
    // Operate enum: Started, Foreground, Bound, Executing
    optional android.service.procstats.ServiceOperationState operation = 1;

    // Number of times the service was in this operation.
    optional int32 count = 2;

    // Information about a state the service can be in.
    message StateStats {
        // Screen state enum.
        optional android.service.procstats.ScreenState screen_state = 1;
        // Memory state enum.
        optional android.service.procstats.MemoryState memory_state = 2;

        // duration in milliseconds.
        optional int64 duration_millis = 3;
        // Millisecond elapsed realtime duration spent in this state
        optional int64 realtime_duration_millis = 4;
    }
    repeated StateStats state_stats = 3;
}

message PackageServiceStatsProto {
    // Name of service component.
    optional string service_name = 1;

    // The operation stats.
    // The package_name, package_uid, package_version, service_name will not be set to save space.
    repeated PackageServiceOperationStatsProto operation_stats = 2;
}

message PackageAssociationSourceProcessStatsProto {
    // Uid of the process.
    optional int32 process_uid = 1;
    // Process name.
    optional string process_name = 2;
    // Package name.
    optional string package_name = 7;
    // Total count of the times this association appeared.
    optional int32 total_count = 3;

    // Millisecond uptime total duration this association was around.
    optional int64 total_duration_millis = 4;

    // Total count of the times this association became actively impacting its target process.
    optional int32 active_count = 5;

    // Information on one source in this association.
    message StateStats {
        // Process state enum.
        optional android.service.procstats.ProcessState process_state = 1;
        // Millisecond uptime duration spent in this state
        optional int64 duration_millis = 2;
        // Millisecond elapsed realtime duration spent in this state
        optional int64 realtime_duration_mmillis = 3;
    }
    repeated StateStats active_state_stats = 6;
}

message PackageAssociationProcessStatsProto {
    // Name of the target component.
    optional string component_name = 1;
    // Information on one source in this association.
    repeated PackageAssociationSourceProcessStatsProto sources = 2;
}


message ProcessStatsPackageProto {
    // Name of package.
    optional string package = 1;

    // Uid of the package.
    optional int32 uid = 2;

    // Version of the package.
    optional int64 version = 3;

    // Stats for each process running with the package loaded in to it.
    repeated ProcessStatsProto process_stats = 4;

    // Stats for each of the package's services.
    repeated PackageServiceStatsProto service_stats = 5;

    // Stats for each association with the package.
    repeated PackageAssociationProcessStatsProto association_stats = 6;
}

message ProcessStatsSectionProto {
    // Elapsed realtime at start of report.
    optional int64 start_realtime_millis = 1;

    // Elapsed realtime at end of report.
    optional int64 end_realtime_millis = 2;

    // CPU uptime at start of report.
    optional int64 start_uptime_millis = 3;

    // CPU uptime at end of report.
    optional int64 end_uptime_millis = 4;

    // System runtime library. e.g. "libdvm.so", "libart.so".
    optional string runtime = 5;

    // whether kernel reports swapped pss.
    optional bool has_swapped_pss = 6;

    // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
    enum Status {
        STATUS_UNKNOWN = 0;
        STATUS_COMPLETE = 1;
        STATUS_PARTIAL = 2;
        STATUS_SHUTDOWN = 3;
        STATUS_SYSPROPS = 4;
    }
    repeated Status status = 7;

    // Number of pages available of various types and sizes, representation fragmentation.
    repeated ProcessStatsAvailablePagesProto available_pages = 10;

    // Stats for each process.
    repeated ProcessStatsProto process_stats = 8;

    // Stats for each package.
    repeated ProcessStatsPackageProto package_stats = 9;
}

message ProcessStatsAvailablePagesProto {
    // Node these pages are in (as per /proc/pagetypeinfo)
    optional int32 node = 1;

    // Zone these pages are in (as per /proc/pagetypeinfo)
    optional string zone = 2;

    // Label for the type of these pages (as per /proc/pagetypeinfo)
    optional string label = 3;

    // Distribution of number of pages available by order size.  First entry in array is
    // order 0, second is order 1, etc.  Each order increase is a doubling of page size.
    repeated int32 pages_per_order = 4;
}

/**
 * Pulled from ProcessStatsService.java
 */
message ProcStats {
    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
    // Data pulled from device into this is sometimes sharded across multiple atoms to work around
    // a size limit. When this happens, this shard ID will contain an increasing 1-indexed integer
    // with the number of this shard.
    optional int32 shard_id = 2;
}

/**
 * Pulled from ProcessStatsService.java
 */
message ProcStatsPkgProc {
    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
}

// Next Tag: 2
message PackageRemoteViewInfoProto {
    optional string package_name = 1;
    // add per-package additional info here (like channels)
}

// Next Tag: 2
message NotificationRemoteViewsProto {
    repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
}

/**
 * Pulled from NotificationManagerService.java
 */
message NotificationRemoteViews {
    optional NotificationRemoteViewsProto notification_remote_views = 1 [(log_mode) = MODE_BYTES];
}

/**
 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
 */
message PackageNotificationPreferences {
    // Uid under which the package is installed.
    optional int32 uid = 1 [(is_uid) = true];
    // Notification importance, which specifies when and how a notification is displayed.
    // Specified under core/java/android/app/NotificationManager.java.
    optional int32 importance = 2;
    // Lockscreen visibility as set by the user.
    optional int32 visibility = 3;
    // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
    // PreferencesHelper.java)
    optional int32 user_locked_fields = 4;
    // Indicates if the package importance was set by the user (rather than system default).
    optional bool user_set_importance = 5;
    // State of the full screen intent permission for this package.
    enum FsiState {
        // This package did not declare the full screen intent permission in its manifest.
        NOT_REQUESTED = 0;
        // This package has the full screen intent permission.
        GRANTED = 1;
        // This package does not have the full screen intent permission.
        DENIED = 2;
    }
    optional FsiState fsi_state = 6;
    // True if the current full screen intent permission state for this package was set by the user.
    // This is only set when the FSI permission is requested by the app.
    optional bool is_fsi_permission_user_set = 7;
}

/**
 * Atom that contains a list of a package's channel preferences, pulled from
 * NotificationManagerService.java.
 */
message PackageNotificationChannelPreferences {
    // Uid under which the package is installed.
    optional int32 uid = 1 [(is_uid) = true];
    // Channel's ID. Should always be available.
    optional string channel_id = 2;
    // Channel's name. Should always be available.
    optional string channel_name = 3;
    // Channel's description. Optionally set by the channel creator.
    optional string description = 4;
    // Notification importance, which specifies when and how a notification is displayed. Specified
    // under core/java/android/app/NotificationManager.java.
    optional int32 importance = 5;
    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
    // at core/java/android/app/NotificationChannel.java
    optional int32 user_locked_fields = 6;
    // Indicates if the channel was deleted by the app.
    optional bool is_deleted = 7;
    // Indicates if the channel was marked as a conversation by the app.
    optional bool is_conversation = 8;
    // Indicates if the channel is a conversation that was demoted by the user.
    optional bool is_demoted_conversation = 9;
    // Indicates if the channel is a conversation that was marked as important by the user.
    optional bool is_important_conversation = 10;
}

/**
 * Atom that contains a list of a package's channel group preferences, pulled from
 * NotificationManagerService.java.
 */
message PackageNotificationChannelGroupPreferences {
    // Uid under which the package is installed.
    optional int32 uid = 1 [(is_uid) = true];
    // Channel Group's ID. Should always be available.
    optional string group_id = 2;
    // Channel Group's name. Should always be available.
    optional string group_name = 3;
    // Channel Group's description. Optionally set by group creator.
    optional string description = 4;
    // Indicates if notifications from this channel group are blocked.
    optional bool is_blocked = 5;
    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
    // at core/java/android/app/NotificationChannelGroup.java
    optional int32 user_locked_fields = 6;
}

message PowerProfileProto {
    optional double cpu_suspend = 1;

    optional double cpu_idle = 2;

    optional double cpu_active = 3;

    message CpuCluster {
        optional int32 id = 1;
        optional double cluster_power = 2;
        optional int32 cores = 3;
        repeated int64 speed = 4;
        repeated double core_power = 5;
    }

    repeated CpuCluster cpu_cluster = 40;

    optional double wifi_scan = 4;

    optional double wifi_on = 5;

    optional double wifi_active = 6;

    optional double wifi_controller_idle = 7;

    optional double wifi_controller_rx = 8;

    optional double wifi_controller_tx = 9;

    repeated double wifi_controller_tx_levels = 10;

    optional double wifi_controller_operating_voltage = 11;

    optional double bluetooth_controller_idle = 12;

    optional double bluetooth_controller_rx = 13;

    optional double bluetooth_controller_tx = 14;

    optional double bluetooth_controller_operating_voltage = 15;

    optional double modem_controller_sleep = 16;

    optional double modem_controller_idle = 17;

    optional double modem_controller_rx = 18;

    repeated double modem_controller_tx = 19;

    optional double modem_controller_operating_voltage = 20;

    optional double gps_on = 21;

    repeated double gps_signal_quality_based = 22;

    optional double gps_operating_voltage = 23;

    optional double bluetooth_on = 24;

    optional double bluetooth_active = 25;

    optional double bluetooth_at_cmd = 26;

    optional double ambient_display = 27;

    optional double screen_on = 28;

    optional double radio_on = 29;

    optional double radio_scanning = 30;

    optional double radio_active = 31;

    optional double screen_full = 32;

    optional double audio = 33;

    optional double video = 34;

    optional double flashlight = 35;

    optional double memory = 36;

    optional double camera = 37;

    optional double wifi_batched_scan = 38;

    optional double battery_capacity = 39;
}

/**
 * power_profile.xml and other constants for power model calculations.
 * Pulled from PowerProfile.java
 */
message PowerProfile {
    optional PowerProfileProto power_profile = 1 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when a user restriction was added or removed.
 *
 * Logged from:
 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
 */
message UserRestrictionChanged {
    // The raw string of the user restriction as defined in UserManager.
    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
    optional string restriction = 1;
    // Whether the restriction is enabled or disabled.
    optional bool enabled = 2;
}

/**
 * Pulls process user time and system time. Puller takes a snapshot of all pids
 * in the system and returns cpu stats for those that are working at the time.
 * Dead pids will be dropped. Kernel processes are excluded.
 * Min cool-down is 5 sec.
 */
message ProcessCpuTime {
    optional int32 uid = 1 [(is_uid) = true];

    optional string process_name = 2;
    // Process cpu time in user space, cumulative from boot/process start
    optional int64 user_time_millis = 3;
    // Process cpu time in system space, cumulative from boot/process start
    optional int64 system_time_millis = 4;
}

/**
 * Pulls the CPU usage for each thread.
 *
 * Read from /proc/$PID/task/$TID/time_in_state files.
 *
 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
 * time_in_state files not being present on some phones, have not been addressed. These should be
 * considered before a public release.
 */
message CpuTimePerThreadFreq {
    // UID that owns the process.
    optional int32 uid = 1 [(is_uid) = true];
    // ID of the process.
    optional int32 process_id = 2;
    // ID of the thread.
    optional int32 thread_id = 3;
    // Name of the process taken from `/proc/$PID/cmdline`.
    optional string process_name = 4;
    // Name of the thread taken from `/proc/$PID/task/$TID/comm`
    optional string thread_name = 5;

    // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
    // are given in KHz, and time is given in milliseconds since the thread started. All eight
    // frequencies are given here as the alternative is sending eight separate atoms. This method
    // significantly reduces the amount of data created
    optional int32 frequency1_khz = 6;
    optional int32 time1_millis = 7;
    optional int32 frequency2_khz = 8;
    optional int32 time2_millis = 9;
    optional int32 frequency3_khz = 10;
    optional int32 time3_millis = 11;
    optional int32 frequency4_khz = 12;
    optional int32 time4_millis = 13;
    optional int32 frequency5_khz = 14;
    optional int32 time5_millis = 15;
    optional int32 frequency6_khz = 16;
    optional int32 time6_millis = 17;
    optional int32 frequency7_khz = 18;
    optional int32 time7_millis = 19;
    optional int32 frequency8_khz = 20;
    optional int32 time8_millis = 21;
}

/**
 * Pulls information about the device's build.
 */
message BuildInformation {
    // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
    // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
    optional string fingerprint = 1;

    // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
    optional string brand = 2;

    // Build.PRODUCT. The name of the overall product.
    optional string product = 3;

    // Build.DEVICE. The name of the industrial design.
    optional string device = 4;

    // Build.VERSION.RELEASE. The user-visible version string.  E.g., "1.0" or "3.4b5" or "bananas".
    optional string version_release = 5;

    // Build.ID. E.g. a label like "M4-rc20".
    optional string id = 6;

    // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
    // represent this build.
    optional string version_incremental = 7;

    // Build.TYPE. The type of build, like "user" or "eng".
    optional string type = 8;

    // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
    optional string tags = 9;
}

/**
 * Logs information about mismatched caller for content capture.
 *
 * Logged from:
 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
 */
message ContentCaptureCallerMismatchReported {
    optional string intended_package = 1;
    optional string calling_package = 2;
}

/**
 * Logs information about content capture service events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureServiceEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_CONNECTED = 1;
        ON_DISCONNECTED = 2;
        SET_WHITELIST = 3;
        SET_DISABLED = 4;
        ON_USER_DATA_REMOVED = 5;
        ON_DATA_SHARE_REQUEST = 6;
        ACCEPT_DATA_SHARE_REQUEST = 7;
        REJECT_DATA_SHARE_REQUEST = 8;
        DATA_SHARE_WRITE_FINISHED = 9;
        DATA_SHARE_ERROR_IOEXCEPTION = 10;
        DATA_SHARE_ERROR_EMPTY_DATA = 11;
        DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
        DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
        DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
        DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
        ON_REMOTE_SERVICE_DIED = 16;
    }
    optional Event event = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of target.
    // it's a concatenated list of component/package for SET_WHITELIST event
    // separated by " ".
    // Deprecated: should not log app package
    optional string target_info = 3 [deprecated = true];
    // The number of packages in the allow list
    optional int32 set_allowlist_package_count = 4;
    // The number of activities in the allow list
    optional int32 set_allowlist_activity_count = 5;
}

/**
 * Logs information about content capture session events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureSessionEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_SESSION_STARTED = 1;
        ON_SESSION_FINISHED = 2;
        SESSION_NOT_CREATED = 3;
    }
    optional int32 session_id = 1;
    optional Event event = 2;
    // (n/a on session finished)
    optional int32 state_flags = 3;
    // component/package of content capture service.
    optional string service_info = 4;
    // component/package of app.
    // (n/a on session finished)
    // Deprecated: should not log app package
    optional string app_info = 5 [deprecated = true];
    optional bool is_child_session = 6;
}

/**
 * Logs information about session being flushed.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureFlushed {
    optional int32 session_id = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of app.
    // Deprecated: should not log app package
    optional string app_info = 3 [deprecated = true];
    // session start/finish events
    optional int32 child_session_started = 4;
    optional int32 child_session_finished = 5;
    // count of view events.
    optional int32 view_appeared_count = 6;
    optional int32 view_disappeared_count = 7;
    optional int32 view_text_changed_count = 8;

    // Flush stats.
    optional int32 max_events = 9;
    optional int32 idle_flush_freq = 10;
    optional int32 text_flush_freq = 11;
    optional int32 flush_reason = 12;
}

/**
 * Pulls on-device BatteryStats power use calculations for the overall device.
 */
message DeviceCalculatedPowerUse {
    // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
    // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
    optional int64 computed_power_nano_amp_secs = 1;
}

// Keep in sync with frameworks/base/core/proto/android/os/batteryusagestats.proto
/**
 * Represents a device's BatteryUsageStats, with power usage information about the device
 * and each app.
 */
message BatteryUsageStatsAtomsProto {

    // The session start timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
    // All data is no older than this time.
    optional int64 session_start_millis = 1;

    // The session end timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
    // All data is no more recent than this time.
    optional int64 session_end_millis = 2;

    // Length that the reported data covered. This usually will be equal to the entire session,
    // session_end_millis - session_start_millis, but may not be if some data during this time frame
    // is missing.
    optional int64 session_duration_millis = 3;

    // Represents usage of a consumer, storing all of its power component usage.
    message BatteryConsumerData {
        // Total power consumed by this BatteryConsumer (including all of its PowerComponents).
        // May not equal the sum of the PowerComponentUsage due to under- or over-estimations.
        // Multiply by 1/36 to obtain mAh.
        optional int64 total_consumed_power_deci_coulombs = 1;

        // Represents power and time usage of a particular power component.
        message PowerComponentUsage {
            // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
            // Evidently, if one attempts to write an int to an enum field that is out of range, it
            // is treated as 0, so we must make this an int32.
            optional int32 component = 1;

            // Power consumed by this component. Multiply by 1/36 to obtain mAh.
            optional int64 power_deci_coulombs = 2;

            optional int64 duration_millis = 3;
        }
        repeated PowerComponentUsage power_components = 2;

        // Represents a slice of power attribution, e.g. "cpu while in the background"
        // or "wifi when running a background service".  Queries that care about
        // PowerComponentUsage slices need to be aware of all supported dimensions.
        // There are no roll-ups included in the slices - it is up to the clients
        // of this data to aggregate values as needed.
        message PowerComponentUsageSlice {
            optional PowerComponentUsage power_component = 1;

            enum ProcessState {
                UNSPECIFIED = 0;
                FOREGROUND = 1;
                BACKGROUND = 2;
                FOREGROUND_SERVICE = 3;
            }

            optional ProcessState process_state = 2;
        }

        repeated PowerComponentUsageSlice slices = 3;
    }

    // Total power usage for the device during this session.
    optional BatteryConsumerData device_battery_consumer = 4;

    // Power usage by a uid during this session.
    message UidBatteryConsumer {
        optional int32 uid = 1 [(is_uid) = true];
        optional BatteryConsumerData battery_consumer_data = 2;
        // DEPRECATED Use time_in_state instead.
        optional int64 time_in_foreground_millis = 3 [deprecated = true];
        // DEPRECATED Use time_in_state instead.
        optional int64 time_in_background_millis = 4 [deprecated = true];

        message TimeInState {
            enum ProcessState {
                UNSPECIFIED = 0;
                FOREGROUND = 1;
                BACKGROUND = 2;
                FOREGROUND_SERVICE = 3;
            }

            optional ProcessState process_state = 1;
            optional int64 time_in_state_millis = 2;
        }

        repeated TimeInState time_in_state = 5;
    }
    repeated UidBatteryConsumer uid_battery_consumers = 5;

    // Sum of all discharge percentage point drops during the reported session.
    optional int32 session_discharge_percentage = 6;

    // Total amount of time battery was discharging during the reported session
    optional int64 discharge_duration_millis = 7;

    // Notes the power model used for a power component.
    message PowerComponentModel {
        // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
        optional int32 component = 1;

        enum PowerModel {
            UNDEFINED = 0;
            POWER_PROFILE = 1;
            MEASURED_ENERGY = 2;
        }

        optional PowerModel power_model = 2;
    }

    // The power model used for each power component.
    repeated PowerComponentModel component_models = 8;
}

/**
 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
 * using the best data available.
 *
 * Includes the data since the last time statsd pulled this atom (i.e. since the
 * last-BatteryStats-reset-prior-to-last-statsd-pull) until the most recent BatteryStats reset.
 *
 * Does NOT include data after the most recent reset (use BatteryUsageStatsSinceReset too for that).
 *
 * Pulled from BatteryManager.getBatteryUsageStats().
 */
message BatteryUsageStatsBeforeReset {
    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
}

/**
 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
 * using the best data available.
 *
 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
 *
 * Pulled from BatteryManager.getBatteryUsageStats().
 */
message BatteryUsageStatsSinceReset {
    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
}

/**
 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
 * using only PowerProfile Model data (even if better data is available).
 *
 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
 *
 * @see android.os.BatteryUsageStatsQuery#FLAG_BATTERY_USAGE_STATS_POWER_PROFILE_MODEL
 * Pulled from BatteryManager.getBatteryUsageStats().
 */
message BatteryUsageStatsSinceResetUsingPowerProfileModel {
    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
}

/**
 * Logs device policy features.
 *
 * Logged from:
 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
 *   packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
 */
message DevicePolicyEvent {
    // The event id - unique for each event.
    optional android.stats.devicepolicy.EventId event_id = 1;
    // The admin package name.
    optional string admin_package_name = 2;
    // A generic integer parameter.
    optional int32 integer_value = 3;
    // A generic boolean parameter.
    optional bool boolean_value = 4;
    // A parameter specifying a time period in milliseconds.
    optional uint64 time_period_millis = 5;
    // A parameter specifying a list of package names, bundle extras or string parameters.
    optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUILaunchReported {
    optional android.stats.docsui.LaunchAction launch_action = 1;
    optional bool has_initial_uri = 2;
    optional android.stats.docsui.MimeType mime_type = 3;
    optional android.stats.docsui.Root initial_root = 4;
}

/**
 * Logs root/app visited event in file managers/picker. Call this when the user
 * taps on root/app in hamburger menu.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIRootVisitedReported {
    optional android.stats.docsui.ContextScope scope = 1;
    optional android.stats.docsui.Root root = 2;
}

/**
 * Logs file operation stats. Call this when a file operation has completed.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationReported {
    optional android.stats.docsui.Provider provider = 1;
    optional android.stats.docsui.FileOperation file_op = 2;
}

/**
 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
 * mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationCopyMoveModeReported {
    optional android.stats.docsui.FileOperation file_op = 1;
    optional android.stats.docsui.CopyMoveOpMode mode = 2;
}


/**
 * Logs file sub operation stats. Call this when a file operation has failed.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationFailureReported {
    optional android.stats.docsui.Authority authority = 1;
    optional android.stats.docsui.SubFileOperation sub_op = 2;
}

/**
* Logs the cancellation of a file operation. Call this when a job is canceled
*
* Logged from:
*     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
*/
message DocsUIFileOperationCanceledReported {
    optional android.stats.docsui.FileOperation file_op = 1;
}

/**
 * Logs startup time in milliseconds.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIStartupMsReported {
    optional int32 startup_millis = 1;
}

/**
 * Logs the action that was started by user.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIUserActionReported {
    optional android.stats.docsui.UserAction action = 1;
}

/**
 * Logs the invalid type when invalid scoped access is requested.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
 */
message DocsUIInvalidScopedAccessRequestReported {
    optional android.stats.docsui.InvalidScopedAccess type = 1;
}

/**
 * Logs the package name that launches docsui picker mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIPickerLaunchedFromReported {
    optional string package_name = 1;
}

/**
 * Logs the search type.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUISearchTypeReported {
    optional android.stats.docsui.SearchType search_type = 1;
}

/**
 * Logs the search mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUISearchModeReported {
    optional android.stats.docsui.SearchMode search_mode = 1;
}

/**
 * Logs the pick result information.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIPickResultReported {
    optional int32 total_action_count = 1;
    optional int64 duration_millis = 2;
    optional int32 file_count= 3;
    optional bool is_searching = 4;
    optional android.stats.docsui.Root picked_from = 5;
    optional android.stats.docsui.MimeType mime_type = 6;
    optional int32 repeatedly_pick_times = 7;
}

/** Logs the drag and drop of files.

 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIDragAndDropReported {
    optional bool drag_initiated_from_docsui = 1;
}

/**
 * Logs when an app's memory is compacted.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppCompacted {
  // The pid of the process being compacted.
  optional int32 pid = 1;

  // The name of the process being compacted.
  optional string process_name = 2;

  // The type of compaction.
  enum Action {
    UNKNOWN = 0;
    SOME = 1;
    FULL = 2;
    PERSISTENT = 3;
    BFGS = 4;
  }
  optional Action action = 3;

  // Total RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_total_kilobytes = 4;

  // File RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_file_kilobytes = 5;

  // Anonymous RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_anon_kilobytes = 6;

  // Swap in kilobytes consumed by the process prior to compaction.
  optional int64 before_swap_kilobytes = 7;

  // Total RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_total_kilobytes = 8;

  // File RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_file_kilobytes = 9;

  // Anonymous RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_anon_kilobytes = 10;

  // Swap in kilobytes consumed by the process after compaction.
  optional int64 after_swap_kilobytes = 11;

  // The time taken to perform compaction in milliseconds.
  optional int64 time_to_compact_millis = 12;

  // The last compaction action performed for this app.
  optional Action last_action = 13;

  // The last time that compaction was attempted on this process in milliseconds
  // since boot, not including sleep (see SystemClock.uptimeMillis()).
  optional int64 last_compact_timestamp_ms_since_boot = 14;

  // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
  optional int32 oom_score_adj = 15;

  // The process state at the time of compaction.
  optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];

  // Free ZRAM in kilobytes before compaction.
  optional int64 before_zram_free_kilobytes = 17;

  // Free ZRAM in kilobytes after compaction.
  optional int64 after_zram_free_kilobytes = 18;
}

message AppCompactedV2 {
  // UID of the process being compacted
  optional int32 uid = 1 [(is_uid) = true];

  // Process state for compacted process
  optional int32 proc_state = 2;

  // Current OOM Adjust at the time of compaction, this would correspond to any newly set oom adj.
  optional int32 current_oom_adj = 3;

  // Delta Anon RSS reduced with compaction computed as RSS Before - RSS After.
  optional int64 delta_anon_rss = 4;

  // Physical ZRAM Consumed during compaction
  optional int64 zram_consumed = 5;

  // CPU time spent compacting
  optional float compact_cpu_time = 6;

  // Anon RSS of the process prior to being compacted
  optional int64 original_anon_rss = 7;

  // Reason for the OOM adj change
  optional android.app.OomChangeReasonEnum oom_change_reason = 8;
}

/**
 * Represents an event that logs information about a successful switch to an upstream network.
 */
message UpstreamEvent {
  // Indicates the transport type of network.
  optional android.stats.connectivity.UpstreamType upstream_type = 1;

  // The duration of network usage.
  optional int64 duration_millis = 2;

  // The amount of data received from tethered clients.
  optional int64 tx_bytes = 3;

  // The amount of data received from remote.
  optional int64 rx_bytes = 4;
}

message UpstreamEvents {
  repeated UpstreamEvent upstream_event = 1;
}

/**
 * Logs when a Tethering event occurs.
 *
 */
message NetworkTetheringReported {
  // Tethering error code
  optional android.stats.connectivity.ErrorCode error_code = 1;

  // Tethering downstream type
  optional android.stats.connectivity.DownstreamType downstream_type = 2;

  // Transport type of upstream network
  optional android.stats.connectivity.UpstreamType upstream_type = 3 [deprecated = true];

  // The user type of switching tethering
  optional android.stats.connectivity.UserType user_type= 4;

  // Log each transport type of upstream network event
  optional UpstreamEvents upstream_events = 5  [(log_mode) = MODE_BYTES];

  // A time period that a downstreams exists
  optional int64 duration_millis = 6;
}

/**
 * Logs NSD(Network service discovery) client session
 *
 * Log from:
 *     packages/modules/Connectivity/service-t/src/com/android/server/NsdService
 */
message NetworkNsdReported {
  // Indicate if the device is using the legacy or the new implementation
  optional bool is_legacy = 1;

  // It is a random number to represent different clients. Each client is an app on the device.
  optional int32 client_id = 2;

  // It is a increment_number to represent different transactions.
  // Each transaction is a request from an app client.
  optional int32 transaction_id = 3;

  // Indicate the service in resolution is a known service in the discovered services cache
  optional bool is_known_service = 4;

  // Record each NSD session type
  optional android.stats.connectivity.NsdEventType type = 5;

  // The process duration of the event in milli-second
  optional int64 event_duration_millisec = 6;

  // Record each mdns query result
  optional android.stats.connectivity.MdnsQueryResult query_result = 7;

  // Count of services in cache at the end of discovery
  optional int32 found_service_count = 8;

  // Count of found callback when discovery is stopped
  optional int32 found_callback_count = 9;

  // Count of lost callback when discovery is stopped
  optional int32 lost_callback_count = 10;

  // Record query service count before unregistered service
  optional int32 replied_requests_count = 11;

  // Record sent query count before stopped discovery
  optional int32 sent_query_count = 12;

  // Record sent packet count before unregistered service
  optional int32 sent_packet_count = 13;

  // Record number of conflict during probing
  optional int32 conflict_during_probing_count = 14;

  // Record number of conflict after probing
  optional int32 conflict_after_probing_count = 15;

  // The random number between 0 ~ 999 for sampling
  optional int32 random_number = 16;
}

/**
 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
 *
 * The NetworkDnsEventReported message represents the entire lookup operation, which may
 * result one or more queries to the recursive DNS resolvers. Those are individually logged
 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
 * broken up by query type, transport, network interface, etc.
 */
message NetworkDnsEventReported {
    optional android.stats.dnsresolver.EventType event_type = 1;

    optional android.stats.dnsresolver.ReturnCode return_code = 2;

    // The latency in microseconds of the entire DNS lookup operation.
    optional int32 latency_micros = 3;

    // Only valid for event_type = EVENT_GETADDRINFO.
    optional int32 hints_ai_flags = 4;

    // Flags passed to android_res_nsend() defined in multinetwork.h
    // Only valid for event_type = EVENT_RESNSEND.
    optional int32 res_nsend_flags = 5;

    optional android.stats.dnsresolver.NetworkType network_type = 6;

    // The DNS over TLS mode on a specific netId.
    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;

    // Additional pass-through fields opaque to statsd.
    // The DNS resolver Mainline module can add new fields here without requiring an OS update.
    optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];

    // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
    optional int32 sampling_rate_denom = 9;

    // UID sends the DNS query.
    optional int32 uid = 10 [(is_uid) = true];
}

/**
 * logs the number of DNS servers supported by the protocol
 */
message NetworkDnsServerSupportReported {
    // The network type of the network
    optional android.stats.dnsresolver.NetworkType network_type = 1;

    // The private DNS mode of the network
    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 2;

    // Stores the state of all DNS servers for this network
    optional android.stats.dnsresolver.Servers servers = 3 [(log_mode) = MODE_BYTES];
}

/**
 * The NetworkDnsHandshakeReported message describes a DoT or DoH handshake operation along with
 * its result, cause, network latency, TLS version, etc.
 *
 */
message NetworkDnsHandshakeReported {
  optional android.stats.dnsresolver.Protocol protocol = 1;

  optional android.stats.dnsresolver.HandshakeResult result = 2;

  optional android.stats.dnsresolver.HandshakeCause cause = 3;

  optional android.stats.dnsresolver.NetworkType network_type = 4;

  optional android.stats.dnsresolver.PrivateDnsModes private_dns_mode = 5;

  // The latency in microseconds of the entire handshake operation.
  optional int32 latency_micros = 6;

  // Number of bytes sent in a handshake.
  optional int32 bytes_sent = 7;

  // Number of bytes received in a handshake.
  optional int32 bytes_received = 8;

  // Number of round-trips.
  optional int32 round_trips = 9;

  // True if TLS session cache hit.
  optional bool tls_session_cache_hit = 10;

  // 2 = TLS 1.2, 3 = TLS 1.3
  optional int32 tls_version = 11;

  // True if the handshake requires verifying the private DNS provider hostname.
  optional bool hostname_verification = 12;

  // Only present when protocol = PROTO_DOH.
  optional int32 quic_version = 13;

  optional int32 server_index = 14;

  // The sampling-rate of this event is 1/sampling_rate_denom.
  optional int32 sampling_rate_denom = 15;
}

/**
 * logs the CapportApiData info
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
 */
message CapportApiData {
    // The TTL of the network connection provided by captive portal
    optional int32 remaining_ttl_secs = 1;

    // The limit traffic data of the network connection provided by captive portal
    optional int32 remaining_bytes = 2;

    // Is portal url option included in the DHCP packet (Yes, No)
    optional bool has_portal_url = 3;

    // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
    optional bool has_venue_info = 4;
}

/**
 * logs a network Probe Event
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
 */
message ProbeEvent {
    // The probe type (http or https, or captive portal API...)
    optional android.stats.connectivity.ProbeType probe_type = 1;

    // The latency in microseconds of the probe event
    optional int32 latency_micros = 2;

    // The result of the probe event
    optional android.stats.connectivity.ProbeResult probe_result = 3;

    // The CaptivePortal API info
    optional CapportApiData capport_api_data = 4;
}

/**
 * log each ProbeEvent in ProbeEvents
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
 */
message ProbeEvents {
    // Record probe event during the validation
    repeated ProbeEvent probe_event = 1;
}

/**
 * The DHCP (Dynamic Host Configuration Protocol) session info
 * Logged from:
 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
 */
message DhcpSession {
    // The DHCP Feature(s) enabled in this session
    repeated android.stats.connectivity.DhcpFeature used_features = 1;

    // The discover packet (re)transmit count
    optional int32 discover_count = 2;

    // The request packet (re)transmit count
    optional int32 request_count = 3;

    // The IPv4 address conflict count
    // (only be meaningful when duplicate address detection is enabled)
    optional int32 conflict_count = 4;

    // The DHCP packet parsing error code in this session
    // (defined in android.net.metrics.DhcpErrorEvent)
    repeated android.stats.connectivity.DhcpErrorCode error_code = 5;

    // The result of DHCP hostname transliteration
    optional android.stats.connectivity.HostnameTransResult ht_result = 6;
}

/**
 * Logs Network IP provisioning event
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
 */
message NetworkIpProvisioningReported {
    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
    optional android.stats.connectivity.TransportType transport_type = 1;

    // The latency in microseconds of IP Provisioning over IPV4
    optional int32 ipv4_latency_micros = 2;

    // The latency in microseconds of IP Provisioning over IPV6
    optional int32 ipv6_latency_micros = 3;

    // The time duration between provisioning start and end (success or failure)
    optional int64 provisioning_duration_micros = 4;

    // The specific disconnect reason for this IP provisioning
    optional android.stats.connectivity.DisconnectCode disconnect_code = 5;

    // Log DHCP session info (Only valid for IPv4)
    optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];

    // The random number between 0 ~ 999 for sampling
    optional int32 random_number = 7;
}

/**
 * Logs Network DHCP Renew event
 * Logged from:
 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
 */
message NetworkDhcpRenewReported {
    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
    optional android.stats.connectivity.TransportType transport_type = 1;

    // The request packet (re)transmit count
    optional int32 request_count = 2;

    // The latency in microseconds of DHCP Renew
    optional int32 latency_micros = 3;

    // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
    optional android.stats.connectivity.DhcpErrorCode error_code = 4;

    // The result of DHCP renew
    optional android.stats.connectivity.DhcpRenewResult renew_result = 5;

    // The random number between 0 ~ 999 for sampling
    optional int32 random_number = 6;
}

/**
 * Logs Network Validation event
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
 */
message NetworkValidationReported {
    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
    optional android.stats.connectivity.TransportType transport_type = 1;

    // Record each probe event
    optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];

    // The result of the network validation
    optional android.stats.connectivity.ValidationResult validation_result = 3;

    // The latency in microseconds of network validation
    optional int32 latency_micros = 4;

    // The validation index (the first validation attempt or second, third...)
    optional int32 validation_index = 5;

    // The random number between 0 ~ 999 for sampling
    optional int32 random_number = 6;
}

/**
 * Logs NetworkStack Quirk event
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/networkstack/
 */
message NetworkStackQuirkReported {
    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
    optional android.stats.connectivity.TransportType transport_type = 1;

    // Record each Quirk event
    optional android.stats.connectivity.NetworkQuirkEvent event = 2;
}

/**
 * Logs Neighbor Unreachability Detection event
 * Logged from:
 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpReachabilityMonitorMetrics.java
 */
message NetworkIpReachabilityMonitorReported {
    // Neighbor Unreachability Detection event.
    optional android.stats.connectivity.NudEventType event_type = 1;

    // NUD probe based on IPv4 ARP or IPv6 ND packet.
    optional android.stats.connectivity.IpType ip_type = 2;

    // NUD neighbor type, default gateway, DNS server or both.
    optional android.stats.connectivity.NudNeighborType neighbor_type = 3;
}

/**
 * Logs when system default network changes.
 */
message SystemDefaultNetworkChanged {
    // Active transport types encoded as a 32 bit integer.
    // The integer will have n-th bit set if there was an active transport type of value n.
    // See packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 transport_types = 1 [
        (state_field_option).exclusive_state = true,
        (state_field_option).nested = false
    ];
}

/**
 * Logs when a data stall event occurs.
 *
 * Log from:
 *     packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
 */
message DataStallEvent {
    // Data stall evaluation type.
    // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
    // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
    optional int32 evaluation_type = 1;
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.ProbeResult validation_result = 2;
    // See definition in data_stall_event.proto.
    optional android.net.Transport network_type = 3;
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
    // The tcp packets fail rate from the latest tcp polling.
    optional int32 tcp_fail_rate = 7;
    // Number of packets sent since the last received packet.
    optional int32 tcp_sent_since_last_recv = 8;
}

/*
 * Logs when RescueParty resets some set of experiment flags.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/RescueParty.java
 */
message RescuePartyResetReported {
    // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
    optional int32 rescue_level = 1;
}

/**
 * Logs when signed config is received from an APK, and if that config was applied successfully.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
 */
message SignedConfigReported {
    enum Type {
        UNKNOWN_TYPE = 0;
        GLOBAL_SETTINGS = 1;
    }
    optional Type type = 1;

    // The final status of the signed config received.
    enum Status {
        UNKNOWN_STATUS = 0;
        APPLIED = 1;
        BASE64_FAILURE_CONFIG = 2;
        BASE64_FAILURE_SIGNATURE = 3;
        SECURITY_EXCEPTION = 4;
        INVALID_CONFIG = 5;
        OLD_CONFIG = 6;
        SIGNATURE_CHECK_FAILED = 7;
        NOT_APPLICABLE = 8;
        SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
    }
    optional Status status = 2;

    // The version of the signed config processed.
    optional int32 version = 3;

    // The package name that the config was extracted from.
    optional string from_package = 4;

    enum Key {
        NO_KEY = 0;
        DEBUG = 1;
        PRODUCTION = 2;
    }
    // Which key was used to verify the config.
    optional Key verified_with = 5;
}

/*
 * Logs GNSS Network-Initiated (NI) location events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
 */
message GnssNiEventReported {
    // The type of GnssNiEvent.
    enum EventType {
        UNKNOWN = 0;
        NI_REQUEST = 1;
        NI_RESPONSE = 2;
    }
    optional EventType event_type = 1;

    // An ID generated by HAL to associate NI notifications and UI responses.
    optional int32 notification_id = 2;

    // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
    optional android.server.location.GnssNiType ni_type = 3;

    // NI requires notification.
    optional bool need_notify = 4;

    // NI requires verification.
    optional bool need_verify = 5;

    // NI requires privacy override, no notification/minimal trace.
    optional bool privacy_override = 6;

    // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
    // seconds.
    optional int32 timeout = 7;

    // Default response when timeout.
    optional android.server.location.GnssUserResponseType default_response = 8;

    // String representing the requester of the network inititated location request.
    optional string requestor_id = 9;

    // Notification message text string representing the service(for eg. SUPL-service) who sent the
    // network initiated location request.
    optional string text = 10;

    // requestorId decoding scheme.
    optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;

    // Notification message text decoding scheme.
    optional android.server.location.GnssNiEncodingType text_encoding = 12;

    // True if SUPL ES is enabled.
    optional bool is_supl_es_enabled = 13;

    // True if GNSS location is enabled.
    optional bool is_location_enabled = 14;

    // GNSS NI responses which define the response in NI structures.
    optional android.server.location.GnssUserResponseType user_response = 15;
}

/**
 * Logs GNSS non-framework (NFW) location notification.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
 */
message GnssNfwNotificationReported {
    // Package name of the Android proxy application representing the non-framework entity that
    // requested location. Set to empty string if unknown.
    optional string proxy_app_package_name = 1;

    // Protocol stack that initiated the non-framework location request.
    optional android.server.location.NfwProtocolStack protocol_stack = 2;

    // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
    // set to empty string. This field is opaque to the framework and used for logging purposes.
    optional string other_protocol_stack_name = 3;

    // Source initiating/receiving the location information.
    optional android.server.location.NfwRequestor requestor = 4;

    // Identity of the endpoint receiving the location information. For example, carrier name, OEM
    // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
    // and used for logging purposes.
    optional string requestor_id = 5;

    // Indicates whether location information was provided for this request.
    optional android.server.location.NfwResponseType response_type = 6;

    // True if the device is in user initiated emergency session.
    optional bool in_emergency_mode = 7;

    // True if cached location is provided.
    optional bool is_cached_location = 8;

    // True if proxy app permission mismatch between framework and GNSS HAL.
    optional bool is_permission_mismatched = 9;
}

/**
 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
 */
message GnssConfigurationReported {
    // SUPL host name.
    optional string supl_host = 1;

    // SUPL port number.
    optional int32 supl_port = 2;

    // C2K host name.
    optional string c2k_host = 3;

    // C2K port number.
    optional int32 c2k_port = 4;

    // The SUPL version requested by Carrier.
    optional int32 supl_ver = 5;

    // The SUPL mode.
    optional android.server.location.SuplMode supl_mode = 6;

    // True if NI emergency SUPL restrictions is enabled.
    optional bool supl_es = 7;

    // LTE Positioning Profile settings
    optional android.server.location.LppProfile lpp_profile = 8;

    // Positioning protocol on A-Glonass system.
    optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;

    // True if emergency PDN is used. Otherwise, regular PDN is used.
    optional bool use_emergency_pdn_for_emergency_supl= 10;

    // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
    optional android.server.location.GpsLock gps_lock = 11;

    // Number of seconds to extend the emergency session duration post emergency call.
    optional int32 es_extension_sec = 12;

    // The full list of package names of proxy Android applications representing the non-framework
    // location access entities (on/off the device) for which the framework user has granted
    // non-framework location access permission. The package names are concatenated in one string
    // with spaces as separators.
    optional string enabled_proxy_app_package_name_list = 13;
}

/**
 * Logs GNSS PSDS downloads as defined in IGnssPsds.aidl.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java
 */
message GnssPsdsDownloadReported {
    // PSDS type as defined in PsdsType.aidl
    optional int32 psds_type = 1;
}

/**
 * Logs when a NFC device's error occurred.
 * Logged from:
 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
 */
message NfcErrorOccurred {
    enum Type {
        UNKNOWN = 0;
        CMD_TIMEOUT = 1;
        ERROR_NOTIFICATION = 2;
        AID_OVERFLOW = 3;
        // HCE stands for Host Card Emulation
        HCE_LATE_BINDING = 4;
        NFC_ACCESS_CHECK_ERROR = 5;
        SE_INCORRECT_FORMAT = 6;
    }
    optional Type type = 1;
    // If it's nci cmd timeout, log the timeout command.
    optional uint32 nci_cmd = 2;

    optional uint32 error_ntf_status_code = 3;
}

/**
 * Logs when a NFC device's state changed event
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/NfcService.java
 */
message NfcStateChanged {
    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
        ON_LOCKED = 3; // Secure Nfc enabled.
        CRASH_RESTART = 4; // NfcService watchdog timeout restart.
    }
    optional State state = 1 [
        (state_field_option).exclusive_state = true,
        (state_field_option).nested = false
    ];
}

/**
 * Logs when a NFC Beam Transaction occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
 */
message NfcBeamOccurred {
    enum Operation {
        UNKNOWN = 0;
        SEND = 1;
        RECEIVE = 2;
    }
    optional Operation operation = 1;
}

/**
 * Logs when a NFC Card Emulation Transaction occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
 */
message NfcCardemulationOccurred {
    enum Category {
        UNKNOWN = 0;
        // HCE stands for Host Card Emulation
        HCE_PAYMENT = 1;
        HCE_OTHER = 2;
        OFFHOST = 3;
        OFFHOST_PAYMENT = 4;
        OFFHOST_OTHER = 5;
        FAILED_NO_ROUTING = 6;
        FAILED_HCE_PAYMENT_WRONG_SETTING = 7;
        FAILED_HCE_OTHER_WRONG_SETTING = 8;
        FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_BOUND = 9;
        FAILED_HCE_OTHER_DISCONNECTED_BEFORE_BOUND = 10;
        FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_RESPONSE = 11;
        FAILED_HCE_OTHER_DISCONNECTED_BEFORE_RESPONSE = 12;
    }
    // Transaction belongs to HCE payment or HCE other category, or offhost.
    optional Category category = 1;
    // SeName from transaction: SIMx, eSEx, HCE, HCEF.
    optional string se_name = 2;

    optional int32 uid = 3 [(is_uid) = true];
}

/**
 * Logs when a NFC Tag event occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
 */
message NfcTagOccurred {
    enum Type {
        UNKNOWN = 0;
        URL = 1;
        BT_PAIRING = 2;
        PROVISION = 3;
        WIFI_CONNECT = 4;
        APP_LAUNCH = 5;
        OTHERS = 6;
        FOREGROUND_DISPATCH = 7;
    }
    optional Type type = 1;

    optional int32 uid = 2 [(is_uid) = true];
    // Supported RF Technologies of the Tag
    repeated android.nfc.RFTechnologyType rf_types = 3;
    // Use for BT_PAIRING Type
    optional android.bluetooth.MajorClassEnum bt_device_type = 4;
    // Use for BT_PAIRING Type
    // Should be empty for HEALTH and UNKNOWN MajorClassEnum
    optional string bt_device_info = 5;
}

/**
 * Logs NFC tag type when tag occurred
 * Logged from:
 *     packages/apps/Nfc/nci/jni/NfcTag.cpp
 */
message NfcTagTypeOccurred {
    optional android.nfc.NfcTagType type = 1;
}

/**
 * Logs when Hce transaction triggered
 * Logged from:
 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
 */
message NfcHceTransactionOccurred {
    // The latency period(in microseconds) it took for the first HCE data
    // exchange.
    optional uint32 latency_micros = 1;
}

/**
 * Logs when AID conflict occurred
 * Logged from:
 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
*/
message NfcAIDConflictOccurred {
    optional string conflicting_aid = 1;
}

/**
 * Logs when reader app conflict occurred
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
*/
message NfcReaderConflictOccurred {
}

/**
 * Logs when user changed screen resolution
 * Logged from:
 *     packages/apps/Settings/src/com/android/settings/display/ScreenResolutionFragment.java
*/
message UserSelectedResolution {
    optional int32 display_id = 1;
    // display resolution
    optional int32 width = 2;
    optional int32 height = 3;
}

/**
 * Logs when SecureElement state event changed
 * Logged from:
 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
 */
message SeStateChanged {
    enum State {
        UNKNOWN = 0;
        INITIALIZED = 1;
        DISCONNECTED = 2;
        CONNECTED = 3;
        HALCRASH = 4;
    }
    optional State state = 1;

    optional string state_change_reason = 2;
    // SIMx or eSEx.
    optional string terminal = 3;
}

/**
 * Information about a permission grant request
 */
message PermissionGrantRequestResultReported {
    // unique value identifying an API call. A API call might result in multiple of these atoms
    optional int64 request_id = 1;

    // UID of package requesting the permission grant
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package requesting the permission grant
    optional string package_name = 3;

    // The permission to be granted
    optional string permission_name = 4;

    // If the permission was explicitly requested via the API or added by the system
    optional bool is_implicit = 5;

    enum Result {
        UNDEFINED = 0;
        // permission request was ignored
        IGNORED = 1;
        // permission request was ignored because it was user fixed
        IGNORED_USER_FIXED = 2;
        // permission request was ignored because it was policy fixed
        IGNORED_POLICY_FIXED = 3;
        // permission was granted by user action
        USER_GRANTED = 4;
        // permission was automatically granted
        AUTO_GRANTED = 5;
        // permission was denied by user action
        USER_DENIED = 6;
        // permission was denied with prejudice by the user
        USER_DENIED_WITH_PREJUDICE = 7;
        // permission was automatically denied
        AUTO_DENIED = 8;
        // permission request was ignored because permission is restricted
        IGNORED_RESTRICTED_PERMISSION = 9;
        // one time permission was granted by user action
        USER_GRANTED_ONE_TIME = 10;
        // user ignored request by leaving the request screen without choosing any option
        USER_IGNORED = 11;
        // user granted the permission after being linked to settings
        USER_GRANTED_IN_SETTINGS = 12;
        // user denied the permission after being linked to settings
        USER_DENIED_IN_SETTINGS = 13;
        // user denied the permission with prejudice after being linked to settings
        USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
        // permission was automatically revoked after one-time permission expired
        AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
        // permission was automatically revoked for unused app
        AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
        // the user selected media with the photo picker
        PHOTOS_SELECTED = 17;
    }
    // The result of the permission grant
    optional Result result = 6;

    // Whether Permission Rationale was shown on grant dialog
    optional bool permission_rationale_shown = 7;
}

/**
 * Logs when Omapi API used
 * Logged from:
 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
 */
message SeOmapiReported {
    enum Operation {
        UNKNOWN = 0;
        OPEN_CHANNEL = 1;
    }
    optional Operation operation = 1;
    // SIMx or eSEx.
    optional string terminal = 2;

    optional string package_name = 3;
}

/**
  * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
  * The dispatch latency is the dispatchClockTime - enqueueClockTime.
  * Logged from:
  *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
  */
message BroadcastDispatchLatencyReported {
    optional int64 dispatch_latency_millis = 1;
}

/**
   * Logs AttentionManagerService attention check result.
   *
   * Logged from:
   *   frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
   */
message AttentionManagerServiceResultReported {
    // See core/java/android/service/attention/AttentionService.java
    enum AttentionCheckResult {
        UNKNOWN = 20;
        ATTENTION_SUCCESS_ABSENT = 0;
        ATTENTION_SUCCESS_PRESENT = 1;
        ATTENTION_FAILURE_UNKNOWN = 2;
        ATTENTION_FAILURE_CANCELLED = 3;
        ATTENTION_FAILURE_PREEMPTED = 4;
        ATTENTION_FAILURE_TIMED_OUT = 5;
        ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
    }
    optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
}

/**
 * Logs when an adb connection changes state.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
 */
message AdbConnectionChanged {
    // The last time this system connected via adb, or 0 if the 'always allow' option was not
    // previously selected for this system.
    optional int64 last_connection_time_millis = 1;

    // The time in ms within which a subsequent connection from an 'always allow' system is allowed
    // to reconnect via adb without user interaction.
    optional int64 auth_window_millis = 2;

    // The state of the adb connection from frameworks/proto_logging/stats/enums/debug/enums.proto.
    optional android.debug.AdbConnectionStateEnum state = 3;

    // True if the 'always allow' option was selected for this system.
    optional bool always_allow = 4;
}

/*
 * Logs the reported speech DSP status.
 *
 * Logged from:
 *  Vendor audio implementation.
 */
message SpeechDspStatReported {
    // The total Speech DSP uptime in milliseconds.
    optional int32 total_uptime_millis = 1;
    // The total Speech DSP downtime in milliseconds.
    optional int32 total_downtime_millis = 2;
    optional int32 total_crash_count = 3;
    optional int32 total_recover_count = 4;
}

/**
 * Logs USB connector contaminant status.
 *
 * Logged from: USB Service.
 */
message UsbContaminantReported {
    optional string id = 1;
    optional android.service.ContaminantPresenceStatus status = 2;
}

/**
 * This atom is for debugging purpose.
 */
message DebugElapsedClock {
    // Monotically increasing value for each pull.
    optional int64 pull_count = 1;
    // Time from System.elapsedRealtime.
    optional int64 elapsed_clock_millis = 2;
    // Time from System.elapsedRealtime.
    optional int64 same_elapsed_clock_millis = 3;
    // Diff between current elapsed time and elapsed time from previous pull.
    optional int64 elapsed_clock_diff_millis = 4;

    enum Type {
      TYPE_UNKNOWN = 0;
      ALWAYS_PRESENT = 1;
      PRESENT_ON_ODD_PULLS = 2;
    }
    // Type of behavior for the pulled data.
    optional Type type = 5;
}

/**
 * This atom is for debugging purpose.
 */
message DebugFailingElapsedClock {
    // Monotically increasing value for each pull.
    optional int64 pull_count = 1;
    // Time from System.elapsedRealtime.
    optional int64 elapsed_clock_millis = 2;
    // Time from System.elapsedRealtime.
    optional int64 same_elapsed_clock_millis = 3;
    // Diff between current elapsed time and elapsed time from previous pull.
    optional int64 elapsed_clock_diff_millis = 4;
}

/** Logs System UI bubbles event changed.
 *
 * Logged from:
 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen
 */
message SplitscreenUIChanged {
    // User interactions with splitscreen
    enum Action {
        UNKNOWN_ACTION = 0;
        ENTER = 1;
        EXIT = 2;
        APP_CHANGE = 3;
        RESIZE = 4;
        SWAP = 5;
    }

    // The physical side on the device of the split
    enum Position {
        UNKNOWN_POSITION = 0;
        LEFT = 1;
        RIGHT = 2;
        TOP = 3;
        BOTTOM = 4;
    }

    // The reason for entering splitscreen
    enum EnterReason {
        UNKNOWN_ENTER = 0;
        OVERVIEW = 1; // Deprecated, use LAUNCHER
        DRAG_LEFT = 2;
        DRAG_TOP = 3;
        DRAG_RIGHT = 4;
        DRAG_BOTTOM = 5;
        LAUNCHER = 6;
        MULTI_INSTANCE = 7;
        NOTIFICATIONS = 8;
    }

    // The reason for exiting splitscreen
    enum ExitReason {
        UNKNOWN_EXIT = 0;
        DRAG_DIVIDER = 1;
        RETURN_HOME = 2;
        SCREEN_LOCKED = 3;
        SCREEN_LOCKED_SHOW_ON_TOP = 4;
        DEVICE_FOLDED = 5;
        ROOT_TASK_VANISHED = 6;
        APP_FINISHED = 7;
        APP_DOES_NOT_SUPPORT_MULTIWINDOW = 8;
        CHILD_TASK_ENTER_PIP = 9;
        RECREATE_SPLIT = 10;
        FULLSCREEN_SHORTCUT = 11;
        ENTER_DESKTOP = 12;
    }

    // The event action
    optional Action action = 1;
    // What triggered splitscreen (if the action is ENTER)
    optional EnterReason enter_reason = 2;
    // What triggered leaving splitscreen (if the action is EXIT)
    optional ExitReason exit_reason = 3;
    // The ratio of split between the main/side stages
    optional float split_ratio = 4;
    // Data about the main stage in split
    optional Position main_stage_position = 5;
    optional int32 main_stage_uid = 6 [(is_uid) = true];
    // Data about the side stage in split
    optional Position side_stage_position = 7;
    optional int32 side_stage_uid = 8 [(is_uid) = true];
    // The drag session id (if the enter_trigger was DRAG)
    optional int32 drag_instance_id = 9;
    // An identifier used to identify a splitscreen session
    optional int32 instance_id = 10;
}

/** Logs System UI bubbles event changed.
 *
 * Logged from:
 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles
 */
message BubbleUIChanged {

    // The app package that is posting the bubble.
    optional string package_name = 1;

    // The notification channel that is posting the bubble.
    optional string notification_channel = 2;

    // The notification id associated with the posted bubble.
    optional int32 notification_id = 3;

    // The position of the bubble within the bubble stack.
    optional int32 position = 4;

    // The total number of bubbles within the bubble stack.
    optional int32 total_number = 5;

    // User interactions with the bubble.
    enum Action {
        UNKNOWN = 0;
        POSTED = 1;
        UPDATED = 2;
        EXPANDED = 3;
        COLLAPSED = 4;
        DISMISSED = 5;
        STACK_DISMISSED = 6;
        STACK_MOVED = 7;
        HEADER_GO_TO_APP = 8;
        HEADER_GO_TO_SETTINGS = 9;
        PERMISSION_OPT_IN = 10;
        PERMISSION_OPT_OUT = 11;
        PERMISSION_DIALOG_SHOWN = 12;
        SWIPE_LEFT = 13;
        SWIPE_RIGHT = 14;
        STACK_EXPANDED = 15;
        FLYOUT = 16;
    }
    optional Action action = 6;

    // Normalized screen position of the bubble stack. The range is between 0 and 1.
    optional float normalized_x_position = 7;
    optional float normalized_y_position = 8;

    // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
    optional bool is_unread = 9;

    // Whether the bubble is an on-going one.
    optional bool is_ongoing = 10;

    // Whether the bubble is produced by an app running in foreground.
    // This is deprecated and the value should be ignored.
    optional bool is_foreground = 11 [deprecated = true];
}

/**
  * Logs System UI bubbles developer errors.
  *
  * Logged from:
  *   frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
  */
message BubbleDeveloperErrorReported {

    // The app package that is posting the bubble.
    optional string package_name = 1;

    // Bubble developer error type enums.
    enum Error {
        UNKNOWN = 0;
        ACTIVITY_INFO_MISSING = 1;
        ACTIVITY_INFO_NOT_RESIZABLE = 2;
        DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
    }
    optional Error error = 2 [default = UNKNOWN];
}

/**
 * Logs that a job-specific constraint for a scheduled job has changed.
 * DeviceWideJobConstraintChanged will cover constraints that are normally the same for all jobs.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
 */
message ScheduledJobConstraintChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the job.
    optional string job_name = 2;

    optional com.android.server.job.ConstraintEnum constraint = 3;

    enum State {
        UNKNOWN = 0;
        UNSATISFIED = 1;
        SATISFIED = 2;
    }
    optional State state = 4;
}

/**
 * Logs that a device-state-level JobScheduler constraint has changed. This doesn't take individual
 * job or app characteristics into account. Individual jobs may have a different satisfaction value
 * based on special policies. Individual job constraints (eg. connectivity or prefetch) are not
 * logged in this atom.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/job/controllers/<*>.java
 */
message DeviceWideJobConstraintChanged {
    optional com.android.server.job.ConstraintEnum constraint = 1 [
        (state_field_option).primary_field = true,
        (is_uid) = false
    ];

    enum State {
        UNKNOWN = 0;
        UNSATISFIED = 1;
        SATISFIED = 2;
    }
    optional State state = 2 [
        (state_field_option).exclusive_state = true,
        (state_field_option).nested = false
    ];
}

/**
 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
 * returns true.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
 */
message ScreenTimeoutExtensionReported {
    // Describes how many times in a row did the power manager reset the screen off timeout.
    optional uint32 consecutive_timeout_extended_count = 1;
}

/*
* Logs number of milliseconds it takes to start a process.
* The definition of app process start time is from the app launch time to
* the time that Zygote finished forking the app process and loaded the
* application package's java classes.

* This metric is different from AppStartOccurred which is for foreground
* activity only.

* ProcessStartTime can report all processes (both foreground and background)
* start time.
*
* Logged from:
*   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
*/
message ProcessStartTime {
    // The uid of the ProcessRecord.
    optional int32 uid = 1 [(is_uid) = true];

    // The process pid.
    optional int32 pid = 2;

    // The process name.
    // Usually package name, "system" for system server.
    // Provided by ActivityManagerService.
    // Do not fetch this field from device to save storage space, use uid field induced
    // package name as process name.
    optional string process_name = 3;

    enum StartType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
    }

    // The start type.
    optional StartType type = 4;

    // The elapsed realtime at the start of the process.
    optional int64 process_start_time_millis = 5;

    // Number of milliseconds it takes to reach bind application.
    optional int32 bind_application_delay_millis = 6;

    // Number of milliseconds it takes to finish start of the process.
    optional int32 process_start_delay_millis = 7;

    // hostingType field in ProcessRecord, the component type such as "activity",
    // "service", "content provider", "broadcast" or other strings.
    // deprecatd by enum type field hosting_type_id to reduce storage space usage by
    // string type.
    // Do not fetch this field from device to save storage space.
    optional string hosting_type = 8 [deprecated = true];

    // hostingNameStr field in ProcessRecord. The component class name that runs
    // in this process.
    // Do not fetch this field from device to save storage space.
    optional string hosting_name = 9;

    // Broadcast action name.
    optional string broadcast_action_name = 10;

    enum HostingTypeId {
        HOSTING_TYPE_UNKNOWN = 0;
        HOSTING_TYPE_ACTIVITY = 1;
        HOSTING_TYPE_ADDED_APPLICATION = 2;
        HOSTING_TYPE_BACKUP = 3;
        HOSTING_TYPE_BROADCAST = 4;
        HOSTING_TYPE_CONTENT_PROVIDER = 5;
        HOSTING_TYPE_LINK_FAIL = 6;
        HOSTING_TYPE_ON_HOLD = 7;
        HOSTING_TYPE_NEXT_ACTIVITY = 8;
        HOSTING_TYPE_NEXT_TOP_ACTIVITY = 9;
        HOSTING_TYPE_RESTART = 10;
        HOSTING_TYPE_SERVICE = 11;
        HOSTING_TYPE_SYSTEM = 12;
        HOSTING_TYPE_TOP_ACTIVITY = 13;
        HOSTING_TYPE_EMPTY = 14;
    }

    optional HostingTypeId hosting_type_id = 11;

    enum TriggerType {
        TRIGGER_TYPE_UNKNOWN = 0;
        TRIGGER_TYPE_ALARM = 1;
        TRIGGER_TYPE_PUSH_MESSAGE = 2;
        TRIGGER_TYPE_PUSH_MESSAGE_OVER_QUOTA = 3;
        TRIGGER_TYPE_JOB = 4;
    }

    optional TriggerType trigger_type = 12;
}

/**
 * Track Media Codec usage (nested proto version)
 *   This atom is being deprecated in favor of MediaCodecReported which has a
 *   flattened CodecData to enable field filtering. The data is identical
 *   except MediaCodecReported also has the playback_duration field.
 * Logged from:
 *   frameworks/av/media/libstagefright/MediaCodec.cpp
 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
 */
message MediametricsCodecReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track Media Codec usage
 *   This atom is the new version of MediametricsCodecReported and has a
 *   flattened CodecData to enable field filtering. The data is identical
 *   except for the addition of the playback_duration field.
 * Logged from:
 *   frameworks/av/media/libstagefright/MediaCodec.cpp
 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
 *
 * Next Tag: 79
 */
message MediaCodecReported {
    optional int64 timestamp_nanos = 1;
    // The inclusion of package name in a metric should be carefully analyzed to
    // determine if it is absolutely necessary for system health. It is strongly
    // discouraged to collect the package name along with other metrics (e.g.
    // playback duration).
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;
    // The name of the codec.
    // eg. `OMX.google.aac.decoder`
    optional string codec = 5;
    // The mime type. e.g. "audio/vorbis"
    optional string mime = 6;
    // The codec mode. i.e. video or audio.
    optional string mode = 7;
    // 1 if this is an encoder, 0 if this is a decoder.
    optional int32 encoder = 8;
    // 0, 1
    optional int32 secure = 9;
    // The video width in pixels.
    optional int32 width = 10;
    // The video height in pixels.
    optional int32 height = 11;
    // The rotation of the video in degrees
    // 0, 90, 180, 270
    optional int32 rotation = 12;
    // 1 if the codec uses crypto/drm, 0 otherwise.
    optional int32 crypto = 13;
    // The codec profile. The values are dependent on the codec type.
    // 0..n
    optional int32 profile = 14;
    // The coding level. The values are dependent on the codec type.
    // 0..n
    optional int32 level = 15;
    // The maximum allowed width during a particular codec session.
    // 0..n
    optional int32 max_width = 16;
    // The maximum allowed height during a particular codec session.
    // 0..n
    optional int32 max_height = 17;
    // Indicating which error condition caused the codec to reset to an
    // uninitialized state.
    optional int32 error_code = 18;
    // The error state.
    // The emitted values are descriptive:  UNINITIALIZED, INITIALIZING,
    // INITIALIZED, CONFIGURING, CONFIGURED, STARTING, STARTED, FLUSHING, FLUSHED,
    // STOPPING, and RELEASING.
    // In the event of an internal codec error setting the state outside of these
    // values, the invalid value will be encoded as a string (e.g., “17”).
    optional string error_state = 19;
    // The max latency in us.
    // The latency is from the time when the MediaCodec sends the ‘raw’ frame to
    // the media codec service to when the decoded frame arrives back in
    // MediaCodec’s possession.
    optional int64 latency_max = 20;
    // The min latency in us.
    optional int64 latency_min = 21;
    // The average latency in us.
    optional int64 latency_avg = 22;
    // The number of buffers included in the avg/min/max calculation above.
    optional int64 latency_count = 23;
    // The number of packets received back from the code where a latency could not
    // be determined, and therefore they aren't included in the avg/min/max
    // calculations above.
    optional int64 latency_unknown = 24;
    // Error returned by queueInputBuffer.
    optional int32 queue_input_buffer_error = 25;
    // Error returned by queueSecureInputBuffer.
    optional int32 queue_secure_input_buffer_error = 26;
    // These modes are primarily for videos.
    // CQ = constant quality
    // CBR = constant bit rate
    // VBR = variable bitrate
    optional string bitrate_mode = 27;
    optional int32 bitrate = 28;
    // 0..n
    optional int64 lifetime_millis = 29;
    optional int64 playback_duration_seconds = 30;
    optional string log_session_id = 31;
    optional int32 channel_count = 32;
    optional int32 sample_rate = 33;
    optional int64 video_encode_bytes = 34;
    optional int64 video_encode_frames = 35;
    optional int64 video_input_bytes = 36;
    optional int64 video_input_frames = 37;
    optional int64 video_encode_duration_us = 38;
    optional int32 color_format = 39;
    optional float frame_rate = 40;
    optional float capture_rate = 41;
    optional float operating_rate = 42;
    optional int32 priority = 43;
    optional int32 video_qp_i_min = 44;
    optional int32 video_qp_i_max = 45;
    optional int32 video_qp_p_min = 46;
    optional int32 video_qp_p_max = 47;
    optional int32 video_qp_b_min = 48;
    optional int32 video_qp_b_max = 49;
    optional int32 original_bitrate = 50;
    optional int32 shaping_enhanced = 51;
    optional int32 original_video_qp_i_min = 52;
    optional int32 original_video_qp_i_max = 53;
    optional int32 original_video_qp_p_min = 54;
    optional int32 original_video_qp_p_max = 55;
    optional int32 original_video_qp_b_min = 56;
    optional int32 original_video_qp_b_max = 57;
    optional int32 config_color_standard = 58;
    optional int32 config_color_range = 59;
    optional int32 config_color_transfer = 60;
    optional int32 parsed_color_standard = 61;
    optional int32 parsed_color_range = 62;
    optional int32 parsed_color_transfer = 63;
    optional int32 hdr_static_info = 64;
    optional int32 hdr10_plus_info = 65;
    optional int32 hdr_format = 66;
    // Randomly generated Codec ID for:
    // - correlating MediaCodecStarted and MediaCodecStopped for
    // more codec configuration parameters.
    // @since U
    optional int64 codec_id = 67;
    optional int32 array_mode = 68;
    optional int32 operation_mode = 69;
    optional int32 output_surface = 70;
    optional int32 app_max_input_size = 71;
    optional int32 used_max_input_size = 72;
    optional int32 codec_max_input_size = 73;
    optional int32 flush_count = 74;
    optional int32 set_surface_count = 75;
    optional int32 resolution_change_count = 76;
    optional int32 component_color_format = 77;
    // caller_uid replaces packagename
    // @Since U-QPR2
    optional int32 caller_uid = 78 [(is_uid) = true];
    optional int64 pixel_format = 79;
    // !!! WARNING
    // Keep synchronized with MediametricsCodecReported.CodecData in
    // mediametrics_message.proto.
    // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp
    // !!! WARNING
}

/**
 * Track Media Extractor (pulling video/audio streams out of containers) usage
 * Logged from:
 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
 */
message MediametricsExtractorReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track MediaParser (parsing video/audio streams from containers) usage
 * Logged from:
 *
 *   frameworks/av/services/mediametrics/statsd_mediaparser.cpp
 *   frameworks/base/apex/media/framework/jni/android_media_MediaParserJNI.cpp
 */
message MediametricsMediaParserReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;

    // MediaParser specific data.
    /**
     * The name of the parser selected for parsing the media, or an empty string
     * if no parser was selected.
     */
    optional string parser_name = 4;
    /**
     * Whether the parser was created by name. 1 represents true, and 0
     * represents false.
     */
    optional int32 created_by_name = 5;
    /**
     * The parser names in the sniffing pool separated by "|".
     */
    optional string parser_pool = 6;
    /**
     * The fully qualified name of the last encountered exception, or an empty
     * string if no exception was encountered.
     */
    optional string last_exception = 7;
    /**
     * The size of the parsed media in bytes, or -1 if unknown. Note this value
     * contains intentional random error to prevent media content
     * identification.
     */
    optional int64 resource_byte_count = 8;
    /**
     * The duration of the media in milliseconds, or -1 if unknown. Note this
     * value contains intentional random error to prevent media content
     * identification.
     */
    optional int64 duration_millis = 9;
    /**
     * The MIME types of the tracks separated by "|".
     */
    optional string track_mime_types = 10;
    /**
     * The tracks' RFC 6381 codec strings separated by "|".
     */
    optional string track_codecs = 11;
    /**
     * Concatenation of the parameters altered by the client, separated by "|".
     */
    optional string altered_parameters = 12;
    /**
     * The video width in pixels, or -1 if unknown or not applicable.
     */
    optional int32 video_width = 13;
    /**
     * The video height in pixels, or -1 if unknown or not applicable.
     */
    optional int32 video_height = 14;
    /**
     * Session id for correlating playback metrics.
     */
    optional string log_session_id = 15;
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
 */
message MediametricsAudiopolicyReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone requests.
 * Logged from
 *   frameworks/av/media/libaudioclient/AudioRecord.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
 */
message MediametricsAudiorecordReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];

    // Android S
    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
    // An empty string means no session id is set.
    optional string log_session_id = 6;
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/media/libnblog/ReportPerformance.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
 */
message MediametricsAudiothreadReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/media/libaudioclient/AudioTrack.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
 */
message MediametricsAudiotrackReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];

    // Android S
    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
    // An empty string means no session id is set.
    optional string log_session_id = 6;
}

/**
 * Track information about a MIDI Device.
 * This is logged when device connections close or devices are disconnected.
 * This is used to evaluate MIDI activity.
 *
 * Logged from
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsMidiDeviceCloseReported {
    // The UID of the app or service that disconnects the device
    optional int32 uid = 1;
    // Device Id from MidiDeviceInfo. After a restart, this starts at 1 for the first device.
    // This increments each time a new MIDI device is added.
    // See Id in frameworks/base/media/java/android/media/midi/MidiDeviceInfo.java
    optional int32 midi_device_id = 2;
    // Input port count as defined in MidiDeviceInfo.java
    optional int32 input_port_count = 3;
    // Output port count as defined in MidiDeviceInfo.java
    optional int32 output_port_count = 4;
    // Type of device (USB, Virtual, Bluetooth)
    optional android.media.midi.MidiDeviceInfoType device_type = 5;
    // Whether the device is shared to other apps. Uses MidiDeviceInfo.isPrivate().
    optional bool is_shared = 6;
    // Whether Universal MIDI Packets are used for this device by default.
    // Uses MidiDeviceInfo.getDefaultProtocol()
    optional bool supports_ump = 7;
    // Whether ALSA is used by this device.
    // Checks whether MidiDeviceInfo.getProperties() contains PROPERTY_ALSA_CARD.
    optional bool using_alsa = 8;
    // Duration in nanoseconds in which there was an open device connection.
    optional int64 duration_ns = 9;
    // Number of times this device had an add device connection attempt.
    optional int32 opened_count = 10;
    // Number of times this device had a remove device connection attempt.
    optional int32 closed_count = 11;
    // Whether the device has disconnected.
    optional bool device_disconnected = 12;
    // Number of bytes passed from the input ports of the device.
    optional int32 total_input_bytes = 13;
    // Number of bytes passed from the output ports of the device.
    optional int32 total_output_bytes = 14;
}

/**
 * Track information about DRM framework performance
 * Logged from
 *   frameworks/av/drm/libmediadrm/DrmHal.cpp
 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
 */
message MediametricsMediadrmReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    // vendor+description tell about which DRM plugin is in use on this device
    optional string vendor = 5;
    optional string description = 6;
    // from frameworks/av/drm/libmediadrm/protos/metrics.proto
    optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track information about the widevine DRM plugin performance
 * Logged from
 *   vendor/widevine/libwvdrmengine/cdm/metrics
 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
 *
 * TODO b/182382094 -remove after migrated mediadrm metrics
 * reporting to statsd.
 */
message MediametricsDrmWidevineReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track information about recordings (e.g. camcorder)
 * Logged from
 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
 *   frameworks/av/services/mediaanalytics/statsd_recorder.cpp
 */
message MediametricsRecorderReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track Media Player usage
 * Logged from:
 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
 */
message MediametricsNuPlayerReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics_message.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track Legacy DRM usage
 * Logged from
 *   frameworks/av/drm/drmserver/DrmManager.cpp
 */
message MediametricsDrmManagerReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    enum Method {
        METHOD_NOT_FOUND       = -1;
        GET_CONSTRAINTS        =  0;
        GET_METADATA           =  1;
        CAN_HANDLE             =  2;
        PROCESS_DRM_INFO       =  3;
        ACQUIRE_DRM_INFO       =  4;
        SAVE_RIGHTS            =  5;
        GET_ORIGINAL_MIME_TYPE =  6;
        GET_DRM_OBJECT_TYPE    =  7;
        CHECK_RIGHTS_STATUS    =  8;
        REMOVE_RIGHTS          =  9;
        REMOVE_ALL_RIGHTS      = 10;
        OPEN_CONVERT_SESSION   = 11;
        OPEN_DECRYPT_SESSION   = 12;
    }

    // plugin_id+description inform which Legacy DRM plugins are still in use on device
    optional string plugin_id = 5;
    optional string description = 6;
    optional Method method = 7;
    optional string mime_types = 8;

    optional int64 get_constraints_count =  9;
    optional int64 get_metadata_count = 10;
    optional int64 can_handle_count = 11;
    optional int64 process_drm_info_count = 12;
    optional int64 acquire_drm_info_count = 13;
    optional int64 save_rights_count = 14;
    optional int64 get_original_mime_type_count = 15;
    optional int64 get_drm_object_type_count = 16;
    optional int64 check_rights_status_count = 17;
    optional int64 remove_rights_count = 18;
    optional int64 remove_all_rights_count = 19;
    optional int64 open_convert_session_count = 20;
    optional int64 open_decrypt_session_count = 21;
}

/**
 * State of a all permission requested by a all package
 * Pulled from: StatsCompanionService
*/
message DangerousPermissionState {
    // Name of the permission
    optional string permission_name = 1;

    // Uid of the package
    optional int32 uid = 2 [(is_uid) = true];

    // Package requesting the permission
    optional string package_name = 3;

    // If the permission is granted to the uid
    optional bool is_granted = 4;

    // Permission flags as per android.content.pm.PermissionFlags
    optional int32 permission_flags = 5;

    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
    optional int32 protection_flags = 6;
}

/**
 * Logs when a package is denied access to a device identifier based on the new access requirements.
 *
 * Logged from:
 *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
 */
message DeviceIdentifierAccessDenied {
    // The name of the package denied access to the requested device identifier.
    optional string package_name = 1;

    // The name of the device identifier method the package attempted to invoke.
    optional string method_name = 2;

    // True if the package is preinstalled.
    // Starting from Android 11, this boolean is not set and will always be false.
    optional bool is_preinstalled = 3 [deprecated = true];

    // True if the package is privileged.
    // Starting from Android 11, this boolean is not set and will always be false.
    optional bool is_priv_app = 4 [deprecated = true];
}

/**
 * Pulls the ongoing mainline install train version code.
 * Pulled from StatsCompanionService
 */
message TrainInfo {
    optional int64 train_version_code = 1;

    optional TrainExperimentIds train_experiment_id = 2 [(log_mode) = MODE_BYTES];

    optional string train_name = 3;

    enum Status {
        UNKNOWN = 0;
        INSTALL_REQUESTED = 1;
        INSTALL_STARTED = 2;
        INSTALL_STAGED_NOT_READY = 3;
        INSTALL_STAGED_READY = 4;
        INSTALL_SUCCESS = 5;
        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
        // and INSTALL_FAILURE_COMMIT.
        INSTALL_FAILURE = 6  [deprecated = true];
        // This enum is for installs that are manually cancelled via the Manual Update UI.
        INSTALL_CANCELLED = 7;
        INSTALLER_ROLLBACK_REQUESTED = 8;
        INSTALLER_ROLLBACK_INITIATED = 9;
        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
        INSTALLER_ROLLBACK_STAGED = 11;
        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
        INSTALLER_ROLLBACK_SUCCESS = 15;
        INSTALLER_ROLLBACK_FAILURE = 16;
        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
        INSTALL_STAGED_CANCEL_REQUESTED = 20;
        INSTALL_STAGED_CANCEL_SUCCESS = 21;
        INSTALL_STAGED_CANCEL_FAILURE = 22;
        INSTALL_FAILURE_DOWNLOAD = 23;
        INSTALL_FAILURE_STATE_MISMATCH = 24;
        INSTALL_FAILURE_COMMIT = 25;
        REBOOT_TRIGGERED = 26;
    }
    optional Status status = 4;
}

/*
 * Information about the time zone data on a device.
 */
message TimeZoneDataInfo {
    // A version identifier for the data set on device. e.g. "2018i"
    optional string tzdb_version = 1;
}

/**
 * Logs the GPU stats global health information.
 *
 * Logged from:
 *   frameworks/native/services/gpuservice/gpustats/
 */
message GpuStatsGlobalInfo {
    // Package name of the gpu driver.
    optional string driver_package_name = 1;

    // Version name of the gpu driver.
    optional string driver_version_name = 2;

    // Version code of the gpu driver.
    optional int64 driver_version_code = 3;

    // Build time of the gpu driver in UTC as seconds since January 1, 1970.
    optional int64 driver_build_time = 4;

    // Total count of the gl driver gets loaded.
    optional int64 gl_loading_count = 5;

    // Total count of the gl driver fails to be loaded.
    optional int64 gl_loading_failure_count = 6;

    // Total count of the Vulkan driver gets loaded.
    optional int64 vk_loading_count = 7;

    // Total count of the Vulkan driver fails to be loaded.
    optional int64 vk_loading_failure_count = 8;

    // Api version of the system Vulkan driver.
    optional int32 vulkan_version = 9;

    // Api version of the system CPU Vulkan driver.
    optional int32 cpu_vulkan_version = 10;

    // Api version of the system GLES driver.
    optional int32 gles_version = 11;

    // Total count of the angle driver gets loaded.
    optional int64 angle_loading_count = 12;

    // Total count of the angle driver fails to be loaded.
    optional int64 angle_loading_failure_count = 13;
}

/**
 * GPU driver loading time info.
 */
message GpuDriverLoadingTime {
    // List of all the driver loading times for this app. The list size is
    // capped at 16 (GpuStats::MAX_NUM_LOADING_TIMES).
    repeated int64 driver_loading_time = 1;
}

/**
 * Logs the GPU stats per app health information.
 *
 * Logged from:
 *   frameworks/native/services/gpuservice/gpustats/
 */
message GpuStatsAppInfo {
    // Package name of the application that loads the gpu driver. Total number
    // of different packages is capped at 100.
    optional string app_package_name = 1;

    // Version code of the gpu driver this app loads.
    optional int64 driver_version_code = 2;

    // gl driver loading time info.
    optional GpuDriverLoadingTime gl_driver_loading_time = 3
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // Vulkan driver loading time info.
    optional GpuDriverLoadingTime vk_driver_loading_time = 4
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // Angle driver loading time info.
    optional GpuDriverLoadingTime angle_driver_loading_time = 5
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // CPU Vulkan implementation is in use.
    optional bool cpu_vulkan_in_use = 6;

    // App is not doing pre-rotation correctly.
    optional bool false_prerotation = 7;

    // App creates GLESv1 context.
    optional bool gles_1_in_use = 8;

    // ANGLE in use for the app.
    optional bool angle_in_use = 9;

    // App created a GLES context.
    // Introduced in Android 14.
    optional bool created_gles_context = 10;

    // App created a Vulkan device.
    // Introduced in Android 14.
    optional bool created_vulkan_device = 11;

    // App created a Vulkan swapchain.
    // Introduced in Android 14.
    optional bool created_vulkan_swapchain = 12;

    // Vulkan API version information from applicationInfo.
    // Introduced in Android 14.
    optional int32 vulkan_api_version = 13;

    // Bitmask of enabled features when creating Vulkan devices.
    // Introduced in Android 14.
    optional int64 vulkan_device_features_enabled = 14;

    // Hash values of enabled Vulkan instance extensions.
    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
    // Introduced in Android 14.
    repeated int32 vulkan_instance_extensions_enabled = 15;

    // Hash values of enabled Vulkan device extensions.
    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
    // Introduced in Android 14.
    repeated int32 vulkan_device_extensions_enabled = 16;
}

/*
 * Logs the size of the system ion heap.
 *
 * Pulled from StatsCompanionService.
 */
message SystemIonHeapSize {
    // Deprecated due to limited support of ion stats in debugfs.
    // Use `IonHeapSize` instead.
    option deprecated = true;

    // Size of the system ion heap in bytes.
    // Read from debugfs.
    optional int64 size_in_bytes = 1;
}

/*
 * Logs the total size of the ion heap.
 *
 * Pulled from StatsCompanionService.
 */
message IonHeapSize {
    // Total size of all ion heaps in kilobytes.
    // Read from: /sys/kernel/ion/total_heaps_kb.
    optional int32 total_size_kb = 1;
}

/*
 * Logs the per-process size of the system ion heap.
 *
 * Pulled from StatsCompanionService.
 */
message ProcessSystemIonHeapSize {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name (from /proc/PID/cmdline).
    optional string process_name = 2;

    // Sum of sizes of all allocations.
    optional int32 total_size_in_kilobytes = 3;

    // Number of allocations.
    optional int32 allocation_count = 4;

    // Size of the largest allocation.
    optional int32 max_size_in_kilobytes = 5;
}

/*
 * Logs system-wide (primarily kernel) memory stats. Sourced from
 * /proc/meminfo unless explicitly stated otherwise.
 *
 * Pulled from StatsCompanionService.
 */
message SystemMemory {
    // /proc/meminfo SUnreclaim
    optional int32 unreclaimable_slab_kb = 1;

    // /proc/meminfo VmallocUsed
    optional int32 vmalloc_used_kb = 2;

    // /proc/meminfo PageTables
    optional int32 page_tables_kb = 3;

    // /proc/meminfo KernelStack
    optional int32 kernel_stack_kb = 4;

    // Total unreclaimable ion.
    // Reported from os.Debug.getIonHeapsSizeKb (R+)
    optional int32 total_ion_kb = 5;

    // Measures for the amount of memory we could not account for.
    // Essentially points to kernel allocations (as all userspace allocs are
    // already tracked).
    // Device-specific.
    optional int32 unaccounted_kb = 6;

    // GPU kernel driver allocations.
    // Can overlap with ion memory.
    // Reported from os.Debug.getGpuTotalUsageKb (S+)
    optional int32 gpu_total_usage_kb = 7;

    // GPU kernel driver private allocations.
    // Does not overlap with ion memory
    // Computed as total usage - Debug.getGpuDmaBufUsageKb()
    // Only available on supported kernel versions (5.4+)
    optional int32 gpu_private_usage_kb = 8;

    // Total DMABUF memory allocations
    // Reported from os.Debug.getDmabufTotalExportedKb (S+)
    optional int32 dmabuf_total_exported_kb = 9;

    // Total shmem allocations
    optional int32 shmem_kb = 10;

    // Total usable memory
    optional int32 total_kb = 11;

    // Memory not in use
    optional int32 free_kb = 12;

    // Memory available for starting new applications without swapping
    optional int32 available_kb = 13;

    // Memory in active use
    optional int32 active_kb = 14;

    // Memory not in active use (swappable/reclaimable)
    optional int32 inactive_kb = 15;

    // Anonymous memory in active use
    optional int32 active_anon_kb = 16;

    // Anonymous memory not in active use
    optional int32 inactive_anon_kb = 17;

    // Page cache memory in active use
    optional int32 active_file_kb = 18;

    // Page cache memory not in active use
    optional int32 inactive_file_kb = 19;

    // Total swap
    optional int32 swap_total_kb = 20;

    // Free swap
    optional int32 swap_free_kb = 21;

    // Total amount of CMA reserved for the kernel
    optional int32 cma_total_kb = 22;

    // CMA free for the kernel to use
    optional int32 cma_free_kb = 23;
}

/*
 * Log dmabuf memory retained by userspace processes.
 * Pulled from StatsPullAtomService.
 */
 message ProcessDmabufMemory {
  // The uid if available. -1 means not available.
  optional int32 uid = 1 [(is_uid) = true];

  // The process name (from ActivityManager).
  optional string process_name = 2;

  // OOM adj score.
  optional int32 oom_adj_score = 3;

  // Size of dmabufs retained by the process. The buffers are either mapped,
  // retained via an fd, or both.
  // Only available on supported kernel versions (5.4+). When unavailable, set
  // to -1.
  optional int32 retained_dmabuf_kb = 4;

  // Number of buffers retained by the process (mapped / fd).
  // Only available on supported kernel versions (5.4+). When unavailable, set
  // to -1.
  optional int32 retained_dmabuf_count = 5;

  // Size of dmabufs mapped to the process address space.
  optional int32 mapped_dmabuf_kb = 6 [deprecated = true];

  // Number of dmabufs mapped to the process address space.
  optional int32 mapped_dmabuf_count = 7 [deprecated = true];

  // Size of dmabufs mapped to the process address space that are also
  // mapped to the SurfaceFlinger address space. This indicates memory
  // being used by graphics compositing layers. If this data row pertains
  // to SurfaceFlinger itself, then the below field holds the size of all
  // dmabuifs that are shared with any other process. The delta between
  // this field and retained_dmabuf_kb, above, is private dmabufs that
  // SurfaceFlinger is holding but are not shared with other processes.
  optional int32 surfaceflinger_shared_dmabuf_kb = 8;
  // As above, but total number of all dmabufs shared with SurfaceFlinger.
  optional int32 surfaceflinger_shared_dmabuf_count = 9;
}

/**
 * Push network stack events.
 *
 * Log from:
 *     frameworks/base/packages/NetworkStack/
 */
message NetworkStackReported {
    // The id that indicates the event reported from NetworkStack.
    optional int32 event_id = 1;
    // The data for the reported events.
    optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
}

/**
 * Logs the apps that are installed on the external storage.
 * Pulled from:
 *   StatsCompanionService
 */
message AppsOnExternalStorageInfo {
    // The type of the external storage.
    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
    // The name of the package that is installed on the external storage.
    optional string package_name = 2;
}

/**
 * Logs the settings related to Face.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats
 */
message FaceSettings {
    // Whether or not face unlock is allowed on Keyguard.
    optional bool unlock_keyguard_enabled = 1;
    // Whether or not face unlock dismisses the Keyguard.
    optional bool unlock_dismisses_keyguard = 2;
    // Whether or not face unlock requires attention.
    optional bool unlock_attention_required = 3;
    // Whether or not face unlock is allowed for apps (through BiometricPrompt).
    optional bool unlock_app_enabled = 4;
    // Whether or not face unlock always requires user confirmation.
    optional bool unlock_always_require_confirmation = 5;
    // Whether or not a diverse set of poses are required during enrollment.
    optional bool unlock_diversity_required = 6;
}

/**
 * Logs cooling devices maintained by the kernel.
 *
 * Pulled from StatsCompanionService.java
 */
message CoolingDevice {
    // The type of cooling device being reported. Eg. CPU, GPU...
    optional android.os.CoolingTypeEnum device_location = 1;
    // The name of the cooling device source. Eg. CPU0
    optional string device_name = 2;
    // Current throttle state of the cooling device. The value can any unsigned
    // integer between 0 and max_state defined in its driver. 0 means device is
    // not in throttling, higher value means deeper throttling.
    optional int32 state = 3;
}

/**
 * Intelligence has several counter-type events that don't warrant a
 * full separate atom. These are primarily API call counters but also include
 * counters for feature usage and specific failure modes.
 *
 * Logged from the Intelligence mainline module.
 */
message IntelligenceEventReported {
  // The event type.
  optional android.stats.intelligence.EventType event_id = 1;
  // Success, failure.
  optional android.stats.intelligence.Status status = 2;
  // How many times the event occured (to report a batch of high frequency events).
  optional int32 count = 3;
  // How long the event took (sum of durations if count > 1)
  optional int64 duration_millis = 4;
}

/**
 * Logs when Car Power state changed.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
 */
message CarPowerStateChanged {
    // States come from CpmsState in CarPowerManagementService.java.
    enum State {
       WAIT_FOR_VHAL = 0;
       ON = 1;
       SHUTDOWN_PREPARE = 2;
       WAIT_FOR_FINISH = 3;
       SUSPEND = 4;
       SIMULATE_SLEEP = 5;
    }
    optional State state = 1;
}

/**
 * Logs when Car User Hal is requested to switch/create/remove user.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalModifyUserRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;
    // Request type.
    enum RequestType {
        UNKNOWN = 0;
        // Car user manager requested user switch.
        SWITCH_REQUEST_ANDROID = 1;
        // OEM requested User switch.
        SWITCH_REQUEST_OEM = 2;
        // Hal switch requested after android switch using activity manager.
        SWITCH_REQUEST_LEGACY = 3;
        // Create User
        CREATE_REQUEST = 4;
        // Remove User
        REMOVE_REQUEST = 5;
    }
    optional RequestType request_type = 2;
    // Android User id of the current user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 user_id = 3;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 user_flags = 4;
    // Android User id of the target user for switch/create/remove. It can only
    // be 0, 10, 11 and so on. -1 if not available.
    optional int32 target_user_id = 5;
    // VHAL flags of the target user for switch/create/remove. (-1 if not available)
    optional int32 target_user_flags = 6;
    // Request timeout Milliseconds (-1 if not available)
    optional int32 timeout_millis = 7;
}

/**
 * Logs when Car User Hal responds to switch/create user request.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalModifyUserResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;

    // Hal request status for user switch/create/remove.
    enum HalRequestStatus {
        UNSPECIFIED = 0;
        // Hal request for user switch/create is successful.
        SUCCESS = 1;
        // Hal request for user switch/create failed.
        FAILURE = 2;
    }
    optional HalRequestStatus request_status = 3;
}

/**
 * Logs when post switch response is posted to Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalPostSwitchResponseReported {
    // Request id.
    optional int32 request_id = 1;

    // Android user switch status.
    enum UserSwitchStatus {
        UNKNOWN = 0;
        // Android user switch is successful.
        SUCCESS = 1;
        // Android user switch failed.
        FAILURE = 2;
    }
    optional UserSwitchStatus switch_status = 2;
}

/**
 * Logs when initial user information is requested from Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalInitialUserInfoRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;

    // Request type for initial user information.
    enum InitialUserInfoRequestType {
        UNKNOWN = 0;
        // At the first time Android was booted (or after a factory reset).
        FIRST_BOOT = 1;
        // At the first time Android was booted after the system was updated.
        FIRST_BOOT_AFTER_OTA = 2;
        // When Android was booted "from scratch".
        COLD_BOOT = 3;
        // When Android was resumed after the system was suspended to memory.
        RESUME = 4;
    }
    optional InitialUserInfoRequestType request_type = 2;
    // Request timeout Milliseconds (-1 if not available)
    optional int32 timeout_millis = 3;
}

/**
 * Logs when Car User Hal responds to initial user information requests.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalInitialUserInfoResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;
    // Response for initial user information request.
    enum InitialUserInfoResponseAction {
        UNSPECIFIED = 0;
        // Let the Android System decide what to do.
        DEFAULT = 1;
        // Switch to an existing Android user.
        SWITCH = 2;
        // Create a new Android user (and switch to it).
        CREATE = 3;
    }
    optional InitialUserInfoResponseAction response_action = 3;
    // Android User id of the target user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 target_user = 4;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 target_user_flags = 5;
    // User locales
    optional string user_locales = 6;
}

/**
 * Logs when set user association is requested from Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalUserAssociationRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;
    // Request type.
    enum RequestType {
        UNKNOWN = 0;
        // For setting user association information.
        SET = 1;
        // For getting user association information.
        GET = 2;
    }
    optional RequestType request_type = 2;
    // Android User id of the current user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 current_user_id = 3;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 current_user_flags = 4;
    // Number of the set associations requested.
    optional int32 number_associations = 5;
    // Concatenated string for the types from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_types = 6;
    // Concatenated string for the values from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_values = 7;
}

/**
 * Logs when Car User Hal responds to set user association requests.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalSetUserAssociationResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;
    // Number of the set associations in the response.
    optional int32 number_associations = 3;
    // Concatenated string for the types from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_types = 4;
    // Concatenated string for the values from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_values = 5;
}

/**
 * Logs whether GarageMode is entered.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
 */
message GarageModeInfo {
    // Whether GarageMode is entered.
    optional bool is_garage_mode = 1;
}

/**
 * Historical app ops data per package.
 */
message AppOps {
    // Uid of the package requesting the op
    optional int32 uid = 1 [(is_uid) = true];

    // Name of the package performing the op
    optional string package_name = 2;

    // operation id
    optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];

    // The number of times the op was granted while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_granted_count = 4;

    // The number of times the op was granted while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_granted_count = 5;

    // The number of times the op was rejected while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_rejected_count = 6;

    // The number of times the op was rejected while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_rejected_count = 7;

    // For long-running operations, total duration of the operation
    // while the app was in the foreground (only for trusted requests)
    optional int64 trusted_foreground_duration_millis = 8;

    // For long-running operations, total duration of the operation
    // while the app was in the background (only for trusted requests)
    optional int64 trusted_background_duration_millis = 9;

    // Whether AppOps is guarded by Runtime permission
    optional bool is_runtime_permission = 10;
}

/**
 * Historical app ops data per package and attribution tag.
 */
message AttributedAppOps {
    // Uid of the package requesting the op
    optional int32 uid = 1 [(is_uid) = true];

    // Name of the package performing the op
    optional string package_name = 2;

    // tag; provided by developer when accessing related API, limited at 50 chars by API.
    // Attributions must be provided through manifest using <attribution> tag available in R and
    // above.
    optional string tag = 3;

    // operation id
    optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];

    // The number of times the op was granted while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_granted_count = 5;

    // The number of times the op was granted while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_granted_count = 6;

    // The number of times the op was rejected while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_rejected_count = 7;

    // The number of times the op was rejected while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_rejected_count = 8;

    // For long-running operations, total duration of the operation
    // while the app was in the foreground (only for trusted requests)
    optional int64 trusted_foreground_duration_millis = 9;

    // For long-running operations, total duration of the operation
    // while the app was in the background (only for trusted requests)
    optional int64 trusted_background_duration_millis = 10;

    // Whether AppOps is guarded by Runtime permission
    optional bool is_runtime_permission = 11;

    // Sampling rate used on device, from 0 to 100
    optional int32 sampling_rate = 12;
}

/**
 * Location Manager API Usage information(e.g. API under usage,
 * API call's parameters).
 * Logged from:
 *  frameworks/base/services/core/java/com/android/server/LocationManagerService.java
 */
message LocationManagerApiUsageReported {

    // Indicating if usage starts or usage ends.
    optional android.stats.location.UsageState state = 1;

    // LocationManagerService's API in use.
    // We can identify which API from LocationManager is
    // invoking current LMS API by the combination of
    // API parameter(e.g. is_listener_null, is_intent_null,
    // is_location_request_null)
    optional android.stats.location.LocationManagerServiceApi api_in_use = 2;

    // Name of the package calling the API.
    optional string calling_package_name = 3;

    // Type of the location provider.
    optional android.stats.location.ProviderType provider = 4;

    // Quality of the location request
    optional android.stats.location.LocationRequestQuality quality = 5;

    // The desired interval for active location updates, in milliseconds.
    // Bucketized to reduce cardinality.
    optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;

    // Minimum distance between location updates, in meters.
    // Bucketized to reduce cardinality.
    optional android.stats.location.SmallestDisplacementBucket
            bucketized_smallest_displacement = 7;

    // The number of location updates.
    optional int64 num_updates = 8;

    // The request expiration time, in millisecond since boot.
    // Bucketized to reduce cardinality.
    optional android.stats.location.ExpirationBucket
            bucketized_expire_in = 9;

    // Type of Callback passed in for this API.
    optional android.stats.location.CallbackType callback_type = 10;

    // The radius of the central point of the alert
    // region, in meters. Only for API REQUEST_GEOFENCE.
    // Bucketized to reduce cardinality.
    optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;

    // Activity Importance of API caller.
    // Categorized to 3 types that are interesting from location's perspective.
    optional android.stats.location.ActivityImportance activiy_importance = 12;

    // Attribution tag passed to this API.
    optional string attribution_tag = 13;
}

/**
 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
 */
message ReviewPermissionsFragmentResultReported {
    // unique value identifying a permission group change. A permission group change might result
    // in multiple of these atoms
    optional int64 change_id = 1;

    // UID of package the permission belongs to
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package the permission belongs to
    optional string package_name = 3;

    // The permission to be granted
    optional string permission_name = 4;

    // The result of the permission grant
    optional bool permission_granted = 5;
}

/**
* Information about results of permission upgrade by RuntimePermissionsUpgradeController
* Logged from: RuntimePermissionUpdgradeController
*/
message RuntimePermissionsUpgradeResult {
    // Permission granted as result of upgrade
    optional string permission_name = 1;

    // UID of package granted permission
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package granted permission
    optional string package_name = 3;
}

/**
* Information about a buttons presented in GrantPermissionsActivity and choice made by user
*/
message GrantPermissionsActivityButtonActions {
    // Permission granted as result of upgrade
    optional string permission_group_name = 1;

    // UID of package granted permission
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package requesting permission
    optional string package_name = 3;

    // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
    // LABEL_ constants in GrantPermissionActivity.java
    optional int32 buttons_presented = 4;

    // Button clicked by user - same as bit flags in buttons_presented with only single bit set
    optional int32 button_clicked = 5;

    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 6;

    // Target SDK of the package
    optional int32 target_sdk = 7;

    // Selected precision of the location permission - bit flags indicate which
    // locations were chosen
    optional int32 selected_precision = 8;

    // Whether Permission Rationale was shown on grant permission activity
    optional bool permission_rationale_shown = 9;
}

/**
 * Information about LocationAccessCheck notification presented to user
 */
message LocationAccessCheckNotificationAction {

    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // Uid of package for which location access check is presented
    optional int32 package_uid = 2;

    // Name of package for which location access check is presented
    optional string package_name = 3;

    enum Result {
        UNDEFINED = 0;
        // notification was presented to the user
        NOTIFICATION_PRESENTED = 1;
        // notification was declined by the user
        NOTIFICATION_DECLINED = 2;
        // notification was clicked by the user
        NOTIFICATION_CLICKED = 3;
    }

    // View / interaction recorded
    optional Result result = 4;
}

/**
 * Information about a permission grant or revoke made by user inside AppPermissionFragment
 */
message AppPermissionFragmentActionReported {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // unique value identifying a permission group change. A permission group change might result
    // in multiple of these atoms
    optional int64 change_id = 2;

    // UID of package the permission belongs to
    optional int32 uid = 3 [(is_uid) = true];

    // Name of package the permission belongs to
    optional string package_name = 4;

    // The permission to be granted
    optional string permission_name = 5;

    // The result of the permission grant
    optional bool permission_granted = 6;

    // State of Permission Flags after grant as per android.content.pm.PermissionFlags
    optional int32 permission_flags = 7;

    enum Button {
        UNDEFINED = 0;
        // Allow button
        ALLOW = 1;
        // Deny button
        DENY = 2;
        // Ask every time button
        ASK_EVERY_TIME = 3;
        // Allow all the time button
        ALLOW_ALWAYS = 4;
        // Allow only while using the app button
        ALLOW_FOREGROUND = 5;
        // Same is Deny button but shown in while in use dialog
        DENY_FOREGROUND = 6;
        // Switch button set to ON for location accuracy
        GRANT_FINE_LOCATION = 7;
        // Switch button set to OFF for location accuracy
        REVOKE_FINE_LOCATION = 8;
        // The user has selected photos/videos from the photo picker
        PHOTOS_SELECTED = 9;
        // User selects Permission Rationale label
        PERMISSION_RATIONALE = 10;
    }

    // Button pressed in the dialog
    optional Button button_pressed = 8;
}

/**
* Information about a AppPermissionFragment viewed by user
*/
message AppPermissionFragmentViewed {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // UID of package for which permissions are viewed
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 3;

    // Permission group viewed
    optional string permission_group_name = 4;

    // Whether Permission Rationale was shown on app permission fragment
    optional bool permission_rationale_shown = 5;
}

/**
* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
* the log retains the old fragment name.
*/
message AppPermissionsFragmentViewed {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // id which identifies single view as every view might have several logging records
    // with different package information attached
    optional int64 view_id = 2;

    // Permission group viewed
    optional string permission_group_name = 3;

    // UID of package for which permissions are viewed
    optional int32 uid = 4 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 5;

    // Category in which permission is included
    enum Category {
      UNDEFINED = 0;
      ALLOWED = 1;
      ALLOWED_FOREGROUND = 2;
      DENIED = 3;
    }
    optional Category category = 6;
}
/**
* Information about a PermissionAppsFragment viewed by user.
* Logged from ui/handheld/PermissionAppsFragment.java
*/
message PermissionAppsFragmentViewed {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // id which identifies single view as every view might have several logging records
    // with different package information attached
    optional int64 view_id = 2;

    // Permission group viewed
    optional string permission_group_name = 3;

    // UID of package for which permissions are viewed
    optional int32 uid = 4 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 5;

    // Category in which app is included
    enum Category {
        UNDEFINED = 0;
        ALLOWED = 1;
        ALLOWED_FOREGROUND = 2;
        DENIED = 3;
    }
    optional Category category = 6;
}

/**
* Log that the Auto Revoke notification has been clicked
* Logged from ui/ManagePermissionsActivity
*/
message AutoRevokeNotificationClicked {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;
}

/**
* Log that an app has been displayed on the auto revoke page, and lists one permission that was
* auto revoked for it.
* Logged from ui/handheld/AutoRevokeFragment
*/
message AutoRevokeFragmentAppViewed {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // UID of package for which permissions are viewed
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 3;

    // The name of a permission group that has been revoked
    optional string permission_group_name = 4;

    // The age of the app- more than three months old, or more than six months
    enum Age {
        UNDEFINED = 0;
        NEWER_BUCKET = 1;
        OLDER_BUCKET = 2;
    }

    // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
    optional Age age = 5;
}

/**
* Log that the user has interacted with an app on the auto revoke fragment
* Logged from ui/handheld/AutoRevokeFragment
*/
message AutoRevokedAppInteraction {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // UID of package for which permissions are viewed
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 3;

    enum Action {
        UNDEFINED = 0;
        REMOVE = 1;
        OPEN = 2;
        APP_INFO = 3;
        PERMISSIONS = 4;
        REMOVE_IN_SETTINGS = 5;
        OPEN_IN_SETTINGS = 6;
    }

    // The action the user took to interact with the app
    optional Action action = 4;
}

/**
* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
* auto revoke, or that the auto revoke switch has been changed
* Logged from ui/handheld/AppPermissionGroupsFragment
 */
message AppPermissionGroupsFragmentAutoRevokeAction {
    // id which identifies single session of user interacting with permission controller
    optional int64 session_id = 1;

    // UID of package for which permissions are viewed
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package for which permissions are viewed
    optional string package_name = 3;

    enum Action {
        UNDEFINED = 0;
        OPENED_FOR_AUTO_REVOKE = 1;
        OPENED_FROM_INTENT = 2;
        SWITCH_ENABLED = 3;
        SWITCH_DISABLED = 4;
    }

    // The action the user took to interact with the fragment
    optional Action action = 4;
}

/**
 * Logs when there is a smart selection related event.
 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
 * Logged from: TextClassifierEventLogger.java
 */
message TextSelectionEvent {
    // A session ID.
    optional string session_id = 1;

    // Event type of this event.
    optional android.stats.textclassifier.EventType event_type = 2;

    // Name of the annotator model that is involved in this event.
    optional string model_name = 3;

    // Type of widget that was involved in triggering this event.
    optional android.stats.textclassifier.WidgetType widget_type = 4;

    // Index of this event in a session.
    optional int32 event_index = 5;

    // Entity type that is involved.
    optional string entity_type = 6;

    // Relative word index of the start of the selection.
    optional int32 relative_word_start_index = 7;

    // Relative word (exclusive) index of the end of the selection.
    optional int32 relative_word_end_index = 8;

    // Relative word index of the start of the smart selection.
    optional int32 relative_suggested_word_start_index = 9;

    // Relative word (exclusive) index of the end of the smart selection.
    optional int32 relative_suggested_word_end_index = 10;

    // Name of source package.
    optional string package_name = 11;

    // Name of the LangID model that is involved in this event.
    optional string langid_model_name = 12;
}

/**
 * Logs when there is a smart linkify related event.
 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
 * Logged from: TextClassifierEventLogger.java
 */
message TextLinkifyEvent {
    // A session ID.
    optional string session_id = 1;

    // Event type of this event.
    optional android.stats.textclassifier.EventType event_type = 2;

    // Name of the annotator model that is involved in this event.
    optional string model_name = 3;

    // Type of widget that was involved in triggering this event.
    optional android.stats.textclassifier.WidgetType widget_type = 4;

    // Index of this event in a session.
    optional int32 event_index = 5;

    // Entity type that is involved.
    optional string entity_type = 6;

    // Number of links detected.
    optional int32 num_links = 7;

    // The total length of all links.
    optional int32 linked_text_length = 8;

    // Length of input text.
    optional int32 text_length = 9;

    // Time spent on generating links in ms.
    optional int64 latency_millis = 10;

    // Name of source package.
    optional string package_name = 11;

    // Name of the LangID model that is involved in this event.
    optional string langid_model_name = 12;
}

/**
 * Logs when there is a conversation actions related event.
 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
 * Logged from: TextClassifierEventLogger.java
 */
message ConversationActionsEvent {
    // A session ID.
    optional string session_id = 1;

    // Event type of this event.
    optional android.stats.textclassifier.EventType event_type = 2;

    // Name of the actions model that is involved in this event.
    optional string model_name = 3;

    // Type of widget that was involved in triggering this event.
    optional android.stats.textclassifier.WidgetType widget_type = 4;

    // The first entity type that is involved.
    optional string first_entity_type = 5;

    // The second entity type that is involved.
    optional string second_entity_type = 6;

    // The third entity type that is involved.
    optional string third_entity_type = 7;

    // The score of the first entity type.
    optional float score = 8;

    // Name of source package.
    optional string package_name = 9;

    // Name of the annotator model that is involved in this event.
    optional string annotator_model_name = 10;

    // Name of the LangID model that is involved in this event.
    optional string langid_model_name = 11;
}

/**
 * Logs when there is a language detection related event.
 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
 * Logged from: TextClassifierEventLogger.java
 */
message LanguageDetectionEvent {
    // A session ID.
    optional string session_id = 1;

    // Event type of this event.
    optional android.stats.textclassifier.EventType event_type = 2;

    // Name of the language detection model that is involved in this event.
    optional string model_name = 3;

    // Type of widget that was involved in triggering this event.
    optional android.stats.textclassifier.WidgetType widget_type = 4;

    // Detected language.
    optional string language_tag = 5;

    // Score of the detected language.
    optional float score = 6;

    // Position of this action.
    optional int32 action_index = 7;

    // Name of source package.
    optional string package_name = 8;
}

/**
 * Information about an OTA update attempt by update_engine.
 * Logged from platform/system/update_engine/metrics_reporter_android.cc
 */
message UpdateEngineUpdateAttemptReported {
    // The number of attempts for the update engine to apply a given payload.
    optional int32 attempt_number = 1;

    optional android.stats.otaupdate.PayloadType payload_type = 2;

    // The total time in minutes for the update engine to apply a given payload.
    // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
    // it's increased when the system is sleeping.
    optional int32 duration_boottime_in_minutes = 3;

    // The total time in minutes for the update engine to apply a given payload.
    // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
    // and it's not increased when the system is sleeping.
    optional int32 duration_monotonic_in_minutes = 4;

    // The size of the payload in MiBs.
    optional int32 payload_size_mib = 5;

    // The attempt result reported by the update engine for an OTA update.
    optional android.stats.otaupdate.AttemptResult attempt_result = 6;

    // The error code reported by the update engine after an OTA update attempt
    // on A/B devices.
    optional android.stats.otaupdate.ErrorCode error_code = 7;

    // The build fingerprint of the source system. The value is read from a
    // system property when the device takes the update. e.g.
    // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
    optional string source_fingerprint = 8;

    // Size of super partition.
    optional int64 super_partition_size_bytes = 9;

    // Size of current slot within the super partition.
    optional int64 slot_size_bytes = 10;

    // Free space available in the super partition.
    optional int64 super_free_space_bytes = 11;

    // Whether the device enables Virtual A/B compression.
    optional bool vab_compression_enabled = 12;

    // Whether this update attempt uses Virtual A/B compression.
    optional bool vab_compression_used = 13;
}

/**
 * Information about all the attempts the device make before finishing the
 * successful update.
 * Logged from platform/system/update_engine/metrics_reporter_android.cc
 */
message UpdateEngineSuccessfulUpdateReported {
    // The number of attempts for the update engine to apply the payload for a
    // successful update.
    optional int32 attempt_count = 1;

    optional android.stats.otaupdate.PayloadType payload_type = 2;

    optional int32 payload_size_mib = 3;

    // The total number of bytes downloaded by update_engine since the last
    // successful update.
    optional int32 total_bytes_downloaded_mib = 4;

    // The ratio in percentage of the over-downloaded bytes compared to the
    // total bytes needed to successfully install the update. e.g. 200 if we
    // download 200MiB in total for a 100MiB package.
    optional int32 download_overhead_percentage = 5;

    // The total time in minutes for the update engine to apply the payload for a
    // successful update.
    optional int32 total_duration_minutes = 6;

    // The number of reboot of the device during a successful update.
    optional int32 reboot_count = 7;

    // Whether on device verity computation is enabled
    optional bool fec_enabled = 8;

    // Whether on device hash tree computation is enabled
    optional bool hash_tree_enabled = 9;

}

/**
 * Reported when a client requests to prepare for resume on reboot.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
 */
message RebootEscrowPreparationReported {
  enum Result {
    ROR_NEED_PREPARATION = 0;
    ROR_SKIP_PREPARATION_AND_NOTIFY = 1;
    ROR_SKIP_PREPARATION_NOT_NOTIFY = 2;
  }

  // The uid of the client who requests ror.
  optional int32 requesting_uid = 1 [(is_uid) = true];

  optional Result result = 2;

  // The number of clients who has requested ror, including the current caller.
  optional int32 requested_client_count = 3;
}

/**
 * Reported when the lock screen knowledge factor is captured, while there are clients of
 * resume on reboot to notify.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
 */
message RebootEscrowLskfCaptureReported {
  // The uid of the client to notify about the Lskf capture.
  optional int32 uid_to_notify = 1 [(is_uid) = true];

  // The total number of clients who have requested ror.
  optional int32 requested_client_count = 2;

  // The duration between RoR request - current LSKF capture event.
  optional int32 duration_ror_requested_to_lskf_captured_seconds = 3;
}

/* Reported when a client (e.g. gmscore) requests to reboot with Resume on Reboot.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
 */
message RebootEscrowRebootReported {
  optional int32 error_code = 1;

  // The uid of clients who requested the reboot
  optional int32 request_uid = 2 [(is_uid) = true];

  // All clients that have prepared for RoR before this reboot
  optional int32 prepared_clients_count = 3;

  // The RoR request count for the client who requests reboot.
  optional int32 request_count = 4;

  // Whether the reboot request assumes a slot switch on a/b devices.
  optional bool slot_switch = 5;

  // True if the DeviceConfig shows the device is using server based RoR.
  optional bool server_based = 6;

  // The duration between last LSKF captured - reboot requests
  optional int32 duration_lskf_captured_to_reboot_seconds = 7;

  // The count of LSKF captured since preparation
  optional int32 lskf_captured_counts = 8;
}

/**
 * Logs stats for AppSearch function calls
 */
message AppSearchCallStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_skipped_sample = 2;

    // Package UID of the application.
    optional int32 uid = 3 [(is_uid) = true];

    // Hash of the database name within AppSearch
    optional int32 database = 4;

    // The status code for the call or internal state.
    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 5;

    // Overall time used for the end-to-end function call in AppSearch.
    // It doesn't include binder latency
    optional int32 total_latency_millis = 6;

    // Type of the function call value is in sync with
    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/CallStats.java
    optional int32 call_type = 7;

    // Estimated binder latency (estimated as single-trip time * 2)
    optional int32 estimated_binder_latency_millis = 8;

    // Number of operations succeeded for batch operations.
    optional int32 num_operations_succeeded = 9;

    // Number of operations failed for batch operations.
    optional int32 num_operations_failed = 10;

    // Number of actual API calls reported in this atom.
    optional int32 num_reported_calls = 11;
}

/**
 * Logs detailed stats for putting a single document in AppSearch
 */
message AppSearchPutDocumentStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_skipped_sample = 2;

    // Package UID of the application.
    optional int32 uid = 3 [(is_uid) = true];

    // Hash of the database name within AppSearch
    optional int32 database = 4;

    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 5;

    // Overall time used for a put_document
    optional int32 total_latency_millis = 6;

    // Time used to generate a document proto from a Bundle.
    optional int32 generate_document_proto_latency_millis = 7;

    // Time used to rewrite types and namespaces in the document.
    optional int32 rewrite_document_types_latency_millis = 8;

    // Overall time used for the native function call.
    optional int32 native_latency_millis = 9;

    // Time used to store the document.
    optional int32 native_document_store_latency_millis = 10;

    // Time used to index the document. It doesn't include the time to
    // merge indices.
    optional int32 native_index_latency_millis = 11;

    // Time used to merge the indices.
    optional int32 native_index_merge_latency_millis = 12;

    // Document size in bytes.
    optional int32 native_document_size_bytes = 13;

    // Number of tokens added to the index.
    optional int32 native_num_tokens_indexed = 14;

    // Whether the max number of tokens exceeded.
    optional bool native_exceeded_max_num_tokens = 15;
}

/**
 * Logs detailed stats for AppSearch Initialize
 */
message AppSearchInitializeStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_skipped_sample = 2;

    // Package UID of the application.
    optional int32 uid = 3 [(is_uid) = true];

    // Initialize status code
    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 4;

    // Overall time used for initialization, not including binder latency.
    optional int32 total_latency_millis = 5;

    // Whether the initialize() detects desyncs.
    // Desync happens if we lose the visibility doc.
    optional bool has_desync = 6;

    // Time used to read and process the schema and namespaces.
    optional int32 prepare_schema_and_namespaces_latency_millis = 7;

    // Time used to read and process the visibility file.
    optional int32 prepare_visibility_file_latency_millis = 8;

    // Overall time used for the native function call.
    optional int32 native_latency_millis = 9;

    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
    optional int32 native_document_store_recovery_cause = 10;

    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
    optional int32 native_index_restoration_cause = 11;

    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
    optional int32 native_schema_store_recovery_cause = 12;

    // Time used to recover the document store.
    optional int32 native_document_store_recovery_latency_millis = 13;

    // Time used to restore the index.
    optional int32 native_index_restoration_latency_millis = 14;

    // Time used to recover the schema store.
    optional int32 native_schema_store_recovery_latency_millis = 15;

    // Needs to be sync with DocumentStoreDataStatus in google3/third_party/icing/proto/logging.proto
    optional int32 native_document_store_data_status = 16;

    // Number of documents currently in document store. Those may
    // include alive, deleted, and expired documents.
    optional int32 native_num_documents = 17;

    // Number of schema types currently in the schema store.
    optional int32 native_num_schema_types = 18;

    // Whether we had to reset the index, losing all data, during initialization.
    optional bool has_reset = 19;

    // The status code of the reset operation if has_reset is true.
    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 reset_status_code = 20;
}

/**
 * Logs detailed stats for querying in AppSearch
 *
 * Next tag: 33
 */
message AppSearchQueryStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_skipped_sample = 2;

    // Package UID of the application.
    optional int32 uid = 3 [(is_uid) = true];

    // Hash of the database name within AppSearch
    optional int32 database = 4;

    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 5;

    // Overall time used for query which doesn't include estimated binder latency
    optional int32 total_latency_millis = 6;

    // Time used to rewrite the search spec.
    optional int32 rewrite_search_spec_latency_millis = 7;

    // Time used to rewrite the search results.
    optional int32 rewrite_search_result_latency_millis = 8;

    // Whether it is a global query.
    // Needs to be sync with QueryStats#VisibilityScope in
    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/QueryStats.java
    optional int32 visibility_scope = 9;

    // Overall time used for the native function call.
    optional int32 native_latency_millis = 10;

    // Number of terms in the query string.
    optional int32 native_num_terms = 11;

    // Length of the query string.
    optional int32 native_query_length = 12;

    // Number of namespaces filtered.
    optional int32 native_num_namespaces_filtered = 13;

    // Number of schema types filtered.
    optional int32 native_num_schema_types_filtered = 14;

    // The requested number of results in one page.
    optional int32 native_requested_page_size = 15;

    // The actual number of results returned in the current page.
    optional int32 native_num_results_returned_current_page = 16;

    // Whether the function call is querying the first page. If it's
    // not, Icing will fetch the results from cache so that some steps
    // may be skipped.
    optional bool native_is_first_page = 17;

    // Time used to parse the query, including 2 parts: tokenizing and
    // transforming tokens into an iterator tree.
    optional int32 native_parse_query_latency_millis = 18;

    // Strategy of scoring and ranking.
    // Needs to be sync with RankingStrategy.Code in google3/third_party/icing/proto/scoring.proto
    optional int32 native_ranking_strategy = 19;

    // Number of documents scored.
    optional int32 native_num_documents_scored = 20;

    // Time used to score the raw results.
    optional int32 native_scoring_latency_millis = 21;

    // Time used to rank the scored results.
    optional int32 native_ranking_latency_millis = 22;

    // Time used to fetch the document protos. Note that it includes the
    // time to snippet if "native_num_results_with_snippets" is NOT zero.
    optional int32 native_document_retrieval_latency_millis = 23;

    // How many snippets are calculated.
    optional int32 native_num_results_with_snippets = 24;

    // Time passed while waiting to acquire the lock during Java function calls.
    optional int32 java_lock_acquisition_latency_millis = 25;

    // Time spent on ACL checking. This is the time spent filtering namespaces
    // based on package permissions and Android permission access.
    optional int32 acl_check_latency_millis = 26;

    // Time passed while waiting to acquire the lock during native function calls.
    optional int32 native_lock_acquisition_latency_millis = 27;

    // Time used to send data across the JNI boundary from java to native side.
    optional int32 java_to_native_jni_latency_millis = 28;

    // Time used to send data across the JNI boundary from native to java side.
    optional int32 native_to_java_jni_latency_millis = 29;

    // The type of the join query.
    //
    // Needs to be sync with AppSearchSchema#JoinableValueType in
    // packages/modules/AppSearch/framework/java/external/android/app/appsearch/AppSearchSchema.java
    optional int32 join_type = 30;

    // How many total documents were joined to the parent documents.
    optional int32 native_num_joined_results_current_page = 31;

    // Time taken to join child documents to parent documents.
    optional int32 native_join_latency_millis = 32;
}

/**
 * Logs detailed stats for remove in AppSearch
 */
message AppSearchRemoveStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_previous_skipped_sample = 2;

    // Package UID of the application.
    optional int32 uid = 3 [(is_uid) = true];

    // Hash of the database name within AppSearch
    optional int32 database = 4;

    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 5;

    // Overall time used for remove including the binder latency
    optional int32 total_latency_millis = 6;

    // Overall time used for the native function call.
    optional int32 native_latency_millis = 7;

    // Used to indicate what kind of delete(namespace, schemaType etc) calls deleteByQuery here.
    // Needs to be sync with external/icing/proto/icing/proto/logging.proto#DeleteStatsProto
    optional int32 native_delete_type = 8;

    // Number of documents deleted by this call.
    optional int32 native_num_documents_deleted = 9;
}

/**
 * Logs detailed stats for optimization in AppSearch.
 *
 * stats pushed from:
 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
 *
 * Next tag: 14
 */
message AppSearchOptimizeStatsReported {
    // The sampling interval for this specific type of stats
    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
    optional int32 sampling_interval = 1;

    // # of previous skipped sample for this specific type of stats
    // We can't push atoms too closely, so some samples might be skipped
    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
    // For example, the true count of an event could be estimated as:
    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
    optional int32 num_previous_skipped_sample = 2;

    // Needs to be sync with AppSearchResult#ResultCode in
    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
    optional int32 status_code = 3;

    // Overall time used for remove including the binder latency
    optional int32 total_latency_millis = 4;

    // Overall time used for the native function call.
    optional int32 native_latency_millis = 5;

    // Time used to optimize the document store in millis.
    optional int32 native_document_store_optimize_latency_millis = 6;

    // Time used to restore the index in millis.
    optional int32 native_index_restoration_latency_millis = 7;

    // Number of documents before the optimization.
    optional int32 native_num_original_documents = 8;

    // Number of documents deleted during the optimization.
    optional int32 native_num_deleted_documents = 9;

    // Number of documents expired during the optimization.
    optional int32 native_num_expired_documents = 10;

    // Size of storage in bytes before the optimization.
    optional int64 native_storage_size_before_bytes = 11;

    // Size of storage in bytes after the optimization.
    optional int64 native_storage_size_after_bytes = 12;

    // The amount of time in millis since the last optimization ran.
    optional int64 native_time_since_last_optimize_millis = 13;
}

// Reports information in external/icing/proto/icing/proto/storage.proto#DocumentStorageInfoProto
// Next tag: 15
message AppSearchDocumentStorageInfo {
    // Total number of alive documents.
    optional int32 num_alive_documents = 1;

    // Total number of deleted documents.
    optional int32 num_deleted_documents = 2;

    // Total number of expired documents.
    optional int32 num_expired_documents = 3;

    // Total size of the document store in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 document_store_size_bytes = 4;

    // Total size of the ground truth in bytes. The ground truth may
    // include deleted or expired documents. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 document_log_size_bytes = 5;

    // Size of the key mapper in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 key_mapper_size_bytes = 6;

    // Size of the document id mapper in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 document_id_mapper_size_bytes = 7;

    // Size of the score cache in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 score_cache_size_bytes = 8;

    // Size of the filter cache in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 filter_cache_size_bytes = 9;

    // Size of the corpus mapper in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 corpus_mapper_size_bytes = 10;

    // Size of the corpus score cache in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 corpus_score_cache_size_bytes = 11;

    // Size of the namespace id mapper in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 namespace_id_mapper_size_bytes = 12;

    // Number of namespaces seen from the current documents.
    optional int32 num_namespaces = 13;

    // Storage information of each namespace is not included due to that it has string field.

    reserved 14;
}

// Reports information in external/icing/proto/icing/proto/storage.proto#SchemaStoreStorageInfoProto
// Next tag: 5
message AppSearchSchemaStoreStorageInfo {
    // Size of the schema store in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 schema_store_size_bytes = 1;

    // Total number of schema types.
    optional int32 num_schema_types = 2;

    // Total number of all sections across all types
    optional int32 num_total_sections = 3;

    // Total number of types at the current section limit.
    optional int32 num_schema_types_sections_exhausted = 4;
}

// Reports information in external/icing/proto/icing/proto/storage.proto#IndexStorageInfoProto
// Next tag: 9
message AppSearchIndexStorageInfo {
    // Total size of the index in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 index_size_bytes = 1;

    // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 lite_index_lexicon_size_bytes = 2;

    // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO
    // error is encountered while calculating this field.
    optional int64 lite_index_hit_buffer_size_bytes = 3;

    // Size of the main index lexicon in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 main_index_lexicon_size_bytes = 4;

    // Size of the main index storage in bytes. Will be set to -1 if an IO error
    // is encountered while calculating this field.
    optional int64 main_index_storage_size_bytes = 5;

    // Size of one main index block in bytes.
    optional int64 main_index_block_size_bytes = 6;

    // Number of main index blocks.
    optional int32 num_blocks = 7;

    // Percentage of the main index blocks that are free, assuming
    // allocated blocks are fully used.
    optional float min_free_fraction = 8;
}

/**
 * Pulls information about storage information per user from AppSearch
 *
 * Pulled from:
 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
 *
 * Next tag: 6
 */
message AppSearchStorageInfo {
    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
    // This is mainly used as a dimension for the metric, but it can also tell us if
    // the StorageInfo is for a primary user or secondary user.
    optional int32 user = 1;

    // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is
    // encountered while calculating this field.
    optional int64 total_storage_size_bytes = 2;

    // Storage information of the document store.
    optional AppSearchDocumentStorageInfo document_storage_info = 3
        [(android.os.statsd.log_mode) = MODE_BYTES];

    // Storage information of the schema store.
    optional AppSearchSchemaStoreStorageInfo schema_store_storage_info = 4
        [(android.os.statsd.log_mode) = MODE_BYTES];

    // Storage information of the index.
    optional AppSearchIndexStorageInfo index_storage_info = 5
        [(android.os.statsd.log_mode) = MODE_BYTES];
}


/**
 * Reported when AppSearch Contacts Indexer syncs the contacts data from CP2 to AppSearch
 *
 * Reported from:
 *   packages/modules/AppSearch/service/java/com/android/server/appsearch/contactsindexer/ContactsIndexerManagerService.java
 *
 * Next tag: 18
 */
message ContactsIndexerUpdateStatsReported {
    enum UpdateType {
      UNKNOWN = 0;
      DELTA = 1;
      FULL = 2;
    }

    // Type of the update
    optional UpdateType update_type = 1;

    // Latency for the update in millis
    optional int32 total_latency_millis = 2;

    // Status code to indicate whether the insert new contacts, or update
    // existing contacts succeeds, or fails and why
    // In case of success, it only contains OK.
    // In case of failures, it contains all the possible errors we get.
    repeated int32 update_status_codes = 3;

    // Status code to indicate whether the delete succeeds, or fails and why
    // In case of success, it only contains OK.
    // In case of failures, it contains all the possible errors we get.
    repeated int32 delete_status_codes = 4;

    // Number of new contacts to be updated.
    optional int32 number_of_new_contacts_to_be_updated = 5;

    // Number of old and new contacts has been successfully updated.
    optional int32 number_of_contacts_update_succeeded = 6;

    // Number of old contacts has been successfully deleted.
    optional int32 number_of_contacts_delete_succeeded = 7;

    // Number of old contacts skipped during this update due to no
    // significant change.
    optional int32 number_of_contacts_update_skipped = 8;

    // Number of old and new contacts failed to be updated
    optional int32 number_of_contacts_update_failed = 9;

    // Number of old contacts failed to be deleted
    optional int32 number_of_contacts_delete_failed = 10;

    // Number of old contacts to be deleted that were not found
    optional int32 number_of_contacts_delete_not_found = 11;

    // Start timestamp of the update in millis
    optional int64 update_start_timestamp_millis = 12;

    // Timestamp of the last full update in millis (not including this update)
    optional int64 last_full_update_timestamp_millis = 13;

    // Timestamp of the last delta update in millis (not including this update)
    optional int64 last_delta_update_timestamp_millis = 14;

    // Timestamp of the last contact to be updated from CP2 in millis
    optional int64 last_contact_updated_timestamp_millis = 15;

    // Timestamp of the last contact to be deleted from CP2 in millis
    optional int64 last_contact_deleted_timestamp_millis = 16;

    // The previous update's last_contact_updated_timestamp_millis
    // This field is only set for a full update and expected to match
    // last_contacted_update_timestamp_millis. If the fields do not match, then we
    // were unexpectedly not synced up with CP2 at the time of the update.
    optional int64 previous_last_contact_updated_timestamp_millis = 17;
}

/**
 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
 * key to indicate whether it was successful or not.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
 */
message RebootEscrowRecoveryReported {
    // Type of the resume on reboot backend provider.
    enum ServiceType {
        UNKNOWN = 0;
        HAL = 1;
        SERVER_BASED = 2;
    }

    // Whether the vbmeta digest of the current slot matches a precomputed value before reboot.
    enum VbmetaDigestStatus {
        MATCH_EXPECTED_SLOT = 0;
        MATCH_FALLBACK_SLOT = 1;
        MISMATCH = 2;
    }

    optional bool successful = 1;
    // The error code for escrow data recovery failure
    optional int32 error_code = 2;

    optional ServiceType type = 3;

    // Number of retries to unwrap the escrow key asynchronously.
    optional int32 get_escrow_key_retry_count = 4;

    // The duration between storing of reboot escrow key ->
    // use of reboot escrow key to unlock CE after reboot
    optional int32 duration_escrow_key_storage_to_unlock_seconds = 5;

    optional VbmetaDigestStatus vbmeta_digest_status = 6;

    // The duration between boot complete -> CE unlock
    optional int32 duration_boot_complete_to_unlock_seconds = 7;
}

/**
 * Global display pipeline metrics reported by SurfaceFlinger.
 * Metrics exist beginning in Android 11.
 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
 * That proto must be updated if this atom is updated.
 *
 * Pulled from:
 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
 */
message SurfaceflingerStatsGlobalInfo {
    // Aggregated refresh rate buckets that layers were presenting at. Buckets
    // are defined in SurfaceFlinger and are tracked per device.
    // Introduced in Android 12.
    // This is intended to be used as a dimenstion in collecting per-refresh rate
    // jank statistics.
    optional int32 display_refresh_rate_bucket = 18;
    // Aggregated render rate buckets that layers were overridden to run at.
    // Buckets are defined in SurfaceFlinger and are tracked per device.
    // Introduced in Android 12.
    // This is intended to be used as a dimension in collecting per-render rate
    // jank statistics.
    optional int32 render_rate_bucket = 21;
    // Total number of frames presented during the tracing period
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int64 total_frames = 1;
    // Total number of frames missed
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int64 missed_frames = 2;
    // Total number of frames that fell back to client composition
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int64 client_composition_frames = 3;
    // Total time the display was turned on
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int64 display_on_millis = 4;
    // Total time that was spent performing animations.
    // This is derived from the present-to-present layer histogram.
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int64 animation_millis = 5;
    // Total number of event connections tracked by SurfaceFlinger at the time
    // of this pull. If this number grows prohibitively large, then this can
    // cause jank due to resource contention.
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional int32 event_connection_count = 6;
    // Set of timings measured from when SurfaceFlinger began compositing a
    // frame, until the frame was requested to be presented to the display. This
    // measures SurfaceFlinger's total CPU walltime on the critical path per
    // frame.
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional FrameTimingHistogram frame_duration = 7
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from when SurfaceFlinger first began using the
    // GPU to composite a frame, until the GPU has finished compositing that
    // frame. This measures the total additional time SurfaceFlinger needed to
    // perform due to falling back into GPU composition.
    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
    // using render_rate_bucket as a dimension.
    optional FrameTimingHistogram render_engine_timing = 8
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Number of frames where SF saw a frame, based on its frame timeline.
    // Frame timelines may include transactions without updating buffer contents.
    // Introduced in Android 12.
    optional int32 total_timeline_frames = 9;
    // Number of frames where SF saw a janky frame.
    // Introduced in Android 12.
    optional int32 total_janky_frames = 10;
    // Number of janky frames where SF spent a long time on the CPU.
    // Introduced in Android 12.
    optional int32 total_janky_frames_with_long_cpu = 11;
    // Number of janky frames where SF spent a long time on the GPU.
    // Introduced in Android 12.
    optional int32 total_janky_frames_with_long_gpu = 12;
    // Number of janky frames where SF missed the frame deadline, but there
    // was not an attributed reason (e.g., maybe HWC missed?)
    // Introduced in Android 12.
    optional int32 total_janky_frames_sf_unattributed = 13;
    // Number of janky frames where the app missed the frame deadline, but
    // there was not an attributed reason
    // Introduced in Android 12.
    optional int32 total_janky_frames_app_unattributed = 14;
    // Number of janky frames that were caused because of scheduling errors in
    // SF that resulted in early present (e.g., SF sending a buffer to the
    // composition engine earlier than expected, resulting in a present that is
    // one vsync early)
    // Introduced in Android 12.
    optional int32 total_janky_frames_sf_scheduling = 15;
    // Number of frames that were classified as jank because of possible drift in
    // vsync predictions.
    // Introduced in Android 12.
    optional int32 total_jank_frames_sf_prediction_error = 16;
    // Number of janky frames where the app was in a buffer stuffed state (more
    // than one buffer ready to be presented at the same vsync). Usually caused
    // when the first frame is unusually long, the following frames enter into a
    // stuffed state.
    // Introduced in Android 12.
    optional int32 total_jank_frames_app_buffer_stuffing = 17;
    // Buckets of timings in ms by which SurfaceFlinger's deadline was missed
    // while latching and presenting frames.
    // Introduced in Android 12.
    optional FrameTimingHistogram sf_deadline_misses = 19
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Buckets of timings in ms by which the Vsync prediction drifted, when
    // compared to the actual hardware vsync.
    // Introduced in Android 12.
    optional FrameTimingHistogram sf_prediction_errors = 20
        [(android.os.statsd.log_mode) = MODE_BYTES];

    // Next ID: 22
}

/**
 * Per-layer display pipeline metrics reported by SurfaceFlinger.
 * Metrics exist beginning in Android 11.
 * The number of layers uploaded may be restricted due to size limitations.
 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
 * That proto must be updated if this atom is updated.
 *
 * Pulled from:
 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
 */
message SurfaceflingerStatsLayerInfo {
    // UID of the application who submitted this layer for presentation
    // This is intended to be used as a dimension for surfacing rendering
    // statistics to applications.
    // Introduced in Android 12.
    optional int32 uid = 12 [(is_uid) = true];
    // Refresh rate bucket that the layer was presenting at. Buckets are
    // defined in SurfaceFlinger and are tracked per device.
    // Introduced in Android 12.
    // This is intended to be used as a dimension in collecting per-refresh rate
    // jank statistics
    optional int32 display_refresh_rate_bucket = 22;
    // Render rate bucket that the layer was submitting frames at. Buckets are
    // defined in SurfaceFlinger and are tracked per device.
    // Introduced in Android 12.
    // This is intended to be used as a dimension in collecting per-render rate
    // jank statistics.
    optional int32 render_rate_bucket = 23;

    // Game modes are used only for integrating with GameManager.
    enum GameMode {
         GAME_MODE_UNSPECIFIED = 0;
         GAME_MODE_UNSUPPORTED = 1;
         GAME_MODE_STANDARD = 2;
         GAME_MODE_PERFORMANCE = 3;
         GAME_MODE_BATTERY = 4;
         GAME_MODE_CUSTOM = 5;
    }

    // Game mode that the layer was running at. Used to track user engagement
    // in different modes. The modes are defined in GameManager.java
    // All non-game layers will have this field set to UNSUPPORTED.
    // Introduced in Android 12
    // This is intended to be used as a dimension in collecting per-game mode
    // fps and frame related metrics.
    optional GameMode game_mode = 26;
    // The layer for this set of metrics
    // In many scenarios the package name is included in the layer name, e.g.,
    // layers created by Window Manager. But this is not a guarantee - in the
    // general case layer names are arbitrary debug names.
    optional string layer_name = 1;
    // Total number of frames presented
    optional int64 total_frames = 2;
    // Total number of dropped frames while latching a buffer for this layer.
    optional int64 dropped_frames = 3;
    // Set of timings measured between successive presentation timestamps.
    optional FrameTimingHistogram present_to_present = 4
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Variability histogram of present_to_present timings.
    optional FrameTimingHistogram present_to_present_delta = 27
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from when an app queued a buffer for
    // presentation, until the buffer was actually presented to the
    // display.
    optional FrameTimingHistogram post_to_present = 5
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from when a buffer is ready to be presented,
    // until the buffer was actually presented to the display.
    optional FrameTimingHistogram acquire_to_present = 6
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from when a buffer was latched by
    // SurfaceFlinger, until the buffer was presented to the display
    optional FrameTimingHistogram latch_to_present = 7
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from the desired presentation to the actual
    // presentation time
    optional FrameTimingHistogram desired_to_present = 8
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Set of timings measured from when an app queued a buffer for
    // presentation, until the buffer was ready to be presented.
    optional FrameTimingHistogram post_to_acquire = 9
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Frames missed latch because the acquire fence didn't fire
    optional int64 late_acquire_frames = 10;
    // Frames latched early because the desired present time was bad
    optional int64 bad_desired_present_frames = 11;
    // Number of frames where SF saw a frame, based on its frame timeline.
    // Frame timelines may include transactions without updating buffer contents.
    // Introduced in Android 12.
    optional int32 total_timeline_frames = 13;
    // Number of frames where SF saw a janky frame.
    // Introduced in Android 12.
    optional int32 total_janky_frames = 14;
    // Number of janky frames where SF spent a long time on the CPU.
    // Introduced in Android 12.
    optional int32 total_janky_frames_with_long_cpu = 15;
    // Number of janky frames where SF spent a long time on the GPU.
    // Introduced in Android 12.
    optional int32 total_janky_frames_with_long_gpu = 16;
    // Number of janky frames where SF missed the frame deadline, but there
    // was not an attributed reason (e.g., maybe HWC missed?)
    // Introduced in Android 12.
    optional int32 total_janky_frames_sf_unattributed = 17;
    // Number of janky frames where the app missed the frame deadline, but
    // there was not an attributed reason
    // Introduced in Android 12.
    optional int32 total_janky_frames_app_unattributed = 18;
    // Number of janky frames that were caused because of scheduling errors in
    // SF that resulted in early present (e.g., SF sending a buffer to the
    // composition engine earlier than expected, resulting in a present that is
    // one vsync early)
    // Introduced in Android 12.
    optional int32 total_janky_frames_sf_scheduling = 19;
    // Number of frames that were classified as jank because of possible drift in
    // vsync predictions.
    // Introduced in Android 12.
    optional int32 total_jank_frames_sf_prediction_error = 20;
    // Number of janky frames where the app was in a buffer stuffed state (more
    // than one buffer ready to be presented at the same vsync). Usually caused
    // when the first frame is unusually long, the following frames enter into a
    // stuffed state.
    // Introduced in Android 12.
    optional int32 total_jank_frames_app_buffer_stuffing = 21;

    /**
     * Encapsulates the FrameRateVote information sent by the application while
     * calling setFrameRate.
     * Metrics exist beginning in Android 12.
     */
    message SetFrameRateVote {
        // The desired frame rate the application wishes to run on.
        optional float frame_rate = 1;

        enum FrameRateCompatibility {
            FRAME_RATE_UNDEFINED = 0;
            FRAME_RATE_DEFAULT = 1;
            FRAME_RATE_EXACT_OR_MULTIPLE = 2;
        }

        // Specifies how to interpret the frame rate associated with the layer.
        // Defined in Layer.h
        optional FrameRateCompatibility frame_rate_compatibility = 2;

        enum Seamlessness {
            SEAMLESS_UNDEFINED = 0;
            SEAMLESS_SHOULD_BE_SEAMLESS = 1;
            SEAMLESS_NOT_REQUIRED = 2;
        }
        // Indicates whether seamless refresh rate switch is required or not.
        optional Seamlessness seamlessness = 3;
    }

    // The last frame rate vote set by the application.
    // Introduced in Android 12.
    optional SetFrameRateVote set_frame_rate_vote = 24
        [(android.os.statsd.log_mode) = MODE_BYTES];
    // Buckets of timings in ms by which the app deadline was missed while
    // submitting work for a frame.
    // Introduced in Android 12.
    optional FrameTimingHistogram app_deadline_misses = 25
        [(android.os.statsd.log_mode) = MODE_BYTES];

    // Next ID: 28
}

/**
 * Histogram of frame counts bucketed by time in milliseconds.
 * Because of size limitations, we hard-cap the number of buckets, with
 * buckets for corresponding to larger milliseconds being less precise.
 */
message FrameTimingHistogram {
    // Timings in milliseconds that describes a set of histogram buckets
    repeated int32 time_millis_buckets = 1;
    // Number of frames that match to each time_millis, i.e. the bucket
    // contents
    // It's required that len(time_millis) == len(frame_count)
    repeated int64 frame_counts = 2;
}

/**
 * Janky event as reported by SurfaceFlinger.
 * This event is intended to be consumed by a Perfetto subscriber for
 * automated trace collection.
 *
 * Logged from:
 *    frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
 */
message DisplayJankReported {
    // Informational field for how long the janky event lasted in milliseconds
    optional int64 event_duration_millis = 1;
    // Number of frame deadlines missed, where SurfaceFlinger failed to update
    // the display on time.
    optional int32 present_deadlines_missed = 2;
}

message CameraStreamProto {
    // The stream width (in pixels)
    optional int32 width = 1;
    // The stream height (in pixels)
    optional int32 height = 2;
    // The format of the stream
    optional int32 format = 3;
    // The dataspace of the stream
    optional int32 data_space = 4;
    // The usage flag of the stream
    optional int64 usage = 5;

    // The number of requests for this stream
    optional int64 request_count = 6;
    // The number of buffer error for this stream
    optional int64 error_count = 7;
    // The capture latency of first request for this stream
    optional int32 first_capture_latency_millis = 8;

    // The maximum number of hal buffers
    optional int32 max_hal_buffers = 9;
    // The maximum number of app buffers
    optional int32 max_app_buffers = 10;

    // Type of stream histogram
    // 1: Capture latency: bin size in milliseconds
    enum HistogramType {
        UNKNOWN = 0;
        CAPTURE_LATENCY = 1;
    }
    optional HistogramType histogram_type = 11;
    // The boundary values between histogram bins
    // Expected number of fields: 9
    repeated float histogram_bins = 12;
    // The frame counts for each histogram bins
    // Expected number of fields: 10
    repeated int64 histogram_counts = 13;
    // The dynamic range profile of the stream
    optional int64 dynamic_range_profile = 14;
    // The stream use case
    optional int64 stream_use_case = 15;
    // The color space
    optional int32 color_space = 16;
}

/**
 * Information about camera facing and API level usage.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
 */
message CameraActionEvent {
    // Camera session duration in milliseconds if action is SESSION.
    // 0 if action is OPEN or CLOSE.
    optional int64 duration_millis = 1;

    // Camera API level used.
    // 1 for camera1 API, and 2 for camera2 API.
    optional int32 api_level = 2;

    // Name of client package
    optional string package_name = 3;

    // Camera facing
    enum Facing {
        UNKNOWN = 0;
        BACK = 1;
        FRONT = 2;
        EXTERNAL = 3;
    }
    optional Facing facing = 4;

    // Camera ID
    optional string camera_id = 5;

    // Camera action type
    enum Action {
        UNKNOWN_ACTION = 0;
        OPEN = 1;
        CLOSE = 2;
        SESSION = 3;
    }
    optional Action action = 6;

    // Whether the client is accessing camera using ndk
    optional bool is_ndk = 7;

    // Action OPEN: Open latency
    // Action CLOSE: Close latency
    // Action SESSION: Camera session creation duration.
    //                 If this entry is reusing an existing session, the value is -1.
    optional int32 latency_millis = 8;

    // session type: 0 for normal mode, 1 for constrained high speed mode
    optional int32 operating_mode = 9;

    // If actioh is SESSION: number of internal reconfigurations
    // Else: 0
    optional int32 internal_reconfig = 10;

    // Number of requests for this capture session. Only applicable to SESSION
    // action.
    optional int64 request_count = 11;
    // Number of result errors. Only applicable to SESSION action.
    optional int64 result_error_count = 12;
    // Whether the device runs into error state.
    optional bool device_error = 13;

    // If action is SESSION: Stream states
    // Else: stream_count = 0
    optional int32 stream_count = 14;
    optional CameraStreamProto stream_1 = 15 [(log_mode) = MODE_BYTES];
    optional CameraStreamProto stream_2 = 16 [(log_mode) = MODE_BYTES];
    optional CameraStreamProto stream_3 = 17 [(log_mode) = MODE_BYTES];
    optional CameraStreamProto stream_4 = 18 [(log_mode) = MODE_BYTES];
    optional CameraStreamProto stream_5 = 19 [(log_mode) = MODE_BYTES];

    // User tag string for this session
    optional string user_tag = 20;

    // Video stabilization mode
    // Original type: uint8_t
    optional int32 video_stabilization_mode = 21 [default = -1];

    // Identifier to correlate different Action events to each other
    // Not unique. Must be used with build fingerprint to generate a
    // good enough identifier.
    optional int64 log_id = 22;

    // 0 for OPEN and CLOSE
    // ordinal of the SESSION between OPEN and CLOSE
    optional int32 session_idx = 23;

    // Start: Extension metrics.
    // These will only be set for SESSION which use camera2 extensions

    // Should match CameraExtensionCharacteristics#EXTENSION_*
    enum ExtensionSessionType {
        EXTENSION_NONE = -1;
        EXTENSION_AUTOMATIC = 0;
        EXTENSION_FACE_RETOUCH = 1;
        EXTENSION_BOKEH = 2;
        EXTENSION_HDR = 3;
        EXTENSION_NIGHT = 4;

    }

    // Type of camera extension being used
    optional ExtensionSessionType ext_type = 24 [default = EXTENSION_NONE];

    // Whether advanced extensions session is being used
    optional bool ext_is_advanced = 25;
    // End: Extension Metrics

    optional bool used_ultrawide = 26;

    optional bool used_zoom_override = 27;
}

/**
 * Logs when a compatibility change is affecting an app.
 *
 * Logged from:
 *   frameworks/base/core/java/android/app/AppCompatCallbacks.java and
 *   frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
 */
message AppCompatibilityChangeReported {
    // The UID of the app being affected by the compatibilty change.
    optional int32 uid = 1 [(is_uid) = true];

    // The ID of the change affecting the app.
    optional int64 change_id = 2;

    enum State {
        UNKNOWN_STATE = 0;
        ENABLED = 1;
        DISABLED = 2;
        LOGGED = 3;
    }

    // The state of the change - if logged from gating whether it was enabled or disabled, or just
    // logged otherwise.
    optional State state = 3;

    enum Source {
        UNKNOWN_SOURCE = 0;
        APP_PROCESS = 1;
        SYSTEM_SERVER = 2;
    }

    // Where it was logged from.
    optional Source source = 4;

}

/**
 * Logged from
 *     external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
 */
message PerfettoUploaded {
    // TODO(lalitm): many of the atoms below should be renamed to have a
    // "PERFETTO_CMD" prefix to make clear they are specific to perfetto_cmd.
    // This state exists because of legacy reasons (i.e. these values existed
    // before go/perfetto-monitoring was a thing).
    // Next id: 54.
    enum Event {
        PERFETTO_UNDEFINED = 0;

        // Checkpoints inside perfetto_cmd before tracing is finished.
        PERFETTO_TRACE_BEGIN = 1;
        PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
        PERFETTO_ON_CONNECT = 3;

        // Guardrails inside perfetto_cmd before tracing is finished.
        PERFETTO_ON_TIMEOUT = 16;
        PERFETTO_CMD_USER_BUILD_TRACING_NOT_ALLOWED = 43;
        PERFETTO_CMD_FAILED_TO_INIT_GUARDRAIL_STATE = 44;
        PERFETTO_CMD_INVALID_GUARDRAIL_STATE = 45;
        PERFETTO_CMD_HIT_UPLOAD_LIMIT = 46;

        // Checkpoints inside traced.
        PERFETTO_TRACED_ENABLE_TRACING = 37;
        PERFETTO_TRACED_START_TRACING = 38;
        PERFETTO_TRACED_DISABLE_TRACING = 39;
        PERFETTO_TRACED_NOTIFY_TRACING_DISABLED = 40;

        // Trigger checkpoints inside traced.
        // These atoms are special because, along with the UUID,
        // they log the trigger name.
        PERFETTO_TRACED_TRIGGER_START_TRACING = 41;
        PERFETTO_TRACED_TRIGGER_STOP_TRACING = 42;
        PERFETTO_TRACED_TRIGGER_CLONE_SNAPSHOT = 53;

        // Guardrails inside traced.
        PERFETTO_TRACED_ENABLE_TRACING_EXISTING_TRACE_SESSION = 18;
        PERFETTO_TRACED_ENABLE_TRACING_TOO_LONG_TRACE = 19;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_TIMEOUT = 20;
        PERFETTO_TRACED_ENABLE_TRACING_DURATION_WITH_TRIGGER = 21;
        PERFETTO_TRACED_ENABLE_TRACING_STOP_TRACING_WRITE_INTO_FILE = 22;
        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_TRIGGER_NAME = 23;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_DEFERRED_START = 24;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_BUFFER_SIZE = 25;
        PERFETTO_TRACED_ENABLE_TRACING_BUFFER_SIZE_TOO_LARGE = 26;
        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_BUFFERS = 27;
        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_SESSION_NAME = 28;
        PERFETTO_TRACED_ENABLE_TRACING_SESSION_NAME_TOO_RECENT = 29;
        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_SESSIONS_FOR_UID = 30;
        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_CONCURRENT_SESSIONS = 31;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FD_OUTPUT_FILE = 32;
        PERFETTO_TRACED_ENABLE_TRACING_FAILED_TO_CREATE_FILE = 33;
        PERFETTO_TRACED_ENABLE_TRACING_OOM = 34;
        PERFETTO_TRACED_ENABLE_TRACING_UNKNOWN_ERROR = 35;
        PERFETTO_TRACED_START_TRACING_INVALID_SESSION_STATE = 36;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FILTER = 47;
        PERFETTO_TRACED_ENABLE_TRACING_OOB_TARGET_BUFFER = 48;
        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_MODE = 52;

        // Checkpoints inside perfetto_cmd after tracing has finished.
        PERFETTO_ON_TRACING_DISABLED = 4;
        PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
        PERFETTO_CMD_FW_REPORT_BEGIN = 49;
        // Will be removed once incidentd is no longer used.
        PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;

        // Guardrails inside perfetto_cmd after tracing has finished.
        PERFETTO_CMD_FW_REPORT_EMPTY_TRACE = 50;
        // Will be removed once incidentd is no longer used.
        PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
        PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;

        // "Successful" terminal states inside perfetto_cmd.
        PERFETTO_CMD_FW_REPORT_HANDOFF = 51;

        // Deprecated as "success" is misleading; it simply means we were
        // able to communicate with incidentd. Will be removed once
        // incidentd is no longer used.
        PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9 [deprecated = true];

        // Contained trigger begin/success/failure. Replaced by
        // |PerfettoTriggerAtom| to allow aggregation using a count metric
        // and reduce spam.
        reserved 12, 13, 14;

        // Contained that a guardrail in perfetto_cmd was hit. Replaced with
        // kCmd* guardrails.
        reserved 15;

        // Contained status of Dropbox uploads. Removed as Perfetto no
        // longer supports uploading traces using Dropbox.
        reserved 5, 6, 7;
    }

    // Which stage of the pipeline we are reporting from.
    optional Event event = 1;

    // UUID matching the one set inside the SystemInfo trace packet.
    optional int64 trace_uuid_lsb = 2;
    optional int64 trace_uuid_msb = 3;

    // For trigger checkpoints inside traced, contains the trigger name
    // associated with this trace UUID.
    optional string trigger_name = 4;
}

/**
 * Logged from
 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
 */
message PerfettoTrigger {
    enum Event {
        PERFETTO_UNDEFINED = 0;

        PERFETTO_CMD_TRIGGER = 1;
        PERFETTO_CMD_TRIGGER_FAIL = 2;

        PERFETTO_TRIGGER_PERFETTO_TRIGGER = 3;
        PERFETTO_TRIGGER_PERFETTO_TRIGGER_FAIL = 4;

        PERFETTO_TRACED_LIMIT_PROBABILITY = 5;
        PERFETTO_TRACED_LIMIT_MAX_PER_24_H = 6;

        PERFETTO_PROBES_PRODUCER_TRIGGER = 7;
        PERFETTO_PROBES_PRODUCER_TRIGGER_FAIL = 8;
    }

    // The event which fired.
    optional Event event = 1;

    // The name of the trigger which fired.
    optional string trigger_name = 2;
}

/**
 * Pulls client metrics on data transferred via Vehicle Maps Service.
 * Metrics are keyed by uid + layer.
 *
 * Pulled from:
 *   packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
 */
message VmsClientStats {
    // UID of the VMS client app
    optional int32 uid = 1 [(is_uid) = true];

    // VMS layer definition
    optional int32 layer_type = 2;
    optional int32 layer_channel = 3;
    optional int32 layer_version = 4;

    // Bytes and packets sent by the client for the layer
    optional int64 tx_bytes = 5;
    optional int64 tx_packets = 6;

    // Bytes and packets received by the client for the layer
    optional int64 rx_bytes = 7;
    optional int64 rx_packets = 8;

    // Bytes and packets dropped due to client error
    optional int64 dropped_bytes = 9;
    optional int64 dropped_packets = 10;
}

/**
 * State of a all permission requested by a package - sampled
 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
*/
message DangerousPermissionStateSampled {
    // Name of the permission
    optional string permission_name = 1;

    // Uid of the package
    optional int32 uid = 2 [(is_uid) = true];

    // If the permission is granted to the uid
    optional bool is_granted = 3;

    // Permission flags as per android.content.pm.PermissionFlags
    optional int32 permission_flags = 4;

    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
    optional int32 protection_flags = 5;
}

/**
 * HWUI stats for a given app.
 */
message GraphicsStats {
    // The package name of the app
    optional string package_name = 1;

    // The version code of the app
    optional int64 version_code = 2;

    // The start & end timestamps in UTC as
    // milliseconds since January 1, 1970
    // Compatible with java.util.Date#setTime()
    optional int64 start_millis = 3;

    optional int64 end_millis = 4;

    // HWUI renders pipeline type: GL (1) or Vulkan (2).
    enum PipelineType {
        UNKNOWN = 0;
        GL = 1;
        VULKAN = 2;
    }

    // HWUI renders pipeline type: GL or Vulkan.
    optional PipelineType pipeline = 5;

    // Distinct frame count.
    optional int32 total_frames = 6;

    // Number of "missed vsync" events.
    optional int32 missed_vsync_count = 7;

    // Number of frames in triple-buffering scenario (high input latency)
    optional int32 high_input_latency_count = 8;

    // Number of "slow UI thread" events.
    optional int32 slow_ui_thread_count = 9;

    // Number of "slow bitmap upload" events.
    optional int32 slow_bitmap_upload_count = 10;

    // Number of "slow draw" events.
    optional int32 slow_draw_count = 11;

    // Number of frames that missed their deadline (aka, visibly janked)
    optional int32 missed_deadline_count = 12;

    // The frame time histogram for the package
    optional FrameTimingHistogram cpu_histogram = 13
    [(android.os.statsd.log_mode) = MODE_BYTES];

    // The gpu frame time histogram for the package
    optional FrameTimingHistogram gpu_histogram = 14
    [(android.os.statsd.log_mode) = MODE_BYTES];

    // UI mainline module version.
    optional int64 version_ui_module = 15;

    // If true, these are HWUI stats for up to a 24h period for a given app from today.
    // If false, these are HWUI stats for a 24h period for a given app from the last complete
    // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
    // more apps are running / rendering.
    optional bool is_today = 16;
}

/**
 * Message related to dangerous (runtime) app ops access
 */
message RuntimeAppOpAccess {
    // Uid of the package accessing app op
    optional int32 uid = 1 [(is_uid) = true];

    // Name of the package accessing app op
    optional string package_name = 2;

    // deprecated - set to empty string
    optional string op_deprecated = 3 [deprecated = true];

    // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
    // API. Attributions must be provided through manifest using <attribution> tag available in R
    // and above.
    optional string attribution_tag = 4;

    // message related to app op access, limited to 600 chars by API
    optional string message = 5;

    enum SamplingStrategy {
        DEFAULT = 0;
        UNIFORM = 1;
        RARELY_USED = 2;
        BOOT_TIME_SAMPLING = 3;
        UNIFORM_OPS = 4;
    }

    // sampling strategy used to collect this message
    optional SamplingStrategy sampling_strategy = 6;

    // operation id
    optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
}

/*
 * Logs userspace reboot outcome and duration.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/server/BootReceiver.java
 */
message UserspaceRebootReported {
    // Possible outcomes of userspace reboot.
    enum Outcome {
        // Default value in case platform failed to determine the outcome.
        OUTCOME_UNKNOWN = 0;
        // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
        SUCCESS = 1;
        // Userspace reboot shutdown sequence was aborted.
        FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
        // Remounting userdata into checkpointing mode failed.
        FAILED_USERDATA_REMOUNT = 3;
        // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
        // reboot.
        FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
    }
    // Outcome of userspace reboot. Always set.
    optional Outcome outcome = 1;
    // Duration of userspace reboot in case it has a successful outcome.
    // Duration is measured as time between userspace reboot was initiated and until boot completed
    // (e.g. sys.boot_completed=1).
    optional int64 duration_millis = 2;
    // State of primary user's (user0) credential encryption storage.
    enum UserEncryptionState {
        // Default value.
        USER_ENCRYPTION_STATE_UNKNOWN = 0;
        // Credential encrypted storage is unlocked.
        UNLOCKED = 1;
        // Credential encrypted storage is locked.
        LOCKED = 2;
    }
    // State of primary user's encryption storage at the moment boot completed. Always set.
    optional UserEncryptionState user_encryption_state = 3;
}

/*
 * Logs integrity check information during each install.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
 */
message IntegrityCheckResultReported {
    optional string package_name = 1;
    optional string app_certificate_hash = 2;
    optional int64 version_code = 3;
    optional string installer_package_name = 4;
    enum Response {
        UNKNOWN = 0;
        ALLOWED = 1;
        REJECTED = 2;
        FORCE_ALLOWED = 3;
    }
    optional Response response = 5;
    // An estimate on the cause of the response. This will only be populated for
    // REJECTED and FORCE_ALLOWED
    optional bool caused_by_app_cert_rule = 6;
    optional bool caused_by_installer_rule = 7;
}

/**
 * Logs the information about the rules and the provider whenever rules are
 * pushed into AppIntegrityManager.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
 */
message IntegrityRulesPushed {
    optional bool success = 1;
    // Package name of the app that pushed the rules.
    optional string rule_provider = 2;
    // Version string of arbitrary format provided by the rule provider to
    // identify the rules.
    optional string rule_version = 3;
}

/**
 * Logs when a cell broadcast message is received on the device.
 *
 * Logged from Cell Broadcast module and platform:
 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
 */
message CellBroadcastMessageReported {
    // The type of Cell Broadcast message
    enum CbType {
        UNKNOWN_TYPE = 0;
        GSM = 1;
        CDMA = 2;
        CDMA_SPC = 3;
    }

    // The parts of the cell broadcast message pipeline
    enum ReportSource {
        UNKNOWN_SOURCE = 0;
        FRAMEWORK = 1;
        CB_SERVICE = 2;
        CB_RECEIVER_APP = 3;
    }

    // GSM, CDMA, CDMA-SCP
    optional CbType type = 1;
    // The source of the report
    optional ReportSource source = 2;
    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
    optional int32 serial_number = 3;
    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
    optional int32 message_id = 4;
}

/**
 * Logs when a cell broadcast message is filtered out,
 * or otherwise intentionally not sent to CBR, or not shown to users for reason
 *
 * Logged from Cell Broadcast module:
 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 */
message CellBroadcastMessageFiltered {
    enum FilterReason {
        // shown message to the user
        NOT_FILTERED = 0;
        // filtered message due to duplication (message body, service category, cross sim)
        DUPLICATE_MESSAGE = 1;
        // filtered message due to outside of coordinate range
        GEOFENCED_MESSAGE = 2;
        // filtered message due to not using for emergency alert but for update cell information on Setting Menu
        AREA_INFO_MESSAGE = 3;
        // filtered message due to OEM set config value ‘filtered message for duplication’ as ‘true’
        DISABLED_BY_OEM = 4;
        // when in ECBM(Emergency CallBack Mode) status
        NOTSHOW_ECBM = 5;
        // when user turn off preference of channel
        NOTSHOW_USER_PREF = 6;
        // when Empty content or Unsupported charset
        NOTSHOW_EMPTY_BODY = 7;
        // when language code in message is not same with preference of second language
        NOTSHOW_MISMATCH_PREF_SECOND_LANG = 8;
        // when user turn off preference of second language
        NOTSHOW_PREF_SECONDLANG_OFF = 9;
        // when language code in message is not same with device language setting
        NOTSHOW_MISMATCH_DEVICE_LANG_SETTING = 10;
        // when channel has feature ‘testing_mode = true’ and device is not in cb test_mode
        NOTSHOW_MESSAGE_FOR_TESTMODE = 11;
        // when the message contains ‘filter’ string from properties
        NOTSHOW_FILTER_STRING = 12;
    }

    // GSM, CDMA, CDMA-SCP
    optional CellBroadcastMessageReported.CbType type = 1;
    // The source of the report
    optional FilterReason filter = 2;
    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
    optional int32 serial_number = 3;
    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
    optional int32 message_id = 4;
}

/**
 * Logs when an error occurs while handling a cell broadcast message;
 *
 * Logged from CellBroadcastService module:
 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
 */
message CellBroadcastMessageError {
    // The type of error raised when trying to handle a cell broadcast message
    enum ErrorType {
        UNKNOWN_TYPE = 0;
        CDMA_DECODING_ERROR = 1;
        CDMA_SCP_EMPTY = 2;
        CDMA_SCP_HANDLING_ERROR = 3;
        GSM_INVALID_HEADER_LENGTH = 4;
        GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
        GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
        GSM_INVALID_PDU = 7;
        GSM_INVALID_GEO_FENCING_DATA = 8;
        GSM_UMTS_INVALID_WAC = 9;
        FAILED_TO_INSERT_TO_DB = 10;
        UNEXPECTED_GEOMETRY_FROM_FWK = 11;
        UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
        UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
        UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
        NO_CONNECTION_TO_CB_SERVICE = 15;
    }

    // What kind of error occurred
    optional ErrorType type = 1;
    // Exception message (or log message) associated with the error (max 1000 chars)
    optional string exception_message = 2;
}

/**
 * CellBroadcast channel range
 * Refer from CellBroadcastConfigUpdated, CellBroadcastReceiverFeature
 * Logged from Cell Broadcast module:
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 */
message CellBroadcastChannelRange {
    optional int32 start = 1;
    optional int32 end = 2;
}
/**
 * CellBroadcast channel ranges
 * Nested field for repeated
 * Logged from Cell Broadcast module:
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 */
message CellBroadcastChannelRanges {
    repeated CellBroadcastChannelRange channel_ranges = 1;
}

/**
 * Logs when an channel configuration is updated with mcc-mnc
 *
 * Logged from Cell Broadcast module:
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 */
message CellBroadcastConfigUpdated  {
    // mcc_mnc value of Network operator for the roaming case
    optional string roaming_mcc_mnc = 1;
    // The channel ranges to be updated logged as bytes
    optional CellBroadcastChannelRanges channel_ranges = 2 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when a cell broadcast message is activated with the feature below
 * or when channel configuration is changed with the feature below
 *
 * Logged from Cell Broadcast module:
 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice
 */
message CellBroadcastServiceFeatureChanged {
    // Not for mainline devices, but for android-go devices, OEM can register package names.
    // if there is a data then true otherwise false
    optional bool overlay_additional_cbr_packages = 1;
    // package name which will get area info message
    // if there is a data except “com.android.settings” then true, or false
    optional bool overlay_area_info_packages = 2;
    // Reset Area Info when device goes out of service
    optional bool reset_area_info = 3;
}

/**
 * Logs when a cell broadcast message is activated with the feature below
 * or when channel configuration is changed with the feature below
 *
 * Logged from Cell Broadcast module:
 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
 */
message CellBroadcastReceiverFeatureChanged {
    // Whether to enable alert handling during active voice call
    optional bool alert_during_call = 1;
    // Play alert sound in full volume regardless DND is on
    // [none:0][all:Integer.MAX_VALUE][partial:4370 4380 50]
    optional CellBroadcastChannelRanges override_dnd = 2 [(log_mode) = MODE_BYTES];
    // Whether to Support roaming for attached network operator
    optional bool roaming_support = 3;
    // Whether to save alerts to sms inbox database
    optional bool store_sms = 4;
    // whether the device is in test mode through *#*#CMAS#*#*
    optional bool testing_mode = 5;
    // whether Text To Speech is on/off
    optional bool tts_mode = 6;
    // whether the device is able to enter test mode even on user build
    optional bool testing_mode_on_user_build = 7;
}

/**
 * Logs when exception is occurred in the device
 *
 * Logged from Cell Broadcast module:
 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
 *   packages/apps/CellBroadcastReceiver/
 */
message CellBroadcastModuleErrorReported {
    enum ErrorType {
        ERROR_UNKNOWN = 0;
        ERROR_BAD_CONFIG = 1;
        ERROR_DB_MIGRATION = 2;
        ERROR_DEFAULT_RES = 3;
        ERROR_ENABLE_CHANNEL = 4;
        ERROR_GET_LOCATION = 5;
        ERROR_MISSING_RES = 6;
        ERROR_PLAY_FLASH = 7;
        ERROR_PLAY_SOUND = 8;
        ERROR_PLAY_TTS = 9;
        ERROR_PREF_MIGRATION = 10;
        ERROR_PROVIDER_INIT = 11;
        ERROR_RESET_CHANNEL_R = 12;
        ERROR_STATUS_BAR = 13;
        ERROR_REMINDER_INTERVAL = 14;
        ERROR_ICON_RESOURCE = 15;
        ERROR_CHANNEL_RANGE_PARSE = 16;
        ERROR_DB_INIT = 17;
        ERROR_NOT_FOUND_DEFAULT_CBR_PKGS = 18;
        ERROR_FOUND_MULTIPLE_CBR_PKGS = 19;
    }

    // The source of the report
    optional CellBroadcastMessageReported.ReportSource source = 1;

    // The error type
    optional ErrorType type = 2;
}

/**
 * Logs when a TV Input Service Session changes tune state
 * This is atom ID 327.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
 */
message TifTuneStateChanged {

    // Tv Input Service uid, TV Player uid
    repeated AttributionNode attribution_node = 1 [
        (state_field_option).primary_field_first_uid = true
    ];
    optional android.stats.tv.TifTuneState state = 2 [
        (state_field_option).exclusive_state = true,
        (state_field_option).default_state_value = 0,
        (state_field_option).nested = false
    ];
    // This a globally unique 128 bit random number created by TvInputManagerService when
    // android.media.tv.TvInputManager#createSession is called.
    // It is has no device or user association.
    // See android.media.tv.TvInputService.onCreateSession(java.lang.String, java.lang.String)
    // WARNING: Any changes to this field should be carefully reviewed for privacy.
    //          Inspect the code at
    //          framework/base/cmds/statsd/src/atoms.proto
    //               TifTuneState
    //          frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
    //              logTuneStateChanged
    //              BinderService.createSession
    //              SessionState.sessionId
    optional string tif_session_id = 3 [(state_field_option).primary_field = true];
    optional android.stats.tv.TifInputType type = 4;
    // The id of this TV Input, only unique to a given TV Input Service.
    // This is specifically NOT android.media.tv.TvInputInfo.getId()
    // which is a string that contains the package name of its TvInputService.
    optional int32 input_id = 5  [(state_field_option).primary_field = true];
    // The HDMI port id
    // Only valid when type == HDMI
    optional int32 hdmi_port = 6  [(state_field_option).primary_field = true];
}

/*
 * Logs when JSScriptEngine is used to execute JavaScript code on device.
 *
 * Logged from Cell Broadcast module:
 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/js/
 */
message JSScriptEngineLatencyReported {
    enum LatencyStat {
      UNKNOWN = 0;
      SANDBOX_INIT = 1;
      ISOLATE_CREATE = 2;
      JAVA_PROCESS_EXECUTION = 3;
      WEBVIEW_PROCESS_EXECUTION = 4;
    }

    optional LatencyStat stat = 1;
    optional int64 latency_millis = 2;
}

/**
 * Logs when a tune occurs through device's Frontend.
 * This is atom ID 276.
 *
 * Logged from:
 *   frameworks/base/media/java/android/media/tv/tuner/Tuner.java
 */
message TvTunerStateChanged {
    enum State {
        UNKNOWN = 0;
        TUNING = 1; // Signal is tuned
        LOCKED = 2;    // the signal is locked
        NOT_LOCKED = 3; // the signal isn’t locked.
        SIGNAL_LOST = 4; // the signal was locked, but is lost now.
        SCANNING = 5; // the signal is scanned
        SCAN_STOPPED = 6; // the scan is stopped.
    }
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];
    //  new state
    optional State state = 2;
}

/**
 * Logs the status of a dvr playback or record.
 * This is atom ID 279.
 *
 * Logged from:
 *   frameworks/base/media/java/android/media/tv/tuner/dvr
 */
message TvTunerDvrStatus {
    enum Type {
        UNKNOWN_TYPE = 0;
        PLAYBACK = 1; // is a playback
        RECORD = 2; // is a record
    }
    enum State {
        UNKNOWN_STATE = 0;
        STARTED = 1; // DVR is started
        STOPPED = 2; // DVR is stopped
    }
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];
    // DVR type
    optional Type type = 2;
    //  DVR state
    optional State state = 3;
    //  Identify the segment of a record or playback
    optional int32 segment_id = 4;
    // indicate how many overflow or underflow happened between started to stopped
    optional int32 overflow_underflow_count = 5;
}

/**
 * Logs when a cas session opened through MediaCas.
 * This is atom ID 280.
 *
 * Logged from:
 *   frameworks/base/media/java/android/media/MediaCas.java
 */
message TvCasSessionOpenStatus {
    enum State {
        UNKNOWN = 0;
        SUCCEEDED = 1; // indicate that the session is opened successfully.
        FAILED = 2; // indicate that the session isn’t opened successfully.
    }
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];
    //  Cas system Id
    optional int32 cas_system_id = 2;
    // State of the session
    optional State state = 3;
}

/**
 * Logs for ContactsProvider general usage.
 * This is atom ID 301.
 *
 * Logged from:
 *   packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
 */
message ContactsProviderStatusReported {
    enum ApiType {
        UNKNOWN_API = 0;
        QUERY = 1;
        // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
        INSERT = 2;
        // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
        UPDATE = 3;
        DELETE = 4;
        CALL = 5;

        // Call from CP2 to a GAL provider.
        GAL_CALL = 6;
    }

    // Method called for ApiType.CALL
    enum MethodCall {
        UNKNOWN_METHOD = 0;
        ADD_SIM_ACCOUNTS = 1;
        REMOVE_SIM_ACCOUNTS = 2;
        GET_SIM_ACCOUNTS = 3;
    }

    enum ResultType {
        UNKNOWN_RESULT = 0;
        SUCCESS = 1;
        FAIL = 2;
        ILLEGAL_ARGUMENT = 3;
        UNSUPPORTED_OPERATION = 4;
    }

    enum CallerType {
        UNSPECIFIED_CALLER_TYPE = 0;
        CALLER_IS_SYNC_ADAPTER = 1;
        CALLER_IS_NOT_SYNC_ADAPTER = 2;
    }

    enum TaskType {
        UNKNOWN_TASK = 0;
        DANGLING_CONTACTS_CLEANUP_TASK = 1;
    }

    optional ApiType api_type = 1;
    // Defined in
    // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
    optional int32 uri_type = 2;
    optional CallerType caller_type = 3;
    optional ResultType result_type = 4;
    optional int32 result_count = 5;
    optional int64 latency_micros = 6;
    optional TaskType task_type = 7;
    // Set when api_type == CALL
    optional MethodCall method_called = 8;

    // Normally, it's the binder calling UID. (this could be CP2, for work profile or cloned
    // profile cases.)
    // For GAL_CALL, it's the GAL provider UID.
    optional int32 uid = 9 [(is_uid) = true];
}

/**
 * Logs when an app is frozen or unfrozen.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
 */
message AppFreezeChanged {
    // The type of event.
    enum Action {
        UNKNOWN = 0;
        FREEZE_APP = 1;
        UNFREEZE_APP = 2;
    }
    optional Action action = 1;

    // Pid of the process being frozen.
    optional int32 pid = 2;

    // Name of the process being frozen.
    optional string process_name = 3;

    // Time since last unfrozen.
    optional int64 time_unfrozen_millis = 4;

    // The list of reason should be kept in sync with @OomAdjReason in OomAdjuster.java.
    enum OomAdjReason {
        NONE = 0;
        ACTIVITY = 1;
        FINISH_RECEIVER = 2;
        START_RECEIVER = 3;
        BIND_SERVICE = 4;
        UNBIND_SERVICE = 5;
        START_SERVICE = 6;
        GET_PROVIDER = 7;
        REMOVE_PROVIDER = 8;
        UI_VISIBILITY = 9;
        ALLOWLIST = 10;
        PROCESS_BEGIN = 11;
        PROCESS_END = 12;
    }

    // Deprecated, use unfreeze_reason_v2.
    optional OomAdjReason unfreeze_reason = 5 [ deprecated = true ];

    // The list of reason should be kept in sync with @UnfreezeReason in CachedAppOptimizer.java.
    enum UnfreezeReason {
        UFR_NONE = 0;
        UFR_ACTIVITY = 1;
        UFR_FINISH_RECEIVER = 2;
        UFR_START_RECEIVER = 3;
        UFR_BIND_SERVICE = 4;
        UFR_UNBIND_SERVICE = 5;
        UFR_START_SERVICE = 6;
        UFR_GET_PROVIDER = 7;
        UFR_REMOVE_PROVIDER = 8;
        UFR_UI_VISIBILITY = 9;
        UFR_ALLOWLIST = 10;
        UFR_PROCESS_BEGIN = 11;
        UFR_PROCESS_END = 12;
        UFR_TRIM_MEMORY = 13;
        UFR_PING = 15;
        UFR_FILE_LOCKS = 16;
        UFR_FILE_LOCK_CHECK_FAILURE = 17;
        UFR_BINDER_TXNS = 18;
        UFR_FEATURE_FLAGS = 19;
        UFR_SHORT_FGS_TIMEOUT = 20;
        UFR_SYSTEM_INIT = 21;
        UFR_BACKUP = 22;
        UFR_SHELL = 23;
        UFR_REMOVE_TASK = 24;
        UFR_UID_IDLE = 25;
        UFR_STOP_SERVICE = 26;
        UFR_EXECUTING_SERVICE = 27;
        UFR_RESTRICTION_CHANGE = 28;
        UFR_COMPONENT_DISABLED = 29;
    }

    optional UnfreezeReason unfreeze_reason_v2 = 6;
}

/**
 * Pulls information for a single voice call.
 *
 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message VoiceCallSession {
    // Bearer (IMS or CS) when the call started.
    optional android.telephony.CallBearerEnum bearer_at_start = 1;

    // Bearer (IMS or CS) when the call ended.
    // The bearer may change during the call, e.g. due to SRVCC.
    optional android.telephony.CallBearerEnum bearer_at_end = 2;

    // Direction of the call (incoming or outgoing).
    optional android.telephony.CallDirectionEnum direction = 3;

    // Deprecated by setup_duration_millis
    optional android.telephony.CallSetupDurationEnum setup_duration = 4 [ deprecated = true ];

    // Whether the call ended before the setup was completed.
    optional bool setup_failed = 5;

    // IMS reason code or CS disconnect cause.
    // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
    // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
    optional int32 disconnect_reason_code = 6;

    // IMS extra code or CS precise disconnect cause.
    // For IMS, this code is vendor-specific
    // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
    optional int32 disconnect_extra_code = 7;

    // IMS extra message or CS vendor cause.
    optional string disconnect_extra_message = 8;

    // Radio access technology (RAT) used when call started.
    optional android.telephony.NetworkTypeEnum rat_at_start = 9;

    // Radio access technology (RAT) used when call terminated.
    optional android.telephony.NetworkTypeEnum rat_at_end = 10;

    // Number of times RAT changed during the call.
    optional int64 rat_switch_count = 11;

    // A bitmask of all codecs used during the call.
    // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
    optional int64 codec_bitmask = 12;

    // Number of other calls going on during call setup, for the same SIM slot.
    optional int32 concurrent_call_count_at_start = 13;

    // Number of other calls going on during call termination, for the same SIM slot.
    optional int32 concurrent_call_count_at_end = 14;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 15;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 16;

    // Whether the call was made with an eSIM profile.
    optional bool is_esim = 17;

    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 18;

    // Whether an SRVCC has been completed successfully for this call.
    optional bool srvcc_completed = 19;

    // Number of SRVCC failures.
    optional int64 srvcc_failure_count = 20;

    // Number of SRVCC cancellations.
    optional int64 srvcc_cancellation_count = 21;

    // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
    // enabled in the dialer's settings).
    optional bool rtt_enabled = 22;

    // Whether this was an emergency call.
    optional bool is_emergency = 23;

    // Whether the call was performed while roaming.
    optional bool is_roaming = 24;

    // A random number used as the dimension field to pull multiple atoms.
    optional int32 dimension = 25;

    // Signal strength at the end of the call. This value is applicable to both cellular and WiFi.
    optional android.telephony.SignalStrengthEnum signal_strength_at_end = 26;

    // Band at the end of the call. Value 0 is used if the band is unknown.
    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending on the RAT at
    // the end of the call.
    optional int32 band_at_end = 27;

    // Time spent setting up the call in milliseconds.
    // The time is measured from dial to ringing for outgoing calls, and from answer to connected
    // for incoming calls.
    optional int32 setup_duration_millis = 28;

    // Main codec quality. The codec quality was equal to or greater than this value for at least
    // 70% of the call.
    optional android.telephony.CodecQuality main_codec_quality = 29;

    // Whether video was enabled at any point during the call.
    optional bool video_enabled = 30;

    // Radio access technology (RAT) used when call is connected.
    optional android.telephony.NetworkTypeEnum rat_at_connected = 31;

    // Whether the call was a conference call (applicable only for calls over IMS).
    optional bool is_multiparty = 32;

    // Duration after the call was connected.
    optional android.telephony.CallDuration call_duration = 33;

    // Last known Radio access technology (RAT).
    optional android.telephony.NetworkTypeEnum last_known_rat = 34;

    // Fold state of the device
    optional android.telephony.FoldState fold_state = 35;

    // Number of times RAT changed after call connection
    optional int64 rat_switch_count_after_connected = 36;

    // Handover state of the device
    optional bool handover_in_progress = 37;

    // When the RAT is IWLAN, if it used cross-SIM calling when call started.
    optional bool is_iwlan_cross_sim_at_start = 38;

    // When the RAT is IWLAN, if it used cross-SIM calling when call ended.
    optional bool is_iwlan_cross_sim_at_end = 39;

    // When the RAT is IWLAN, if it used cross-SIM calling when call connected.
    optional bool is_iwlan_cross_sim_at_connected = 40;
}

/**
 * Pulls voice call radio access technology (RAT) usage.
 *
 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
 * time. The atom will be skipped if not enough data is available.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message VoiceCallRatUsage {
    // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
    optional int32 carrier_id = 1;

    // Radio access technology.
    optional android.telephony.NetworkTypeEnum rat = 2;

    // Total duration that voice calls spent on this carrier and RAT, rounded to 5 minutes.
    optional int64 total_duration_seconds = 3;

    // Total number of calls using this carrier and RAT.
    // A call is counted once even if it used the RAT multiple times.
    optional int64 call_count = 4;
}

/**
 * Pulls amount of time spend in each cellular service state.
 *
 * Each pull creates multiple atoms, one for each SIM slot/carrier/RAT(including ENDC), the order of
 * which is irrelevant to time. If multi SIM settings changes during the period, durations will be
 * counted separately before and after the change. Airplane mode does not count towards durations.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message CellularServiceState {
    // Radio access technology (RAT) for voice.
    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
    // NETWORK_TYPE_IWLAN when the device is using VoWiFi.
    optional android.telephony.NetworkTypeEnum voice_rat = 1;

    // Radio access technology (RAT) for data.
    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
    // Only cellular RATs are valid and show where the device is camped.
    optional android.telephony.NetworkTypeEnum data_rat = 2;

    // Whether the device was in roaming (domestic or international) for voice.
    optional android.telephony.RoamingTypeEnum voice_roaming_type = 3;

    // Whether the device was in roaming (domestic or international) for data.
    optional android.telephony.RoamingTypeEnum data_roaming_type = 4;

    // Whether the device is on LTE and has access to NR NSA, i.e. cell supports 5G (ENDC) and UE
    // registration (attach/TAU) indicates ENDC is not restricted.
    optional bool is_endc = 5;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 6;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 7;

    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 8;

    // Total time spent in this service state, rounded to 5 minutes.
    optional int32 total_time_seconds = 9;

    // Whether the device is in limited service (only emergency voice
    // call available). Voice and data RAT will be recorded as
    // NETWORK_TYPE_UNKNOWN in this case.
    optional bool is_emergency_only = 10;

    // Whether internet pdn is up.
    optional bool is_internet_pdn_up = 11;

    // Fold state of the device.
    optional android.telephony.FoldState fold_state = 12;

    // Whether the voice service state is overridden by voice calling capability.
    optional bool override_voice_service = 13;

    // Whether mobile data is enable.
    optional bool isDataEnabled = 14;

    // When the voice RAT is NETWORK_TYPE_IWLAN, determines whether it is over
    // cross-SIM calling (WiFi calling over other SIM's cellular data).
    optional bool is_iwlan_cross_sim = 15;
}

/**
 * Pulls the number of times cellular data service state switches.
 *
 * Each pull creates multiple atoms, one for each RAT combination, the order of which is irrelevant
 * to time. Switches for different SIM slots, carrier IDs, or multi-SIM settings are counted
 * separately.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message CellularDataServiceSwitch {
    // Cellular RAT of the DATA domain from where the switch occurred.
    optional android.telephony.NetworkTypeEnum rat_from = 1;

    // Cellular RAT of the DATA domain to where the switch occurred.
    optional android.telephony.NetworkTypeEnum rat_to = 2;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 3;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 4;

    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 5;

    // Number of switches from rat_from to rat_to.
    optional int32 switch_count = 6;
}

/**
 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message SimSlotState {
    // Number of active SIM slots (both physical and eSIM profiles) in the device.
    optional int32 active_slot_count = 1;

    // Number of SIM cards (both physical and active eSIM profiles).
    // This number may be greater than the number of active SIM slots, if multiple profiles are
    // enabled on the same eUICC.
    optional int32 sim_count = 2;

    // Number of active eSIM profiles.
    // This number is always equal to or less than the number of SIMs.
    optional int32 esim_count = 3;

    // Number of active eSIM slots in the device.
    optional int32 active_esim_slot_count = 4;

    // Number of active slots using Multiple Enabled Profiles in the device.
    optional int32 active_mep_slot_count = 5;
}

/**
 * Pulls supported cellular radio access technologies.
 *
 * This atom reports the capabilities of the device, rather than the network it has access to.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message SupportedRadioAccessFamily {
    // A bitmask of supported radio technologies.
    // See android.telephony.TelephonyManager.NetworkTypeBitMask.
    optional int64 network_type_bitmask = 1;
}

/**
 * Pulls the status of device-level telephony properties.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message DeviceTelephonyProperties {
    // True if the device adopts the data stack came out in T
    // Deprecated since U, where legacy stack has been removed
    optional bool using_t_data_stack = 1 [deprecated = true];
    // True if auto data switch is enabled on the device
    optional bool auto_data_switch_enabled = 2;
    // Number of time the user toggled the data switch feature since the last collection
    optional int32 auto_data_switch_toggle_count = 3;
    // True if work profile is enabled on the device
    optional bool has_managed_profile_dedicated_sub = 4;
    // Number of SIM slots with support for Multiple Enabled Profiles on the device
    optional int32 mep_supported_slot_count = 5;
}

/**
 * This atom is deprecated starting in T, use TelephonyNetworkRequestsV2 instead.
 *
 * Pulls information about network requests.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message TelephonyNetworkRequests {
    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;
    // Number of times the enterprise capability was requested.
    optional int32 enterprise_request_count = 2;
    // Number of times the enterprise capability was released.
    optional int32 enterprise_release_count = 3;
}

/**
 * Pulls information about network requests.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message TelephonyNetworkRequestsV2 {
    enum NetworkCapability {
        // Unknown capability was requested.
        UNKNOWN = 0;
        // Low latency capability (URLLC) was requested.
        PRIORITIZE_LATENCY = 1;
        // High bandwidth capability (EMBB) was requested.
        PRIORITIZE_BANDWIDTH = 2;
        // CBS (Carrier Branded Services) capability was requested.
        CBS = 3;
        // Enterprise capability was requested.
        ENTERPRISE = 4;
    }
    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;
    // The capability that was requested.
    optional NetworkCapability capability = 2;
    // Number of times the capability was requested.
    optional int32 request_count = 3;
}

/**
 * Pulls information for a single incoming SMS.
 *
 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message IncomingSms {
    // Format of the SMS (3GPP or 3GPP2).
    optional android.telephony.SmsFormatEnum sms_format = 1;

    // Technology of the SMS (CS or IMS).
    optional android.telephony.SmsTechEnum sms_tech = 2;

    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
    optional android.telephony.NetworkTypeEnum rat = 3;

    // Type the SMS.
    optional android.telephony.SmsTypeEnum sms_type = 4;

    // Number of total parts.
    optional int32 total_parts = 5;

    // Number of received parts (if smaller than total parts, the SMS was dropped).
    optional int32 received_parts = 6;

    // Indicates if the incoming SMS was blocked.
    optional bool blocked = 7;

    // Indicate a specific error handling the SMS
    optional android.telephony.SmsIncomingErrorEnum error = 8;

    // Whether the SMS was received while roaming.
    optional bool is_roaming = 9;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 10;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 11;

    // Whether the message was received with an eSIM profile.
    optional bool is_esim = 12;

    // Carrier ID of the SIM card used for the SMS.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 13;

    // Random message ID.
    // If the value of count is greater than 1, the message_id represents only one of the messages.
    optional int64 message_id = 14;

    // Number of messages with the same properties (see message_id for exception)
    optional int32 count = 15;

    // Whether the message was received with an enterprise profile.
    optional bool is_managed_profile = 16;
}

/**
 * Pulls information for a single outgoing SMS.
 *
 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message OutgoingSms {
    // Format of the SMS (3GPP or 3GPP2).
    optional android.telephony.SmsFormatEnum sms_format = 1;

    // Technology of the SMS (CS or IMS).
    optional android.telephony.SmsTechEnum sms_tech = 2;

    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
    optional android.telephony.NetworkTypeEnum rat = 3;

    // Result of the SMS sending.
    optional android.telephony.SmsSendResultEnum send_result = 4;

    // Error code
    // For IMS technology, see @SmsManager.Result in
    // http://cs/android/frameworks/base/telephony/java/android/telephony/SmsManager.java
    // For CS technology:
    //  - GSM format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
    //  - CDMA format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
    // The field error_code is used for up-to-Android-13 devices. From Android 14,
    // network_error_code will be used. The field error_code will be deprecated when most devices
    // use Android 14 or higher versions.
    optional int32 error_code = 5;

    // Whether the SMS was sent while roaming.
    optional bool is_roaming = 6;

    // Whether the default SMS application generated the SMS (regardless of which application).
    optional bool is_from_default_app = 7;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 8;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 9;

    // Whether the message was sent with an eSIM profile.
    optional bool is_esim = 10;

    // Carrier ID of the SIM card used for the SMS.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 11;

    // Random message ID.
    // If the value of count is greater than 1, the message_id represents only one of the messages.
    optional int64 message_id = 12;

    // Retry count: 0 for the first attempt and then increasing for each attempt.
    // If the value of count is greater than 1, the retry_id represents the value associated with
    // the message defined by message_id.
    optional int32 retry_id = 13;

    // Time in milliseconds to complete the SMS send to the network.
    // If the value of count is greater than 1, this field measures the average time interval.
    optional int64 interval_millis = 14;

    // Number of messages with the same properties (see message_id, retry_id and latency_millis for
    // exceptions)
    optional int32 count = 15;

    // Internal send error code
    optional android.telephony.SmsSendErrorEnum send_error_code = 16;

    // Network error code
    // - SMS_FORMAT_3GPP format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
    // - SMS_FORMAT_3GPP2 format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
    optional int32 network_error_code = 17;

    // Whether the message was sent with an enterprise profile.
    optional bool is_managed_profile = 18;
}

/**
 * Logs information about usage of airplane mode.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/AirplaneModeStats.java
 */
message AirplaneMode {
    // Status of airplane mode
    optional bool is_enabled = 1;

    // When is_enabled is false, indicates if this was a very short airplane mode toggle
    // (i.e. airplane mode was disabled after less than 10 seconds from enablement).
    optional bool short_toggle = 2;

    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 3;
}

/**
 * Logs information about modem restarts.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/ModemRestartStats.java
 */
message ModemRestart {
    // Software version of the modem, as provided by android.os.Build.getRadioVersion().
    optional string baseband_version = 1;

    // Reason of the modem restart, as provided in the modemReset indication of IRadio HAL.
    optional string reason = 2;

    // Carrier ID of the first SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 3;
}

/**
 * Logs the SIM card details when the carrier ID match is not complete.
 *
 * The atom is pushed when a SIM card is initialized and the MCC/MNC is not present in the
 * carrier ID table, or the SIM card contains a GID1 value that is not present in the carrier ID
 * table. This atom is pushed only once for each type of SIM card.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
 */
message CarrierIdMismatchReported {
    // Matched carrier ID. The value -1 is used if no match is found.
    optional int32 carrier_id = 1;

    // MCC/MNC of the SIM card.
    optional string mcc_mnc = 2;

    // Group identifier (level 1) of the SIM card.
    optional string gid1 = 3;

    // SPN value of the SIM card.
    optional string spn = 4;

    // First record of the PNN in the SIM card. This field is populated only if the SPN is missing
    // or empty.
    optional string pnn = 5;
}

/**
 * Logs the version of the carrier ID matching table at first power up and when it is updated.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
 */
message CarrierIdTableUpdated {
    // Version of the CarrierId matching table.
    optional int32 table_version = 1;
}

/**
 * Pulls the version of the carrier ID matching table.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message CarrierIdTableVersion {
    // Version of the CarrierId matching table.
    optional int32 table_version = 1;
}

/**
 * Pulls information for a single data call session
 *
 * Each pull creates multiple atoms, one for each data call session.
 * The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message DataCallSession {
    // A random number to be used as dimension to capture multiple atoms
    optional int32 dimension = 1;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 2;

    // Whether the call was made with an eSIM profile.
    optional bool is_esim = 3;

    // Data profile of this call (for what purpose this call was made)
    optional android.telephony.DataProfileEnum profile = 4 [deprecated = true];

    // APN type bitmask of the APN used:
    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
    optional int32 apn_type_bitmask = 5;

    // Carrier ID of the SIM
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 6;

    // Whether the subscription is roaming
    optional bool is_roaming = 7;

    // Data RAT when the call ended, can be IWLAN for IMS/MMS, otherwise should be WWAN PS RAT.
    // In the case that the connection hasn't ended yet, this field holds the current RAT.
    // In the case the call ended due to Out Of Service (OOS),
    // this field should be the last known RAT.
    optional android.telephony.NetworkTypeEnum rat_at_end = 8;

    // Was the data call ended due to OOS
    optional bool oos_at_end = 9;

    // Number of RAT switches during the data call
    optional int64 rat_switch_count = 10;

    // Whether the call is on an opportunistic subscription
    optional bool is_opportunistic = 11;

    // Packet data protocol used
    optional android.telephony.ApnProtocolEnum ip_type = 12;

    // Whether the data call terminated before being established
    optional bool setup_failed = 13;

    // Reason why the data call terminated, as in RIL_DataCallFailCause from ril.h
    optional int32 failure_cause = 14;

    // Suggested retry back-off timer value from RIL
    optional int32 suggested_retry_millis = 15;

    // Why the data call was deactivated
    // Set by telephony for MO deactivations (unrelated to failure_cause)
    optional android.telephony.DataDeactivateReasonEnum deactivate_reason = 16;

    // Duration of the data call, rounded into the closest 5 minutes.
    optional int64 duration_minutes = 17;

    // Whether the data call is still connected when the atom is collected.
    optional bool ongoing = 18;

    // Band at the end of the data call. Value 0 is used if the band is unknown.
    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
    // on the RAT at the end of the data call.
    optional int32 band_at_end = 19;

    // Reason why the data call handover failed, as in RIL_DataCallFailCause from ril.h
    repeated int32 handover_failure_causes = 20;

    // For each int32, the lower 16 bits represent the source RAT while the upper 16 bits indicate
    // the target RAT of the failed handover.
    repeated int32 handover_failure_rat = 21;

    // Whether the call is for internet on nonDDS due to auto data switch feature
    optional bool is_non_dds = 22;

    // When the 'rat_at_end' field is IWLAN, determines if the data call setup was
    // over cross-SIM calling (Wifi calling over cellular data).
    optional bool is_iwlan_cross_sim = 23;
}

/**
 * Logs data stall recovery event
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/data/
 *   DataStallRecoveryManager.java
 */
message DataStallRecoveryReported {
    // Carrier ID of the SIM
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;

    // Data RAT when the stall happened
    optional android.telephony.NetworkTypeEnum rat = 2;

    // Signal strength when stall happened
    optional android.telephony.SignalStrengthEnum signal_strength = 3;

    // Action taken to recover
    optional android.telephony.DataStallRecoveryActionEnum action = 4;

    // Whether the subscription is opportunistic
    optional bool is_opportunistic = 5;

    // Whether the device is in multi-SIM mode
    optional bool is_multi_sim = 6;

    // Band used when the stall/recovery took place.
    // Value 0 is used if the band is unknown.
    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
    // on the RAT used at the time.
    optional int32 band = 7;

    // Whether the data stall is recovered.
    optional bool recovered = 8;

    // The elapsed time between start of the data stall and result of current action.
    optional int32 duration_millis = 9;

    // The data stall recovered reason. Available from Android T.
    optional android.telephony.DataStallRecoveredReason reason = 10;

    // Signal strength of the other phone if DSDS when stall happened.
    // SIGNAL_STRENGTH_NONE_OR_UNKNOWN(0) if single SIM.
    optional android.telephony.SignalStrengthEnum other_phone_signal_strength = 11;

    // PS WWAN Network Registration state of the other phone if DSDS when stall happened.
    // REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING(0) if single SIM.
    optional android.telephony.NetworkRegistrationState other_phone_reg_state = 12;

    // PS WWAN Network Registration state of the default phone when data stall.
    optional android.telephony.NetworkRegistrationState phone_reg_state = 13;

    // collect the first validation after recovery when data stall occurs.
    optional bool is_first_validation_after_recovery = 14;

    // The phone id when doing the recovery action.
    optional int32 phone_id = 15;

    // The elapsed time of current action.
    optional int32 duration_millis_of_current_action = 16;

    // Link status of the data network.
    optional int32 link_status = 17;

    // The link up bandwidth of the data network.
    optional int32 link_up_bandwidth = 18;

    // The link down bandwidth of the data network.
    optional int32 link_down_bandwidth = 19;
}

/**
 * Pulls IMS registration terminations.
 *
 * Each pull generates multiple atoms, one for each termination condition happened during the day.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message ImsRegistrationTermination {
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;

    // Whether the device is in multi-SIM mode when the registration terminated.
    optional bool is_multi_sim = 2;

    // Radio access technology (RAT) used by the registration when it terminated.
    // This can be IWLAN if IMS was registered over Wifi.
    optional android.telephony.NetworkTypeEnum rat_at_end = 3;

    // Whether the IMS registration failed before it was established.
    optional bool setup_failed = 4;

    // IMS reason code indicating the termination reason.
    // See: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
    optional int32 reason_code = 5;

    // IMS extra code indicating the termination reason.
    optional int32 extra_code = 6;

    // IMS extra message indicating the termination reason.
    // This string is truncated to 128 characters if its length exceeds the limit.
    optional string extra_message = 7;

    // Total number of instances of registration termination that matches the above conditions.
    optional int32 count = 8;

    // When the 'rat_at_end' field is IWLAN, indicates whether the ImsRegistrationTech is
    // REGISTRATION_TECH_CROSS_SIM.
    optional bool is_iwlan_cross_sim = 9;
}

/**
 * Pulls IMS registration statistics.
 *
 * Each pull generates multiple atoms, one for each carrier, SIM slot, and radio access technology
 * (RAT) combination. Durations are aggregated from all registrations with matching criteria,
 * including ones that are currently active.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message ImsRegistrationStats {
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 2;

    // Radio access technology (RAT) used by the registration.
    // This can be IWLAN if IMS was registered over Wifi.
    optional android.telephony.NetworkTypeEnum rat = 3;

    // Total time IMS was registered (connected time), rounded to 5 minutes.
    optional int32 registered_seconds = 4;

    // Durations that each feature (Voice, Video, UT, SMS) is capable (supported/enabled by the
    // network/device) and available (registered and ready to use).
    // All durations are rounded to 5 minutes and should be equal to or shorter than
    // registered_seconds.
    optional int32 voice_capable_seconds = 5;
    optional int32 voice_available_seconds = 6;
    optional int32 sms_capable_seconds = 7;
    optional int32 sms_available_seconds = 8;
    optional int32 video_capable_seconds = 9;
    optional int32 video_available_seconds = 10;
    optional int32 ut_capable_seconds = 11;
    optional int32 ut_available_seconds = 12;

    // Total time IMS was registering (connecting time), rounded to 5 minutes
    optional int32 registering_seconds = 13;
    // Total time IMS was unregistered (unconnected time), rounded to 5 minutes
    optional int32 unregistered_seconds = 14;

    // When the 'rat' field is IWLAN, indicates whether the ImsRegistrationTech is
    // REGISTRATION_TECH_CROSS_SIM.
    optional bool is_iwlan_cross_sim = 15;
}

/*
 * Logs information related to PIN storage and automatic PIN operations.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/PinStorage.java
 */
message PinStorageEvent {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        // The PIN was verified automatically successfully.
        PIN_VERIFICATION_SUCCESS = 1;
        // The PIN was verified automatically unsuccessfully.
        PIN_VERIFICATION_FAILURE = 2;
        // The PIN(s) was cached, but discarded after reboot (e.g. SIM not present after reboot).
        CACHED_PIN_DISCARDED = 3;
        // The PIN(s) was stored to be used after unattended reboot.
        PIN_STORED_FOR_VERIFICATION = 4;
        // The PIN(s) is not available for storage and will be required after unattended reboot.
        PIN_REQUIRED_AFTER_REBOOT = 5;
        // The PIN was not verified automatically because the SIM card did not match.
        PIN_VERIFICATION_SKIPPED_SIM_CARD_MISMATCH = 6;
        // The available PINs after reboot does not match the number of stored PINs before reboot.
        PIN_COUNT_NOT_MATCHING_AFTER_REBOOT = 7;
        // Error while decrypting the PIN
        PIN_DECRYPTION_ERROR = 8;
        // Error while encrypting the PIN
        PIN_ENCRYPTION_ERROR = 9;
        // Attempted to decrypt the PIN with a null/missing encryption key.
        PIN_ENCRYPTION_KEY_MISSING = 10;
    }
    optional Event event = 1;

    // Number of PINs stored or discarded.
    optional int32 number_of_pins = 2;

    // The caller package name
    optional string package_name = 3;
}

/**
 * Logs flip to screen off events.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/server/power/FaceDownDetector.java
 */
message FaceDownReported {
    enum Response{
        UNKNOWN = 1;
        // The phone was flipped before the screen turns off.
        UNFLIP = 2;
        // User interacts with the screen after a face down is detected.
        USER_INTERACTION = 3;
        // A flip leads to screen turning off. This is the expected outcome.
        SCREEN_OFF = 4;
    }

    // Logs the action that occurs from a flip event, whether by user or system
    // action.
    optional Response face_down_response = 1;

    // After a flip is detected, how long until a system or user action occurs.
    optional int64 millis_since_flip = 2;

    // Difference between the flip time and when the timeout would otherwise
    // occur.
    optional int64 millis_until_normal_timeout = 3;

    // How quickly the user turns the screen back on after a flip event.
    // A low value may indicate a false negative. Logged only when Response is
    // SCREEN_OFF.
    optional int64 millis_until_next_screen_on = 4;
}

/**
 * Logs timeout extended events which occur from consecutive undims.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/server/power/ScreenUndimDetector.java
 */
message TimeoutAutoExtendedReported {
    enum Outcome {
        UNKNOWN = 0;
        POWER_BUTTON = 1;
        TIMEOUT = 2;
    }

    // Logs the action that occurs after timeout is extended from undim.
    optional Outcome outcome = 1;
    // Time from timeout extension to the outcome.
    optional int64 time_to_outcome_millis = 2;
    // Time of first interaction after undim if an interaction occurs.
    // -1 if no interaction occurs before screen turns off.
    optional int64 time_to_first_interaction_millis = 3;
}

/**
 * Logs gnss stats from location service provider
 *
 * Pulled from:
 *  frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
 */
message GnssStats {
    // Number of location reports since boot
    optional int64 location_reports = 1;

    // Total pulled reports of Location failures since boot
    optional int64 location_failure_reports = 2;

    // Number of time to first fix reports since boot
    optional int64 time_to_first_fix_reports = 3;

    // Total pulled reported time to first fix (in milli-seconds) since boot
    optional int64 time_to_first_fix_millis = 4;

    // Number of position accuracy reports since boot
    optional int64 position_accuracy_reports = 5;

    // Total pulled reported position accuracy (in meters) since boot
    optional int64 position_accuracy_meters = 6;

    // Number of top 4 average CN0 reports since boot
    optional int64 top_four_average_cn0_reports = 7;

    // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
    optional int64 top_four_average_cn0_db_mhz = 8;

    // Number of l5 top 4 average CN0 reports since boot
    optional int64 l5_top_four_average_cn0_reports = 9;

    // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
    optional int64 l5_top_four_average_cn0_db_mhz = 10;

    // Total number of sv status messages reports since boot
    optional int64 sv_status_reports = 11;

    // Total number of sv status messages reports, where sv is used in fix since boot
    optional int64 sv_status_reports_used_in_fix = 12;

    // Total number of L5 sv status messages reports since boot
    optional int64 l5_sv_status_reports = 13;

    // Total number of L5 sv status messages reports, where sv is used in fix since boot
    optional int64 l5_sv_status_reports_used_in_fix = 14;
}

/**
 * Logs power usage data from GNSS subsystem.
 *
 * Logged from:
 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
 */
message GnssPowerStats {
    // Relative precision of the alignment of the reported power stats measurement.
    optional int64 elapsed_realtime_uncertainty_nanos = 1;

    // Total GNSS energy consumption in micro-joules (or micro Watt-seconds).
    optional int64 total_energy_micro_joule = 2;

    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
    // tracking signals of a single frequency band.
    optional int64 singleband_tracking_mode_energy_micro_joule = 3;

    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
    // tracking signals of multiple frequency bands.
    optional int64 multiband_tracking_mode_energy_micro_joule = 4;

    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
    // acquiring signals of a single frequency band.
    optional int64 singleband_acquisition_mode_energy_micro_joule = 5;

    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
    // acquiring signals of multiple frequency bands.
    optional int64 multiband_acquisition_mode_energy_micro_joule = 6;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 0)
    optional int64 vendor_specific_power_modes_energy_micro_joule_0 = 7;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 1)
    optional int64 vendor_specific_power_modes_energy_micro_joule_1 = 8;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 2)
    optional int64 vendor_specific_power_modes_energy_micro_joule_2 = 9;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 3)
    optional int64 vendor_specific_power_modes_energy_micro_joule_3 = 10;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 4)
    optional int64 vendor_specific_power_modes_energy_micro_joule_4 = 11;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 5)
    optional int64 vendor_specific_power_modes_energy_micro_joule_5 = 12;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 6)
    optional int64 vendor_specific_power_modes_energy_micro_joule_6 = 13;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 7)
    optional int64 vendor_specific_power_modes_energy_micro_joule_7 = 14;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 8)
    optional int64 vendor_specific_power_modes_energy_micro_joule_8 = 15;

    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
    // operating in each of the vendor-specific power modes. (Index 9)
    optional int64 vendor_specific_power_modes_energy_micro_joule_9 = 16;
}

/**
 * Logs when an app is moved to a different standby bucket.
 *
 * Logged from:
 *   frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
 */
message AppStandbyBucketChanged {
    optional string package_name = 1;

    // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
    optional int32 user_id = 2;

    // These enum values match the constants defined in UsageStatsManager.java.
    enum Bucket {
        BUCKET_UNKNOWN = 0;
        BUCKET_EXEMPTED = 5;
        BUCKET_ACTIVE = 10;
        BUCKET_WORKING_SET = 20;
        BUCKET_FREQUENT = 30;
        BUCKET_RARE = 40;
        BUCKET_RESTRICTED = 45;
        BUCKET_NEVER = 50;
    }
    optional Bucket bucket = 3;

    enum MainReason {
        MAIN_UNKNOWN = 0;
        MAIN_DEFAULT = 0x0100;
        MAIN_TIMEOUT = 0x0200;
        MAIN_USAGE = 0x0300;
        MAIN_FORCED_BY_USER = 0x0400;
        MAIN_PREDICTED = 0x0500;
        MAIN_FORCED_BY_SYSTEM = 0x0600;
    }
    optional MainReason main_reason = 4;

    // A more detailed reason for the standby bucket change. The sub reason name is dependent on
    // the main reason. Values are one of the REASON_SUB_XXX constants defined in
    // UsageStatsManager.java.
    optional int32 sub_reason = 5;
}

/**
* Reports a started sharesheet transaction.
*
* Logged from:
*   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
*   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
*/
message SharesheetStarted {
    // The event_id (as for UiEventReported).
    optional int32 event_id = 1;
    // The calling app's package name.
    optional string package_name = 2;
    // An identifier to tie together multiple logs relating to the same share event
    optional int32 instance_id = 3;
    // The mime type of the share
    optional string mime_type = 4;
    // The number of direct targets the calling app is providing that will be shown.
    optional int32 num_app_provided_direct_targets = 5;
    // The number of app targets the calling app is providing that will be shown.
    optional int32 num_app_provided_app_targets = 6;
    // True if the share originates from the workprofile
    optional bool is_workprofile = 7;

    enum SharesheetPreviewType {  // Constants from ChooserActivity.java
        CONTENT_PREVIEW_TYPE_UNKNOWN = 0;  // Default for proto 2 / 3 compatibility.
        CONTENT_PREVIEW_IMAGE = 1;  // The preview shown in the sharesheet is an image.
        CONTENT_PREVIEW_FILE = 2;  // The preview shown in the sharesheet is a file.
        CONTENT_PREVIEW_TEXT = 3;  // The preview shown in the sharesheet is text.
    }
    // How the sharesheet preview is presented.
    optional SharesheetPreviewType preview_type = 8;

    enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
        INTENT_DEFAULT = 0;
        INTENT_ACTION_VIEW = 1;
        INTENT_ACTION_EDIT = 2;
        INTENT_ACTION_SEND = 3;
        INTENT_ACTION_SENDTO = 4;
        INTENT_ACTION_SEND_MULTIPLE = 5;
        INTENT_ACTION_IMAGE_CAPTURE = 6;
        INTENT_ACTION_MAIN = 7;
    }
    // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
    optional ResolverActivityIntent intent_type = 9;
    // The number of custom actions that the calling app has provided.
    optional int32 num_provided_custom_actions = 10;
    // True if the calling app has provided an action for share modification.
    optional bool modify_share_action_provided = 11;
}

/**
 * Reports a ranking selection event.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
 *   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
 */
message RankingSelected {
    // The event_id (as for UiEventReported).
    optional int32 event_id = 1;
    // The relevant app's package name (can be source or picked package).
    optional string package_name = 2;
    // An identifier to tie together multiple logs relating to the same share event.
    optional int32 instance_id = 3;
    // Which of the ranked targets got picked, default starting position 0.
    optional int32 position_picked = 4;
    // Whether the selected target is pinned.
    optional bool is_pinned = 5;
}

/**
 * Logs when TvSettings UI is interacted at.
 *
 * Logged from: packages/apps/TvSettings
 */
message TvSettingsUIInteracted {

    /** The UI action category */
    optional android.app.tvsettings.Action action = 1;

    /** The ID of the entry that the users actioned on */
    optional android.app.tvsettings.ItemId item_id = 2;
}

/**
 * Logs information about a package installation using package installer V2 APIs.
 *
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
 */
message PackageInstallerV2Reported {
    // Whether this installation uses Incremental File System
    optional bool is_incremental = 1;
    // Name of the package that is intended to be installed
    optional string package_name = 2;
    // The duration between when the install was requested to when the install has completed
    optional int64 duration_millis = 3;
    // Installation result in final integer, which are SystemApi's.
    // Return_code 1 indicates success.
    // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
    optional int32 return_code  = 4;
    // Total size of the APKs installed for this package
    optional int64 apks_size_bytes = 5;
    // UID of the package. -1 if the installation failed.
    optional int32 uid = 6 [(is_uid) = true];
}

/**
 * Logs settings provider values.
 *
 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
 * then write the value to proto.
 *
 */
message SettingSnapshot {

    // Setting key
    optional string name = 1;

    enum SettingsValueType {
        NOTASSIGNED = 0;
        ASSIGNED_BOOL_TYPE = 1;
        ASSIGNED_INT_TYPE = 2;
        ASSIGNED_FLOAT_TYPE = 3;
        ASSIGNED_STRING_TYPE = 4;
    };
    // Setting value type
    optional SettingsValueType type = 2;

    optional bool bool_value = 3;

    optional int32 int_value = 4;

    optional float float_value = 5;

    optional string str_value = 6;

    // Android user index. 0 for primary user, 10, 11 for secondary or profile user
    optional int32 user_id = 7;
}

/**
 * An event logged to indicate that a user journey is about to be performed. This atom includes
 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
 * will immediately follow this atom which will describe the event(s) and its state.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
 */
message UserLifecycleJourneyReported {
    // An identifier to track a chain of user lifecycle events occurring (referenced in the
    // UserLifecycleEventOccurred atom)
    optional int64 session_id = 1;

    // Indicates what type of user journey this session is related to
    enum Journey {
        UNKNOWN = 0; // Undefined user lifecycle journey
        USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
        USER_SWITCH_FG = 2; // A user switch journey without a UI shown
        USER_START = 3; // A user start journey
        USER_CREATE = 4; // A user creation journey
        USER_STOP = 5; // A user stop journey
        USER_REMOVE = 6; // A user removal journey
        GRANT_ADMIN = 7; // An admin grant journey
        REVOKE_ADMIN = 8; // An admin revocation journey
        USER_LIFECYCLE = 9; // User journey from creation to deletion
    }
    optional Journey journey = 2;
    // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
    optional int32 origin_user = 3;
    // Which user the journey is targeting
    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
    optional int32 target_user = 4;

    // What is the user type of the target user
    // These should be in sync with USER_TYPE_* flags defined in UserManager.java
    enum UserType {
        TYPE_UNKNOWN = 0;
        FULL_SYSTEM = 1;
        FULL_SECONDARY = 2;
        FULL_GUEST = 3;
        FULL_DEMO = 4;
        FULL_RESTRICTED = 5;
        PROFILE_MANAGED = 6;
        SYSTEM_HEADLESS = 7;
        PROFILE_CLONE = 8;
        PROFILE_PRIVATE = 9;
    }
    optional UserType user_type = 5;
    // What are the flags attached to the target user
    optional int32 user_flags = 6;
    optional int32 error_code = 7;
    optional int64 elapsed_time = 8;
}

/**
 * An event logged when a specific user lifecycle event is performed. These events should be
 * correlated with a UserLifecycleJourneyReported atom via the session_id.
 * Note: journeys can span over multiple events, hence some events may share a single session id.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
 */
message UserLifecycleEventOccurred {
    // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
    optional int64 session_id = 1;
    // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
    optional int32 user_id = 2;

    enum Event {
        UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
        SWITCH_USER = 1; // Indicates that this is a user switch event
        START_USER = 2; // Indicates that this is a user start event
        CREATE_USER = 3; // Indicates that this is a user create event
        USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
        UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
        UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
        STOP_USER = 7; // Indicates that this is a user stop event
        REMOVE_USER = 8; // Indicates that this is a user removal event
        GRANT_ADMIN = 9; // Indicates that this is an admin privileges grant event
        REVOKE_ADMIN = 10; // Indicates that this is an admin privileges revocation event
    }
    optional Event event = 3;

    enum State {
        NONE = 0; // Indicates the associated event has no start/end defined
        BEGIN = 1;
        FINISH = 2;
        CANCEL = 3;
        ERROR = 4;
    }
    optional State state = 4; // Represents the state of an event (beginning/ending)
    optional int32 error_code = 5;
}

/**
 * The UserInfo information about an Android user (as used in UserManager multiuser).
 *
 * Currently, we do not include information about user 0, since it is uninteresting.
 *
 * This will be pulled from
 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
 */
message UserInfo {
    // The @UserIdInt userId of the user
    optional int32 user_id = 1;

    // The type of user, if AOSP-defined, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}
    optional UserLifecycleJourneyReported.UserType user_type = 2;

    // The type of user if not AOSP-defined. Will be empty if user_type is not TYPE_UNKNOWN.
    optional string user_type_custom = 3;

    // The @UserInfoFlag UserInfo flags of user.
    optional int32 user_flags = 4;

    // Wall-clock time in milliseconds when user was created, according to System.currentTimeMillis
    optional int64 creation_time_millis = 5;

    // Wall-clock time in milliseconds when user last entered the state of STATE_RUNNING_UNLOCKED,
    // according to System.currentTimeMillis
    optional int64 last_logged_in_time_millis = 6;

    // True if user is currently running and unlocked.
    // Note that this is NOT synonymous with being the 'current' user. Multiple users may be
    // running unlocked, with one in the foreground and others running in the background.
    optional bool is_user_running_unlocked = 7;
}


/**
 * The MultiUserInfo information about maximum supported users on the device.
 *
 * This will be pulled from
 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
 */
message MultiUserInfo {
    // Maximum users supported on the device
    optional int32 max_supported_users = 1;
    // Whether multi user setting is on.
    optional bool multi_user_setting_on = 2;
    // Whether device supports multiuser and owner have no restriction in adding users.
    optional bool supports_adding_full_users = 3;
}

/**
 * Logs when accessibility shortcut clicked.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 */
message AccessibilityShortcutReported {
    // The accessibility feature(including installed a11y service, framework a11y feature,
    // and installed a11y activity) package name that is assigned to the accessibility shortcut.
    optional string package_name = 1;

    // The definition of the accessibility shortcut.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ShortcutType shortcut_type = 2;

    // The definition of the service status.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ServiceStatus service_status = 3;
}

/**
 * Logs when accessibility service status changed.
 *
 * Logged from:
 *   packages/apps/Settings/src/com/android/settings/accessibility
 */
message AccessibilityServiceReported {
    // The accessibility service package name.
    optional string package_name = 1;

    // The definition of the service status.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ServiceStatus service_status = 2;
}

/**
 * Pulls accessibility shortcuts status.
 *
 * Pulled from:
 *   StatsPullAtomService
 */
message AccessibilityShortcutStats {
    // The definition of the accessibility software shortcut.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ShortcutType software_shortcut_type = 1;
    // Number of accessibility services in accessibility software shortcut.
    optional int32 software_shortcut_service_num = 2;

    // The definition of the accessibility hardware shortcut.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ShortcutType hardware_shortcut_type = 3;
    // Number of accessibility services in accessibility hardware shortcut.
    optional int32 hardware_shortcut_service_num = 4;

    // The definition of the accessibility gesture shortcut.
    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.ShortcutType gesture_shortcut_type = 5;
    // Number of accessibility services in accessibility gesture shortcut.
    optional int32 gesture_shortcut_service_num = 6;
}

/**
 * Pulls accessibility floating menu status.
 *
 * Pulled from:
 *   StatsPullAtomService
 */
message AccessibilityFloatingMenuStats {
    // Size of the accessibility floating menu.
    optional int32 size = 1;
    // Icon shape of the accessibility floating menu.
    optional int32 icon_type = 2;
    // Whether the accessibility floating menu is enable auto fade ability.
    optional bool fade_enabled = 3;
    // Opacity of the accessibility floating menu. The range is between 0 and 1.
    optional float opacity = 4;
}

/**
 * Logs when display wake up.
 *
 * Logged from:
 *   services/core/java/com/android/server/power/Notifier.java
 */

message DisplayWakeReported {
    // Wake_up_reason code
    // If LOWORD(wake_up_reason) = 0
    //     reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
    //     else reference wake_up_reason to
    //     services/core/java/com/android/server/power/Notifier.java#onWakeUp
    optional int32 wake_up_reason = 1;
    // UID that caused the display to wake
    optional int32 uid = 2 [(is_uid) = true];
}

/**
 * Logs app usage events.
 */
message AppUsageEventOccurred {
    optional int32 uid = 1 [(is_uid) = true];
    optional string package_name = 2;
    optional string class_name = 3;

    enum EventType {
        NONE = 0;
        MOVE_TO_FOREGROUND = 1;
        MOVE_TO_BACKGROUND = 2;
    }
    optional EventType event_type = 4;
}

/*
 * Quality metrics logged when EVS cameras are active.
 *
 * Logged from:
 *  packages/services/Car/evs/manager/1.1/Enumerator.cpp
 */
message EvsUsageStatsReported {

    // Camera identifier to distinguish the source camera device.  This is not
    // globally unique and therefore cannot be used to identify the user and/or
    // the device.
    optional int32 device_id = 1;

    // Peak number of clients during the service
    optional int32 peak_num_clients = 2;

    // Number of erroneous events during the service
    optional int32 num_errors = 3;

    // Round trip latency of the very first frame
    optional int64 first_latency_millis = 4;

    // Average frame round trip latency
    optional float avg_latency_millis = 5;

    // Peak frame round trip latency
    optional int64 peak_latency_millis = 6;

    // Total number of frames received
    optional int64 total_frames = 7;

    // Number of frames ignored
    optional int64 ignored_frames = 8;

    // Number of dropped frames to synchronize camera devices
    optional int64 dropped_frames_to_sync = 9;

    // The duration of the service
    optional int64 duration_millis = 10;
}

/**
 * Logs audio power usage stats.
 *
 * Pushed from:
 *  frameworks/av/services/mediametrics/AudioPowerUsage.cpp
 */
message AudioPowerUsageDataReported {
    /**
     * Device used for input/output
     *
     * All audio devices please refer to below file:
     * system/media/audio/include/system/audio-base.h
     *
     * Define our own enum values because we don't report all audio devices.
     * Currently, we only report built-in audio devices such as handset, speaker,
     * built-in mics, common audio devices such as wired headset, usb headset
     * and bluetooth devices.
     */
    enum AudioDevice {
        OUTPUT_EARPIECE         = 0x1; // handset
        OUTPUT_SPEAKER          = 0x2; // dual speaker
        OUTPUT_WIRED_HEADSET    = 0x4; // 3.5mm headset
        OUTPUT_USB_HEADSET      = 0x8; // usb headset
        OUTPUT_BLUETOOTH_SCO    = 0x10; // bluetooth sco
        OUTPUT_BLUETOOTH_A2DP   = 0x20; // a2dp
        OUTPUT_SPEAKER_SAFE     = 0x40; // bottom speaker

        INPUT_DEVICE_BIT        = 0x40000000; // non-negative positive int32.
        INPUT_BUILTIN_MIC       = 0x40000001; // buildin mic
        INPUT_BUILTIN_BACK_MIC  = 0x40000002; // buildin back mic
        INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
        INPUT_USB_HEADSET_MIC   = 0x40000008; // usb headset mic
        INPUT_BLUETOOTH_SCO     = 0x40000010; // bluetooth sco mic
    }
    optional AudioDevice audio_device = 1;

    // Duration of the audio in seconds
    optional int32 duration_secs = 2;

    // Average volume (0 ... 1.0)
    optional float average_volume = 3;

    enum AudioType {
        UNKNOWN_TYPE = 0;
        VOICE_CALL_TYPE = 1; // voice call
        VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
        MEDIA_TYPE = 3; // music and system sound
        RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
        ALARM_TYPE = 5; // alarm type
        // record type
        CAMCORDER_TYPE = 6; // camcorder
        RECORD_TYPE = 7;  // other recording
    }
    optional AudioType type = 4;

    // Minimum volume duration of the audio in seconds
    optional int32 minimum_volume_duration_secs = 5;

    // Minimum volume (0 ... 1.0)
    optional float minimum_volume = 6;

    // Maximum volume duration of the audio in seconds
    optional int32 maximum_volume_duration_secs = 7;

    // Maximum volume (0 ... 1.0)
    optional float maximum_volume = 8;
}

/**
 * Logs the Spatializer capability when the Spatializer is created.
 *
 * We expect this to occur only once on a healthy system,
 * when audioserver is initialized.
 *
 * On devices that do not support spatialization,
 * SpatializerLevel returns SPATIALIZER_LEVEL_NONE only.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsSpatializerCapabilitiesReported {
    // Available head tracking modes
    repeated android.media.audio.HeadTrackingMode head_tracking_modes = 1;

    // Available spatializer levels
    repeated android.media.audio.SpatializerLevel spatializer_levels = 2;

    // Available spatializer modes
    repeated android.media.audio.SpatializerMode spatializer_modes = 3;

    // Available channel masks, with each channel position bitwise ORed.
    // One or more bits from
    // system/media/audio/include/system/audio-hal-enums.h
    // audio_channel_mask_t, representing the channel configuration
    // of AudioTrack data.
    //
    // Generally the most populated channel_mask is selected for use.
    repeated int64 channel_masks = 4;
}

/**
 * Logs when Spatializer is enabled or disabled for a device.
 *
 * The event field indicates the reason for enabling or disabling:
 * through the Settings UI, startup/boot, or new device detection.
 *
 * The presence of this message indicates that the audio device type
 * supports Spatialization; this is generally a fixed
 * property of the platform and depends if the device type is considered
 * BINAURAL or TRANSAURAL, and the Spatializer support for it.
 *
 * This logs existing saved state on BOOT and changes afterwards.
 * Due to rpc to the MediaMetrics service which generates the atom,
 * the timestamp of the atom may have a slight delay.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsSpatializerDeviceEnabledReported {
    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
    optional android.media.audio.AudioDeviceInfoType type = 1;

    // The event field indicates the reason for enabling or disabling:
    // NORMAL: from Settings UI.
    // BOOT: on startup/boot.
    // FIRST: on new device detection.
    optional android.media.audio.SpatializerSettingEvent event = 2;

    // Whether the spatializer is enabled on that device.
    // This triggers only on a change of state.
    // If multiple devices share the same type (e.g. bluetooth headsets),
    // they will register separate messages.
    optional bool enabled = 3;
}

/**
 * Logs whether the HeadTracker is enabled for a device.
 *
 * This only changes if there is a HeadTracker associated with the device.
 *
 * This logs existing saved state on BOOT and changes afterwards.
 * Due to rpc to the MediaMetrics service which generates the atom,
 * the timestamp of the atom may have a slight delay.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsHeadTrackerDeviceEnabledReported {
    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
    optional android.media.audio.AudioDeviceInfoType type = 1;

    // The event field indicates the reason for enabling or disabling:
    // NORMAL: from Settings UI.
    // BOOT: on startup/boot.
    // FIRST: on new device detection.
    optional android.media.audio.SpatializerSettingEvent event = 2;

    // Whether the head tracker was enabled or disabled on that device.
    // This triggers only on a change of state.
    // If multiple devices share the same type (e.g. bluetooth headsets),
    // they will register separate messages.
    optional bool enabled = 3;
}

/**
 * Logs whether the HeadTracker is supported for a device.
 *
 * Generally a fixed property of the device, but it is possible
 * that the HeadTracker sensor might be turned off
 * or be temporarily unavailable.
 *
 * This logs existing saved state on BOOT and changes afterwards.
 * Due to rpc to the MediaMetrics service which generates the atom,
 * the timestamp of the atom may have a slight delay.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsHeadTrackerDeviceSupportedReported {
    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
    optional android.media.audio.AudioDeviceInfoType type = 1;

    // The event field indicates the reason for enabling or disabling:
    // NORMAL: on sensor change.
    // BOOT: on startup/boot.
    // FIRST: on new device detection.
    optional android.media.audio.SpatializerSettingEvent event = 2;

    // Whether the head tracker is supported on that device.
    // This triggers only on a change of state.
    // If multiple devices share the same type (e.g. bluetooth headsets),
    // they will register separate messages.
    optional bool supported = 3;
}

/**
  * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
  *
  * Pulled from:
  *   StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
  */
message BytesTransferByTagAndMetered {
    optional int32 uid = 1 [(is_uid) = true];

    optional bool is_metered = 2;

    optional int32 tag = 3;

    optional int64 rx_bytes = 4;

    optional int64 rx_packets = 5;

    optional int64 tx_bytes = 6;

    optional int64 tx_packets = 7;

    // Radio Access Technology (RAT) type of this record, should be one of
    // TelephonyManager#NETWORK_TYPE_* constants, or
    // NetworkTemplate#NETWORK_TYPE_ALL to indicate the record is for all rat
    // types combined.
    optional int32 rat_type = 8;
}

/**
 * Logs when the Assistant is invoked.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
 */
message AssistantInvocationReported {

    // The event_id (as for UiEventReported).
    optional int32 event_id = 1;

    // The registered Assistant's uid and package (as for UiEventReported).
    optional int32 uid = 2 [(is_uid) = true];
    optional string package_name = 3;

    // An identifier used to disambiguate which logs refer to a particular invocation of the
    // Assistant  (as for UiEventReported).
    optional int32 instance_id = 4;

    // The state of the device at the time of invocation.
    enum DeviceState {
        UNKNOWN_DEVICE_STATE = 0;
        AOD1 = 1;
        AOD2 = 2;
        BOUNCER = 3;
        UNLOCKED_LOCKSCREEN = 4;
        LAUNCHER_HOME = 5;
        LAUNCHER_OVERVIEW = 6;
        LAUNCHER_ALL_APPS = 7;
        APP_DEFAULT = 8;
        APP_IMMERSIVE = 9;
        APP_FULLSCREEN = 10;
    }
    optional DeviceState device_state = 5;

    // Whether the Assistant handles were showing at the time of invocation.
    optional bool assistant_handles_showing = 6;
}

/**
 * Logs when an AudioRecord finishes running on an audio device
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioRecordDeviceUsageReported {
    // The devices connected to this AudioRecord.
    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    // See audio_device_t in system/media/audio/include/system/audio-base.h
    optional string devices = 1;

    // The name of the remote device attached to the device, typically available for USB or BT.
    // This may be empty for a fixed device, or separated by "|" if more than one.
    optional string device_names = 2;

    // The amount of time spent in the device as measured by the active track in AudioFlinger.
    optional int64 device_time_nanos = 3;

    // The audio data format used for encoding.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
    optional string encoding = 4;

    // The client-server buffer framecount.
    // The framecount is generally between 960 - 48000 for PCM encoding.
    // The framecount represents raw buffer size in bytes for non-PCM encoding.
    optional int32 frame_count = 5;

    // The number of audio intervals (contiguous, continuous playbacks).
    optional int32 interval_count = 6;

    // The sample rate of the AudioRecord.
    // A number generally between 8000-96000 (frames per second).
    optional int32 sample_rate = 7;

    // The audio input flags used to construct the AudioRecord.
    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
    optional string flags = 8;

    // The santized package name of the audio client associated with the AudioRecord.
    // See getSanitizedPackageNameAndVersionCode() in
    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
    optional string package_name = 9;

    // The selected device id (nonzero if a non-default device is selected)
    optional int32 selected_device_id = 10;

    // The caller of the AudioRecord.
    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    optional string caller = 11;

    // The audio source for AudioRecord.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
    optional string source = 12;

    // Android S
    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
    // An empty string means no session id is set.
    optional string log_session_id = 13;
}

/**
 * Logs when an AudioThread finishes running on an audio device
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioThreadDeviceUsageReported {
    // The devices connected to this audio thread.
    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
    // (for record threads):
    // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
    // (for playback threads):
    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    // See audio_device_t in system/media/audio/include/system/audio-base.h
    optional string devices = 1;

    // The name of the remote device attached to the device, typically available for USB or BT.
    // This may be empty for a fixed device, or separated by "|" if more than one.
    optional string device_names = 2;

    // The amount of time spent in the device as measured by the active track in AudioFlinger.
    optional int64 device_time_nanos = 3;

    // The audio data format used for encoding.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
    optional string encoding = 4;

    // The framecount of the buffer delivered to (or from) the HAL.
    // The framecount is generally ~960 for PCM encoding.
    // The framecount represents raw buffer size in bytes for non-PCM encoding.
    optional int32 frame_count = 5;

    // The number of audio intervals (contiguous, continuous playbacks).
    optional int32 interval_count = 6;

    // The sample rate of the audio thread.
    // A number generally between 8000-96000 (frames per second).
    optional int32 sample_rate = 7;

    // The audio flags used to construct the thread
    // (for record threads):
    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
    // (for playback threads):
    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
    optional string flags = 8;

    // The number of underruns encountered for a playback thread or the
    // number of overruns encountered for a capture thread.
    optional int32 xruns = 9;

    // The type of thread
    // A thread type enumeration from
    // frameworks/av/mediametrics/services/Translate.h
    optional string type = 10;
}

/**
 * Logs when an AudioTrack finishes running on an audio device
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioTrackDeviceUsageReported {
    // The output devices connected to this AudioTrack.
    // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    // See audio_device_t in system/media/audio/include/system/audio-base.h
    optional string devices = 1;

    // The name of the remote device attached to the device, typically available for USB or BT.
    // This may be empty for a fixed device, or separated by "|" if more than one.
    optional string device_names = 2;

    // The amount of time spent in the device as measured by the active track in AudioFlinger.
    optional int64 device_time_nanos = 3;

    // The audio data format used for encoding.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
    optional string encoding = 4;

    // The client-server buffer framecount.
    // The framecount is generally between 960 - 48000 for PCM encoding.
    // The framecount represents raw buffer size in bytes for non-PCM encoding.
    // A static track (see traits) may have a very large framecount.
    optional int32 frame_count = 5;

    // The number of audio intervals (contiguous, continuous playbacks).
    optional int32 interval_count = 6;

    // The sample rate of the AudioTrack.
    // A number generally between 8000-96000 (frames per second).
    optional int32 sample_rate = 7;

    // The audio flags used to construct the AudioTrack.
    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
    optional string flags = 8;

    // The number of underruns encountered.
    optional int32 xruns = 9;

    // The santized package name of the audio client associated with the AudioTrack.
    // See getSanitizedPackageNameAndVersionCode() in
    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
    optional string package_name = 10;

    // The latency of the last sample in the buffer in milliseconds.
    optional float device_latency_millis = 11;

    // The startup time in milliseconds from start() to sample played.
    optional float device_startup_millis = 12;

    // The average volume of the track on the device [ 0.f - 1.f ]
    optional float device_volume = 13;

    // The selected device id (nonzero if a non-default device is selected)
    optional int32 selected_device_id = 14;

    // The stream_type category for the AudioTrack.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
    optional string stream_type = 15;

    // The usage for the AudioTrack.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
    optional string usage = 16;

    // The content type of the AudioTrack.
    // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
    optional string content_type = 17;

    // The caller of the AudioTrack.
    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    optional string caller = 18;

    // The traits of the AudioTrack.
    // A string OR of different traits, may be empty string.
    // Only "static" is supported for R.
    // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    optional string traits = 19;

    // Android S
    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
    // An empty string means no session id is set.
    optional string log_session_id = 20;
}

/**
 * Logs the status of an audio device connection attempt.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioDeviceConnectionReported {
    // The input devices represented by this report.
    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    // See audio_device_t in system/media/audio/include/system/audio-base.h
    optional string input_devices = 1;

    // The output devices represented by this report.
    // A string OR of various output device categories.
    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
    // See audio_device_t in system/media/audio/include/system/audio-base.h
    optional string output_devices = 2;

    // The name of the remote device attached to the device, typically available for USB or BT.
    // This may be empty for a fixed device, or separated by "|" if more than one.
    optional string device_names = 3;

    // The result of the audio device connection.
    // 0 indicates success: connection verified.
    // 1 indicates unknown: connection not verified or not known if diverted properly.
    // Other values indicate specific status.
    // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
    optional int32 result = 4;

    // Average milliseconds of time to connect
    optional float time_to_connect_millis = 5;

    // Number of connections if aggregated statistics, otherwise 1.
    optional int32 connection_count = 6;
}

/**
 * Logs the status of an AudioRecord operation.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioRecordStatusReported {
    // General status code for categorization of status.
    optional android.media.Status status = 1;

    // Status or error message, e.g. logcat.
    optional string debug_message = 2;

    // Supplemental status subcode for AudioRecord.
    optional int32 status_subcode = 3;

    // Uid associated with the AudioRecord.
    optional int32 uid = 4 [(is_uid) = true];

    // The AudioRecord event.
    optional android.media.audio.AudioRecordEvent event = 5;

    // Requested AudioRecord flags, with each flag bitwise ORed.
    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
    // audio_input_flags_t
    optional int32 input_flags = 6;

    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
    // audio_source_t, representing the input source for the AudioRecord.
    optional android.media.audio.Source source = 7;

    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
    // audio_format_t, representing the encoding of the AudioRecord data.
    optional android.media.audio.Encoding encoding = 8;

    // Channel mask, with each channel position bitwise ORed.
    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
    // audio_channel_mask_t, representing the input channel configuration
    // of AudioRecord data.
    optional int64 channel_mask = 9;

    // The size of the AudioRecord buffer in frames.
    // If an error occurs during creation, this may be a small integer requested size
    // as AudioFlinger is entitled to increase this as required.
    optional int32 buffer_frame_count = 10;

    // Sample rate in Hz.
    optional int32 sample_rate = 11;
}

/**
 * Logs the status of an AudioTrack operation.
 *
 * Logged from:
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAudioTrackStatusReported {
    // General status code for categorization of status.
    optional android.media.Status status = 1;

    // Status or error message, e.g. logcat.
    optional string debug_message = 2;

    // Supplemental status subcode for AudioTrack.
    optional int32 status_subcode = 3;

    // Uid associated with track
    optional int32 uid = 4 [(is_uid) = true];

    // The AudioTrack event.
    optional android.media.audio.AudioTrackEvent event = 5;

    // Requested AudioTrack flags, with each flag bitwise ORed.
    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
    // audio_output_flags_t
    optional int32 output_flags = 6;

    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
    // audio_content_type_t, representing the content type of the AudioTrack.
    optional android.media.audio.ContentType content_type = 7;

    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
    // audio_usage_t, representing the use case for the AudioTrack.
    optional android.media.audio.Usage usage = 8;

    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
    // audio_format_t, representing the encoding of the AudioTrack data.
    optional android.media.audio.Encoding encoding = 9;

    // Channel mask, with each channel position bitwise ORed.
    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
    // audio_channel_mask_t, representing the channel configuration of AudioTrack data.
    optional int64 channel_mask = 10;

    // The size of the AudioTrack buffer in frames.
    // If an error occurs during creation, this may be a small integer requested size
    // as AudioFlinger is entitled to increase this as required.
    optional int32 buffer_frame_count = 11;

    // Sample rate in Hz.
    optional int32 sample_rate = 12;

    // Playback speed, nominal 1.f representing 1x.
    optional float speed = 13;

    // Playback pitch, nominal 1.f representing 1x.
    optional float pitch = 14;
}

/**
 * Logs: i) creation of different types of cryptographic keys in the keystore,
 * ii) operations performed using the keys,
 * iii) attestation of the keys
 * Logged from: system/security/keystore/key_event_log_handler.cpp
 */
message KeystoreKeyEventReported {

    enum Algorithm {
        /** Asymmetric algorithms. */
        RSA = 1;
        // 2 removed, do not reuse.
        EC = 3;
        /** Block cipher algorithms */
        AES = 32;
        TRIPLE_DES = 33;
        /** MAC algorithms */
        HMAC = 128;
    };
    /** Algorithm associated with the key */
    optional Algorithm algorithm = 1;

    /** Size of the key */
    optional int32 key_size = 2;

    enum KeyOrigin {
        /** Generated in keymaster.  Should not exist outside the TEE. */
        GENERATED = 0;
        /** Derived inside keymaster.  Likely exists off-device. */
        DERIVED = 1;
        /** Imported into keymaster.  Existed as cleartext in Android. */
        IMPORTED = 2;
        /** Keymaster did not record origin. */
        UNKNOWN = 3;
        /** Securely imported into Keymaster. */
        SECURELY_IMPORTED = 4;
    };
    /* Logs whether the key was generated, imported, securely imported, or derived.*/
    optional KeyOrigin key_origin = 3;

    enum HardwareAuthenticatorType {
        NONE = 0;
        PASSWORD = 1;
        FINGERPRINT = 2;
        // Additional entries must be powers of 2.
    };
    /**
     * What auth types does this key require? If none,
     * then no auth required.
     */
    optional HardwareAuthenticatorType user_auth_type = 4;

    /**
     * If user authentication is required, is the requirement time based? If it
     * is not time based then this field will not be used and the key is per
     * operation. Per operation keys must be user authenticated on each usage.
     */
    optional int32 user_auth_key_timeout_secs = 5;

    /**
     * padding mode, digest, block_mode and purpose should ideally be repeated
     * fields. However, since statsd does not support repeated fields in
     * pushed atoms, they are represented using bitmaps.
     */

    /** Track which padding mode is being used.*/
    optional int32 padding_mode_bitmap = 6;

    /** Track which digest is being used. */
    optional int32 digest_bitmap = 7;

    /** Track what block mode is being used (for encryption). */
    optional int32 block_mode_bitmap = 8;

    /** Track what purpose is this key serving. */
    optional int32 purpose_bitmap = 9;

    enum EcCurve {
        P_224 = 0;
        P_256 = 1;
        P_384 = 2;
        P_521 = 3;
    };
    /** Which ec curve was selected if elliptic curve cryptography is in use **/
    optional EcCurve ec_curve = 10;

    enum KeyBlobUsageRequirements {
        STANDALONE = 0;
        REQUIRES_FILE_SYSTEM = 1;
    };
    /** Standalone or is a file system required */
    optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;

    enum Type {
        key_operation = 0;
        key_creation = 1;
        key_attestation = 2;
    }
    /** Key creation event, operation event or attestation event? */
    optional Type type = 12;

    /** Was the key creation, operation, or attestation successful? */
    optional bool was_successful = 13;

    /** Response code or error code */
    optional int32 error_code = 14;
}

/**
 * Logs: key creation events with Algorithm, Origin, Error and Attestation info.
 * Logged from: system/security/keystore2/metrics.rs
 */
message Keystore2KeyCreationWithGeneralInfo {

    // Algorithm associated with the key
    optional android.system.security.keystore2.Algorithm algorithm = 1;

    // Size of the key, based on the algorithm used.
    optional int32 key_size = 2;

    enum EcCurve {
        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
        EC_CURVE_UNSPECIFIED = 0;
        P_224 = 1;
        P_256 = 2;
        P_384 = 3;
        P_521 = 4;
        CURVE_25519 = 5;
    };
    // Which ec curve was selected if elliptic curve cryptography is in use
    optional EcCurve ec_curve = 3;

    enum KeyOrigin {
        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
        ORIGIN_UNSPECIFIED = 0;
        // Generated in keymaster.  Should not exist outside the TEE.
        GENERATED = 1;
        // Derived inside keymaster.  Likely exists off-device.
        DERIVED = 2;
        // Imported into keymaster.  Existed as cleartext in Android.
        IMPORTED = 3;
        // Previously used for another purpose that is now obsolete.
        RESERVED = 4;
        // Securely imported into Keymaster.
        SECURELY_IMPORTED = 5;
    };
    // Logs whether the key was generated, imported, securely imported, or derived.
    optional KeyOrigin key_origin = 4;

    /**
     * Response code (system/hardware/interfaces/keystore2/aidl/../ResponseCode.aidl)
     * or
     * error code (hardware/interfaces/security/keymint/aidl/../ErrorCode.aidl)
     */
    optional int32 error_code = 5;

    // Indicates whether key attestation is requested in creation
    optional bool attestation_requested = 6;

    // Count of a particular combination of field values of this atom
    optional int32 count = 7;
}

/**
 * Logs: key creation events with authentication info.
 * Logged from: system/security/keystore2/metrics.rs
 */
message Keystore2KeyCreationWithAuthInfo {

    enum HardwareAuthenticatorType {
        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
        AUTH_TYPE_UNSPECIFIED = 0;
        NONE = 1;
        PASSWORD = 2;
        FINGERPRINT = 3;
        ANY = 5;
    };
    /**
     * What auth types does this key require? If none,
     * then no auth required.
     */
    optional HardwareAuthenticatorType user_auth_type = 1;

    /**
     * If user authentication is required, is the requirement time based? If it
     * is time based then this field indicates the base 10 logarithm of time out in seconds.
     * Logarithm is taken in order to reduce the cardinaltiy.
     */
    optional int32 log_auth_timeout_seconds = 2;

    // Security level of the Keymint instance which creates the key.
    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;

    // Count of a particular combination of field values of this atom
    optional int32 count = 4;
}

/**
 * Logs: key creation events with purpose and modes info.
 * Logged from: system/security/keystore2/metrics.rs
 */
message Keystore2KeyCreationWithPurposeAndModesInfo {
    // Algorithm associated with the key
    optional android.system.security.keystore2.Algorithm algorithm = 1;

	/**
     * Track which purpose is being used.
     * Bitmap composition is given by KeyPurposeBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 purpose_bitmap = 2;

    /**
     * Track which padding mode is being used.
     * Bitmap composition is given by PaddingModeBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 padding_mode_bitmap = 3;

    /**
     * Track which digest is being used.
     * Bitmap composition is given by DigestBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 digest_bitmap = 4;

    /**
     * Track which block mode is being used.
     * Bitmap composition is given by BlockModeBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 block_mode_bitmap = 5;

    // Count of a particular combination of field values of this atom
    optional int32 count = 6;
}

/**
 * Logs the atom id of the atoms associated with key creation/operation events, that have reached
 * the maximum storage limit allocated for different atom objects of that atom,
 * in keystore in-memory store.
 *
 * Size of the storage bucket for each atom is limited considering their expected cardinaltity.
 * This limit may exceed if the dimensions of the atoms take a large number of unexpected
 * combinations. This atom is used to track such cases.
 */
message Keystore2AtomWithOverflow {

    // Atom id as defined in atoms.proto
    optional int32 atom_id = 1;

    // Count of the objects of this atom type that have overflowed.
    optional int32 count = 2;
}

/**
 * Logs: key operations events with purpose and modes info.
 * Logged from: system/security/keystore2/metrics.rs
 */
message Keystore2KeyOperationWithPurposeAndModesInfo {

    enum KeyPurpose {
        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
        KEY_PURPOSE_UNSPECIFIED = 0;

        // Usable with RSA, 3DES and AES keys.
        ENCRYPT = 1;

        // Usable with RSA, 3DES and AES keys.
        DECRYPT = 2;

        // Usable with RSA, EC and HMAC keys.
        SIGN = 3;

        // Usable with RSA, EC and HMAC keys.
        VERIFY = 4;

        // 5 is reserved
        // Usable with RSA keys.
        WRAP_KEY = 6;

        // Key Agreement, usable with EC keys.
        AGREE_KEY = 7;

        // Usable as an attestation signing key.
        ATTEST_KEY = 8;
    }
    // Purpose of the key operation
    optional KeyPurpose purpose = 1;

    /**
     * Track which padding mode is being used.
     * Bitmap composition is given by PaddingModeBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 padding_mode_bitmap = 2;

    /**
     * Track which digest is being used.
     * Bitmap composition is given by DigestBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 digest_bitmap = 3;

    /**
     * Track which block mode is being used.
     * Bitmap composition is given by BlockModeBitPosition enum
     * defined in system/security/keystore2/metrics.rs.
     */
    optional int32 block_mode_bitmap = 4;

    // Count of a particular combination of field values of this atom
    optional int32 count = 5;
}

/**
 * Logs key operations events with outcome, error_code, security level and whether the key is
 * upgraded during the operation.
 * Logged from: system/security/keystore2/metrics.rs
 */
message Keystore2KeyOperationWithGeneralInfo {

    enum Outcome {
        OUTCOME_UNSPECIFIED = 0;
        DROPPED = 1;
        SUCCESS = 2;
        ABORT = 3;
        PRUNED = 4;
        ERROR = 5;
    }
    // Outcome of the operation
    optional Outcome outcome = 1;

    // Response code or error code in case of error outcome
    optional int32 error_code = 2;

    // Indicates whether the key was upgraded during the operation
    optional bool key_upgraded = 3;

    // Security level of the Keymint instance which performs the operation.
    optional android.system.security.keystore2.SecurityLevelEnum security_level = 4;

    // Count of a particular combination of field values of this atom
    optional int32 count = 5;
}

/**
 * Logs: Keystore 2 storage statistics.
 * Logged from: system/security/keystore2
 */
message Keystore2StorageStats {
    enum Storage {
       STORAGE_UNSPECIFIED = 0;
       KEY_ENTRY = 1;
       KEY_ENTRY_ID_INDEX = 2;
       KEY_ENTRY_DOMAIN_NAMESPACE_INDEX = 3;
       BLOB_ENTRY = 4;
       BLOB_ENTRY_KEY_ENTRY_ID_INDEX = 5;
       KEY_PARAMETER = 6;
       KEY_PARAMETER_KEY_ENTRY_ID_INDEX = 7;
       KEY_METADATA = 8;
       KEY_METADATA_KEY_ENTRY_ID_INDEX = 9;
       GRANT = 10;
       AUTH_TOKEN = 11;
       BLOB_METADATA = 12;
       BLOB_METADATA_BLOB_ENTRY_ID_INDEX =13;
       METADATA = 14;
       DATABASE = 15;
       LEGACY_STORAGE = 16;
    }
    // Type of the storage (database table or legacy storage) of which the size is reported.
    optional Storage storage_type = 1;
    // Storage size in bytes
    optional int64 size = 2;
    // Unused space, in bytes. The total storage size may be larger, indicating
    // inefficiencies in the packing of data in the database.
    optional int64 unused_size = 3;
}

/**
 * Logs Remote Key Provisioning (RKP) related error events.
 * Logged from: system/security/keystore2
 */
message RkpErrorStats {

    enum RkpError {
        RKP_ERROR_UNSPECIFIED = 0;
        // The key pool is out of keys.
        OUT_OF_KEYS = 1;
        // Falling back to factory provisioned keys during hybrid mode.
        FALL_BACK_DURING_HYBRID = 2;
    }
    // Type of the error event
    optional RkpError rkp_error = 1;

    // Count of a particular error occurred.
    optional int32 count = 2;

    /**
     * Security level of the IRemotelyProvisionedComponent.
     */
    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
}


/**
 * Deprecated in U. Use RkpdPoolStats instead.
 *
 * Logs: Status of the attestation key pool related to
 * Remote Key Provisioning (RKP).
 * Logged from: system/security/keystore2
 */
message RkpPoolStats {
    /**
     * Security level of the Keymint instance associated with the
     * attestation pool status.
     */
    optional android.system.security.keystore2.SecurityLevelEnum security_level = 1;

    /**
     * The number of signed attestation certificate chains which are
     * expired.
     */
    optional int32 expiring = 2;

    /**
     * The number of signed attestation certificate chains which have
     * not yet been assigned to an app.
     */
    optional int32 unassigned = 3;

    /**
     * The number of signed attestation keys.
     */
    optional int32 attested = 4;

    /**
     * The total number of attestation keys.
     */
    optional int32 total = 5;
}

/**
 * Logs: Number of keystore2 crashes per-boot cycle.
 * Logged from: system/security/keystore2
 */
message Keystore2CrashStats {
    optional int32 count_of_crash_events = 1;
}

// Blob Committer stats
// Keep in sync between:
//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
//     frameworks/base/cmds/statsd/src/atoms.proto
message BlobCommitterProto {
    // Committer app's uid
    optional int32 uid = 1 [(is_uid) = true];

    // Unix epoch timestamp of the commit in milliseconds
    optional int64 commit_timestamp_millis = 2;

    // Flags of what access types the committer has set for the Blob
    optional int32 access_mode = 3;

    // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
    optional int32 num_whitelisted_package = 4;
}

// Blob Leasee stats
// Keep in sync between:
//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
//     frameworks/base/cmds/statsd/src/atoms.proto
message BlobLeaseeProto {
    // Leasee app's uid
    optional int32 uid = 1 [(is_uid) = true];

    // Unix epoch timestamp for lease expiration in milliseconds
    optional int64 lease_expiry_timestamp_millis = 2;
}

// List of Blob Committers
// Keep in sync between:
//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
//     frameworks/base/cmds/statsd/src/atoms.proto
message BlobCommitterListProto {
    repeated BlobCommitterProto committer = 1;
}

// List of Blob Leasees
// Keep in sync between:
//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
//     frameworks/base/cmds/statsd/src/atoms.proto
message BlobLeaseeListProto {
    repeated BlobLeaseeProto leasee = 1;
}

/**
 * Logs the current state of a Blob committed with BlobStoreManager
 *
 * Pulled from:
 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
 */
message BlobInfo {
    // Id of the Blob
    optional int64 blob_id = 1;

    // Size of the Blob data
    optional int64 size = 2;

    // Unix epoch timestamp of the Blob's expiration in milliseconds
    optional int64 expiry_timestamp_millis = 3;

    // List of committers of this Blob
    optional BlobCommitterListProto committers = 4 [(log_mode) = MODE_BYTES];

    // List of leasees of this Blob
    optional BlobLeaseeListProto leasees = 5 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when the HDMI CEC active source changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
 */
message HdmiCecActiveSourceChanged {
    // The logical address of the active source.
    optional android.stats.hdmi.LogicalAddress active_source_logical_address = 1;

    // The physical address of the active source. Consists of four hexadecimal nibbles.
    // Examples: 0x1234, 0x0000 (root device). 0xFFFF represents an unknown or invalid address.
    // See section 8.7 in the HDMI 1.4b spec for details.
    optional int32 active_source_physical_address = 2;

    // The relationship between this device and the active source.
    optional android.stats.hdmi.PathRelationship local_relationship = 3;
}

/**
 * Logs when an HDMI CEC message is sent or received.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
 */
message HdmiCecMessageReported {
    // The calling uid of the application that caused this atom to be written.
    optional int32 uid = 1 [(is_uid) = true];

    // Whether a HDMI CEC message is sent from this device, to this device, or neither.
    optional android.stats.hdmi.MessageDirection direction = 2;

    // The HDMI CEC logical address of the initiator.
    optional android.stats.hdmi.LogicalAddress initiator_logical_address = 3;

    // The HDMI CEC logical address of the destination.
    optional android.stats.hdmi.LogicalAddress destination_logical_address = 4;

    // The opcode of the message. Ranges from 0x00 to 0xFF.
    // For all values, see section "CEC 15 Message Descriptions" in the HDMI CEC 1.4b spec.
    optional int32 opcode = 5;

    // The result of attempting to send the message on its final retransmission attempt.
    // Only applicable to outgoing messages; set to SEND_MESSAGE_RESULT_UNKNOWN otherwise.
    optional android.stats.hdmi.SendMessageResult send_message_result = 6;

    // Fields specific to <User Control Pressed> messages

    // The user control command that was received.
    optional android.stats.hdmi.UserControlPressedCommand user_control_pressed_command = 7;

    // Fields specific to <Feature Abort> messages

    // The opcode of the message that was feature aborted.
    // Set to 0x100 when unknown or not applicable.
    optional int32 feature_abort_opcode = 8;

    // The reason for the feature abort.
    optional android.stats.hdmi.FeatureAbortReason feature_abort_reason = 9;
}

/**
 * Logs when an auto rotate event occurs while smart auto rotate is enabled.
 */
message AutoRotateReported {
    enum Orientation {
        UNKNOWN = 0;
        DEPRECATED = 1;
        ROTATION_0 = 2;
        ROTATION_90 = 3;
        ROTATION_180 = 4;
        ROTATION_270 = 5;
        DISABLED = 6;
        UNAVAILABLE = 7;
        FAILURE = 8;
    }

    // Orientation of the device when a rotation was detected.
    optional Orientation current_orientation = 1;
    // The orientation of the phone after rotation before going through the recommendation service.
    optional Orientation proposed_orientation = 2;
    // Orientation recommended by the smart autorotate service component outside of the platform. It
    // may or may not match the proposed_orientation. Can be disabled or unavailable if the
    // recommendation service is disabled or unavailable. Will be unknown if the service failed.
    optional Orientation recommended_orientation = 3;
    // Time taken to calculate the rotation recommendation.
    optional int64 recommendation_process_duration_millis = 4;
}

/**
 * Logs when sensors only autorotate is triggered. Associated event can be a rotation preindication,
 * actual event or a "data ready to be pulled" indication. More info: go/autorotate-logging.
 *
 * Logged from:
 *    platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
 */

message DeviceRotated {
  // Timestamp of the event in millis. We log the timestamp explicitly since
  // data logging will follow the event logging and all these
  // will be joined with other logs such as rotation button clicked.
  optional int64 timestamp_millis = 1;
  // Device orientation
  optional android.stats.wm.Orientation proposed_orientation = 2;

  enum RotationEventType{
    UNKNOWN = 0;
    // An early indication of device might be rotated.
    PREINDICATION = 1;
    // Device rotation is detected.
    ACTUAL_EVENT = 2;
    // Device rotated and the data associated with it is ready to be pulled.
    // This happens after the ACTUAL_EVENT since some data after the event is
    // also useful.
    DATA_READY = 3;
  }
  optional RotationEventType rotation_event_type = 3;
}

/**
 * Records the raw sensor data published by the device orientation debug sensor. The pull will be
 * configured to be conditioned on the {@code DeviceRotated} atom.
 *
 * Logged from:
 *     platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
 */
message DeviceRotatedData {
  // All the sensor data and timestamps used to calculate the orientation
  optional DeviceRotatedSensorData snapshot = 1 [(log_mode) = MODE_BYTES];
  // Resulting orientation
  optional android.stats.wm.Orientation proposed_orientation = 2;
}

message DeviceRotatedSensorData {
  optional DeviceRotatedSensorHeader header = 1 [(log_mode) = MODE_BYTES];
  repeated DeviceRotatedSensorSample sample = 2 [(log_mode) = MODE_BYTES];
}

message DeviceRotatedSensorHeader {
  optional int64 timestamp_base_millis = 1;
}

message DeviceRotatedSensorSample{
  optional int32 timestamp_offset_millis = 1;
  enum SensorType {
    UNKNOWN = 0;
    ACCEL = 1;
    GYRO = 2;
  }
  optional SensorType sensor_type = 2;
  optional float x_value = 3;
  optional float y_value = 4;
  optional float z_value = 5;
}

/**
  * Pushes TLS handshake counters from Conscrypt.
  * Pulled from:
  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptEngineSocket.java
  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java
  */
message TlsHandshakeReported {
    optional bool success = 1;

    optional android.stats.tls.Protocol protocol = 2;

    optional android.stats.tls.CipherSuite cipher_suite = 3;

    optional int32 handshake_duration_millis = 4;

    optional android.stats.tls.Source source = 5;

    repeated int32 uid = 6 [(is_uid) = true];
}

/**
 * Logs when a TextClassifier API is invoked.
 *
 * See frameworks/base/core/java/android/view/textclassifier/TextClassifier.java
 * Logged from: external/libtextclassifier/java/
 */
message TextClassifierApiUsageReported {
    enum ApiType {
        UNKNOWN_API = 0;
        SUGGEST_SELECTION = 1;
        CLASSIFY_TEXT = 2;
        GENERATE_LINKS = 3;
        DETECT_LANGUAGES = 4;
        SUGGEST_CONVERSATION_ACTIONS = 5;
    }
    optional ApiType api_type = 1;

    enum ResultType {
        UNKNOWN_RESULT = 0;
        SUCCESS = 1;
        FAIL = 2;
    }
    optional ResultType result_type = 2;
    optional int64 latency_millis = 3;
    optional string session_id = 4;
}

/**
 * Logs when TextClassifier Model Downloader finishes a download task.
 *
 * Currently we create a downlaod task for each new manifest to download.
 *
 * Logged from: external/libtextclassifier/java/
 */
message TextClassifierDownloadReported {
    // The model type to download
    enum ModelType {
        UNKNOWN_MODEL_TYPE = 0;
        ANNOTATOR = 1;
        LANG_ID = 2;
        ACTIONS_SUGGESTIONS = 3;
    }
    optional ModelType model_type = 1;
    // The file type to download
    enum FileType {
        UNKNOWN_FILE_TYPE = 0;
        MANIFEST = 1;
        MODEL = 2;
    }
    // Deprecated: now manifest and model files are downloaded together.
    optional FileType file_type = 2;
    // The status of the download
    enum DownloadStatus {
        UNKNOWN_STATUS = 0;
        SCHEDULED = 1;
        SUCCEEDED = 2;
        FAILED_AND_RETRY = 3;
        FAILED_AND_ABORT = 4;
    }
    optional DownloadStatus download_status = 3;
    // The public GStatic url we used to download the model. Contains locale info.
    optional string url_suffix = 4;
    // Failure reason, only set if this is for a failure status
    enum FailureReason {
        reserved 1, 8, 9;

        UNKNOWN_FAILURE_REASON = 0;
        FAILED_TO_DOWNLOAD_SERVICE_CONN_BROKEN = 2;
        FAILED_TO_DOWNLOAD_404_ERROR = 3;
        FAILED_TO_DOWNLOAD_OTHER = 4;
        DOWNLOADED_FILE_MISSING = 5;
        FAILED_TO_PARSE_MANIFEST = 6;
        FAILED_TO_VALIDATE_MODEL = 7;
    }
    optional FailureReason failure_reason = 5;
    // How many attempts we have tried for the same task at a terminal status (i.e. SUCCEEDED or
    // FAILED_AND_ABORT).
    optional int32 run_attempt_count = 6;

    // Custom failure code for downloader lib internal failures (E.g. 404 error).
    optional int32 downloader_lib_failure_code = 7;

    // Time elapsed for the whole download task
    optional int64 download_duration_millis = 8;

    // The id of the WorkManager work that launched this download.
    optional int64 work_id = 9;
}

/**
 * Logs when TextClassifier Model Downloader schedules a WorkManager work.
 *
 * Logged from: external/libtextclassifier/java/
 */
message TextClassifierDownloadWorkScheduled {
    optional int64 work_id = 1;

    enum ReasonToSchedule {
        UNKNOWN_REASON_TO_SCHEDULE = 0;
        TCS_STARTED = 1;
        LOCALE_SETTINGS_CHANGED = 2;
        DEVICE_CONFIG_UPDATED = 3;
    }
    optional ReasonToSchedule reason_to_schedule = 2;

    optional bool failed_to_schedule = 3;
}

/**
 * Logs when TextClassifier Model Downloader finishes a WorkManager work.
 *
 * A WorkManager work includes one or more downlad tasks. We log this atom when
 * all tasks finished. The work_id can be used to join work log and task logs.
 *
 * Logged from: external/libtextclassifier/java/
 */
message TextClassifierDownloadWorkCompleted {
    optional int64 work_id = 1;

    enum WorkResult {
        UNKNOWN_WORK_RESULT = 0;
        SUCCESS_MODEL_DOWNLOADED = 1;
        SUCCESS_NO_UPDATE_AVAILABLE = 2;
        FAILURE_MODEL_DOWNLOADER_DISABLED = 3;
        FAILURE_MAX_RUN_ATTEMPT_REACHED = 4;
        RETRY_MODEL_DOWNLOAD_FAILED = 5;
        RETRY_RUNTIME_EXCEPTION = 6;
        RETRY_STOPPED_BY_OS = 7;
    }
    optional WorkResult work_result = 2;

    // How many attempts we have tried for this work.
    optional int32 run_attempt_count = 3;

    optional int64 work_scheduled_to_started_duration_millis = 4;
    optional int64 work_started_to_ended_duration_millis = 5;
}

/**
 * Logs telemetry for Android Virtualization framework
 *
 * On CreateVM requests, an atom is pushed that records what hypervisor is being used.
 * the protected status of the new VM, and if the VM creation succeeded
 * Logged from: packages/modules/Virtualization/
 */
message VmCreationRequested {
    enum Hypervisor {
        UNKNOWN = 0;
        PKVM = 1;
        OTHER = 2;
    }

    enum ConfigType {
        UNKNOWN_CONFIG = 0;
        VIRTUAL_MACHINE_APP_CONFIG = 1;
        VIRTUAL_MACHINE_RAW_CONFIG = 2;
    }

    optional Hypervisor hypervisor = 1;
    // Is the VM started in protected mode?
    optional bool is_protected = 2;
    // Did the VM creation succeed
    optional bool creation_succeeded = 3;
    // Binder exception Code thrown by createVm request
    optional int32 binder_exception_code = 4;

    optional int32 uid = 5 [(is_uid) = true];
    optional string vm_identifier = 6;

    optional ConfigType config_type = 7;
    optional int32 num_cpus = 8;
    optional string cpu_affinity = 9 [deprecated = true];
    optional int32 memory_mib = 10;
    optional string apexes = 11;

    // TODO(seungjaeyoo) Fill information about task_profile
    // TODO(seungjaeyoo) Fill information about disk_image for raw config

}

/**
 * Logs telemetry for Android Virtualization framework
 *
 * When VM is booted successfully, an atom is pushed that records information about VM.
 * Logged from: packages/modules/Virtualization/
 */
message VmBooted {
    optional int32 uid = 1 [(is_uid) = true];
    optional string vm_identifier = 2;
    // Elapsed time between start and boot completion of a VM
    optional int64 elapsed_time_millis = 3;
}

/**
 * Logs telemetry for Android Virtualization framework
 *
 * When VM is exited, an atom is pushed that records information about VM.
 * Logged from: packages/modules/Virtualization/
 */
message VmExited {
    enum DeathReason {
        UNKNOWN = 0;
        INFRASTRUCTURE_ERROR = 1;
        KILLED = 2;
        SHUTDOWN = 3;
        ERROR = 4;
        REBOOT = 5;
        CRASH = 6;
        PVM_FIRMWARE_PUBLIC_KEY_MISMATCH = 7;
        PVM_FIRMWARE_INSTANCE_IMAGE_CHANGED = 8;
        BOOTLOADER_PUBLIC_KEY_MISMATCH = 9;
        BOOTLOADER_INSTANCE_IMAGE_CHANGED = 10;
        MICRODROID_FAILED_TO_CONNECT_TO_VIRTUALIZATION_SERVICE = 11;
        MICRODROID_PAYLOAD_HAS_CHANGED = 12;
        MICRODROID_PAYLOAD_VERIFICATION_FAILED = 13;
        MICRODROID_INVALID_PAYLOAD_CONFIG = 14;
        MICRODROID_UNKNOWN_RUNTIME_ERROR = 15;
        HANGUP = 16;
    }
    optional int32 uid = 1 [(is_uid) = true];
    optional string vm_identifier = 2;

    optional DeathReason death_reason = 3;
    // Exit signal when VM was KILLED
    optional int32 exit_signal = 8;

    // Elapsed time between start and termination of a VM
    optional int64 elapsed_time_millis = 4;

    // Guest time for CPU usage
    optional int64 guest_time_millis = 5;

    // RSS for memory usage
    optional int64 rss_vm_kb = 6;
    optional int64 rss_crosvm_kb = 7;
}

/**
 * (Deprecated)
 * Logs telemetry for Android Virtualization framework
 *
 * For every second while VM is running, an atom is pushed that records CPU time information of VM.
 * Logged from: packages/modules/Virtualization/
 */
message VmCpuStatusReported {
    option deprecated = true;

    optional int32 uid = 1 [(is_uid) = true];
    optional string vm_identifier = 2;

    optional int64 cpu_time_user_millis = 3;
    optional int64 cpu_time_nice_millis = 4;
    optional int64 cpu_time_sys_millis = 5;
    optional int64 cpu_time_idle_millis = 6;
}

/**
 * (Deprecated)
 * Logs telemetry for Android Virtualization framework
 *
 * For every second while VM is running, an atom is pushed that records memory information of VM.
 * Logged from: packages/modules/Virtualization/
 */
message VmMemStatusReported {
    option deprecated = true;

    optional int32 uid = 1 [(is_uid) = true];
    optional string vm_identifier = 2;

    optional int64 mem_total_kb = 3;
    optional int64 mem_free_kb = 4;
    optional int64 mem_available_kb = 5;
    optional int64 mem_buffer_kb = 6;
    optional int64 mem_cached_kb = 7;
}

/**
 * Logs telemetry for Early boot CompOsArtifacts checks (done by odsign)
 *
 * odsign is a binary that runs during early boot. One of its responsibility is
 * to check if the device can use compOS and check if so, validate the compos
 * generated artifacts. An atom is pushed on each such check. Note: We only
 * push an atom from devices/configurations that can use compOs.
 */
message EarlyBootCompOsArtifactsCheckReported {
  // Are the current Artifacts okay (This check is done by odrefresh).
  // (current_artifacts_ok == true) => compilationRequired is false
  optional bool current_artifacts_ok = 1;
  // Has CompOs generated any Artifacts
  optional bool comp_os_pending_artifacts_exists = 2;
  // The device will be using CompOs generated artifacts. Note: the value of
  // this is meaningless if current_artifacts_ok = true
  optional bool use_comp_os_generated_artifacts = 3;
}

/**
 * Logs telemetry when Isolation compilation job is scheduled.
 *
 * The atoms are sent by IsolatedCompilationService (fragment of system_server)
 * when apex are staged and need compilation.
 */
message IsolatedCompilationScheduled {
    enum Result {
        SCHEDULING_RESULT_UNKNOWN = 0;
        SCHEDULING_FAILURE = 1;
        SCHEDULING_SUCCESS = 2;
    }
    optional Result scheduling_result = 1;
}

/**
 * Logs telemetry Isolation compilation completion.
 *
 * The atoms is sent by IsolatedCompilationService by compilation ends
 * and contain results/timings of compilation
 */
message IsolatedCompilationEnded {
    enum Result {
        RESULT_UNKNOWN = 0;
        RESULT_SUCCESS = 1;
        RESULT_UNKNOWN_FAILURE = 2;
        RESULT_FAILED_TO_START = 3;
        RESULT_JOB_CANCELED = 4;
        RESULT_COMPILATION_FAILED = 5;
        RESULT_UNEXPECTED_COMPILATION_RESULT = 6;
        RESULT_COMPOSD_DIED = 7;
        RESULT_FAILED_TO_ENABLE_FSVERITY = 8;
    }
    // Time between compilation job starts to when it ends.
    // Note: this does not include the time between compilation job being scheduled (or when apex is staged)
    // and it actually starting
    optional int64 compilation_time_millis = 1;
    // Result of compilation
    optional Result compilation_result = 2;
    // In case the job scheduler cancels the job, this will be the reason code
    // Codes are used from https://source.corp.google.com/android/frameworks/base/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
    // Note: this field only makes sense when compilation_result = RESULT_JOB_CANCELED
    optional int32 compilation_job_stop_reason = 3;
}

/**
 * Logs the current state of an application/process before it is killed.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pushed from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogKillStatsReported {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // State of the uid when it was killed.
    enum UidState {
        UNKNOWN_UID_STATE = 0;
        BACKGROUND_MODE = 1;
        FOREGROUND_MODE = 2;
    }
    optional UidState uid_state = 2;

    // System state indicating whether the system was in normal mode or garage mode.
    enum SystemState {
        UNKNOWN_SYSTEM_STATE = 0;
        USER_INTERACTION_MODE = 1;
        USER_NO_INTERACTION_MODE = 2;
        GARAGE_MODE = 3;
    }
    optional SystemState system_state = 3;

    // Reason for killing the application.
    // Keep in sync with proto file at packages/services/Car/cpp/watchdog/proto
    enum KillReason {
        UNKNOWN_KILL_REASON = 0;
        KILLED_ON_ANR = 1;
        KILLED_ON_IO_OVERUSE = 2;
        KILLED_ON_MEMORY_OVERUSE = 3;
    }
    optional KillReason kill_reason = 4;

    // Stats of the processes owned by the application when the application was killed.
    // The process stack traces are not collected when the application was killed due to IO_OVERUSE.
    optional CarWatchdogProcessStats process_stats = 5 [(log_mode) = MODE_BYTES];

    // The application's I/O overuse stats logged only when the kill reason is KILLED_ON_IO_OVERUSE.
    optional CarWatchdogIoOveruseStats io_overuse_stats = 6 [(log_mode) = MODE_BYTES];
}

/**
 * Logs the I/O overuse stats for an application on detecting I/O overuse.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pushed from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogIoOveruseStatsReported {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // The application's I/O overuse stats.
    optional CarWatchdogIoOveruseStats io_overuse_stats = 2 [(log_mode) = MODE_BYTES];
}

/**
 * Logs I/O overuse stats for a package.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Logged from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogIoOveruseStats {
    enum Period {
        UNKNOWN_PERIOD = 0;
        DAILY = 1;
        WEEKLY = 2;
    }

    // Threshold and usage stats period.
    optional Period period = 1;

    // Threshold in-terms of write bytes defined for the package.
    optional CarWatchdogPerStateBytes threshold = 2;

    // Number of write bytes in each state for the specified period.
    optional CarWatchdogPerStateBytes written_bytes = 3;

    // Application or service uptime during the aforementioned period.
    optional uint64 uptime_millis = 4;
};

/**
 * Logs bytes attributed to each application and system states.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Logged from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogPerStateBytes {
    // Number of bytes attributed to the application foreground.
    optional int64 foreground_bytes = 1;

    // Number of bytes attributed to the application background.
    optional int64 background_bytes = 2;

    // Number of bytes attributed to the garage mode.
    optional int64 garage_mode_bytes = 3;
}

/**
 * Logs each CarWatchdogProcessStat in CarWatchdogProcessStats.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Logged from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogProcessStats {
    // Records the stats of the processes owned by an application.
    repeated CarWatchdogProcessStat process_stat = 1;
}

/**
 * Logs a process's stats.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Logged from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogProcessStat {
    // Command name of the process.
    optional string process_name = 1;

    // Process uptime.
    optional uint64 uptime_millis = 2;

    // Number of major page faults caused by the process and its children.
    optional uint64 major_page_faults = 3;

    // Peak virtual memory size in kb.
    optional uint64 vm_peak_kb = 4;

    // Virtual memory size in kb.
    optional uint64 vm_size_kb = 5;

    // Peak resident set size (high water mark) in kb.
    optional uint64 vm_hwm_kb = 6;

    // Resident set size in kb.
    optional uint64 vm_rss_kb = 7;
}

/**
 * Logs total I/O usage summary for all applications and services running in the system.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pulled from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogSystemIoUsageSummary {
    // I/O usage summary for the system.
    optional CarWatchdogIoUsageSummary io_usage_summary = 1 [(log_mode) = MODE_BYTES];

    // Start time of the event in milliseconds since epoch.
    // Note: This field must be a top-level field as it is used to slice the metrics.
    optional int64 start_time_millis = 2;
}

/**
 * Logs I/O usage summary for an UID.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pulled from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogUidIoUsageSummary {
    // UID of the application/service whose usage summary are recorded.
    optional int32 uid = 1 [(is_uid) = true];

    // I/O usage summary for the UID.
    optional CarWatchdogIoUsageSummary io_usage_summary = 2 [(log_mode) = MODE_BYTES];

    // Start time of the event in milliseconds since epoch.
    // Note: This field must be a top-level field as it is used to slice the metrics.
    optional int64 start_time_millis = 3;
}

/**
 * Logs I/O usage summary for a time period.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pulled from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogIoUsageSummary {
    // Summary event time period.
    optional CarWatchdogEventTimePeriod event_time_period = 1;

    // Daily I/O usage summary for the period. Logs summary entries only for days with I/O usage.
    // The entries are ordered beginning from the event_time_period.start_time_millis.
    repeated CarWatchdogDailyIoUsageSummary daily_io_usage_summary = 2;
}

/**
 * Logs a car watchdog event's time period.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pulled from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogEventTimePeriod {
    enum Period {
        UNKNOWN_PERIOD = 0;
        WEEKLY = 1;
        BIWEEKLY = 2;
        MONTHLY = 3;
    }

    // Deprecated field - Start time of the event in milliseconds since epoch.
    optional uint64 start_time_millis = 1 [deprecated = true];

    // Period for the event.
    optional Period period = 2;
}

/**
 * Logs daily I/O usage summary.
 *
 * Keep in sync with proto file at
 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
 *
 * Pulled from:
 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
 */
message CarWatchdogDailyIoUsageSummary {
    // Total bytes written to disk during a day.
    optional CarWatchdogPerStateBytes written_bytes = 1;

    // Total uptime for the system or service or application during a day.
    optional uint64 uptime_millis = 2;

    // Total disk I/O overuses during a day.
    optional int32 overuse_count = 3;
}

/*
 * pushes Media playback information.
 * Logged from
 *  frameworks/base/services/core/java/com/android/server/media/metrics/
 *      MediaMetricsManagerService.java
 */
message MediametricsPlaybackReported {
    optional int32 uid = 1 [(is_uid) = true];

    // Randomly generated log session ID. A Base64 encoded hex string representing a
    // 128-bit integer.
    optional string log_session_id = 2;
    // The total length of the media in milliseconds. 0 for live contents.
    optional int64 media_duration_millis = 3;
    // Network, device, or mixed.
    optional android.stats.mediametrics.StreamSourceType stream_source = 4;
    // Stream type. DASH, HLS, etc
    optional android.stats.mediametrics.StreamType stream_type = 5;
    // Live, VOD, others
    optional android.stats.mediametrics.PlaybackType playback_type = 6;
    // DRM type
    optional android.stats.mediametrics.DrmType drm_type = 7;
    // Main, AD, others
    optional android.stats.mediametrics.ContentType content_type = 8;
    // Player name. E.g. ExoPlayer
    optional string player_name = 9;
    // Player version. E.g. 1.10.3e
    optional string player_version = 10;
    // Player related experiment IDs
    optional Experiments experiment_ids = 11 [(log_mode) = MODE_BYTES];
    // Number of frames played. Dropped frames included. -1 means unknown.
    optional int32 video_frames_played = 12;
    // Number of frames dropped. -1 means unknown.
    optional int32 video_frames_dropped = 13;
    // Number of audio underruns. -1 means unknown.
    optional int32 audio_underrun_count = 14;
    // Total number of bytes read from the network
    optional int64 network_bytes_read = 15;
    // Total number of bytes read from on-device sources
    optional int64 local_bytes_read = 16;
    // Total transfer spent reading from the network in ms.
    // For parallel requests, the overlapping time intervals are counted only once.
    optional int64 network_transfer_duration_millis = 17;
    // A session ID generated from DRM to distinguish different DRM sessions.
    optional string drm_session_id = 18;
}

message MediaNetworkInfoChanged {
    // Randomly generated log session ID. A Base64 encoded hex string representing a
    // 128-bit integer.
    optional string log_session_id = 1;
    //  New network type
    optional android.stats.mediametrics.NetworkType type = 2;
    // When the network info change occurred relative to playback creation
    // time in milliseconds.
    // It is in absolute time (e.g. always ticks even if the playback is paused).
    optional int64 time_since_playback_created_millis = 3;
}

message MediaPlaybackStateChanged {
    // Randomly generated log session ID. A Base64 encoded hex string representing a
    // 128-bit integer.
    optional string log_session_id = 1;
    //  New playback state
    optional android.stats.mediametrics.PlaybackState playback_state = 2;
    // When the state change occurred relative to playback creation time in
    // milliseconds.
    // It is in absolute time (e.g. always ticks even if the playback is paused).
    optional int64 time_since_playback_created_millis = 3;
}

message MediaPlaybackErrorReported {
    // Randomly generated log session ID. A Base64 encoded hex string representing a
    // 128-bit integer.
    optional string log_session_id = 1;
    //  A shortened call stack of the error
    optional string exception_stack = 2;
    //  Error code
    optional android.stats.mediametrics.PlaybackErrorCode error_code = 3;
    //  Sub-code of error type specified by the error code.
    optional int32 sub_error_code = 4;
    // When the error occurred relative to playback creation time in millisecond.
    // It is in absolute time (e.g. always ticks even if the playback is paused).
    optional int64 time_since_playback_created_millis = 5;
}

message MediaPlaybackTrackChanged {
    // Randomly generated log session ID. A Base64 encoded hex string representing a
    // 128-bit integer.
    optional string log_session_id = 1;
    //  The track is on or off after the change
    optional android.stats.mediametrics.TrackState state = 2;
    //  The reason of the track change
    optional android.stats.mediametrics.TrackChangeReason reason = 3;
    //  The MIME type of the container. E.g. video/mp4
    optional string container_mime_type = 4;
    //  The sample MIME type of the track. E.g. video/avc
    optional string sample_mime_type = 5;

    //  Codec name
    optional string codec_name = 6;
    //  Bits per second. 0 means unknown.
    optional int32 bitrate = 7;

   // When the track change occurred, relative to playback creation time in
   // millisecond.
   // It is in absolute time (e.g. always ticks even if the playback is paused).
   optional int64 time_since_playback_created_millis = 8;

    //  Track type. Audio, Video, Text
    optional android.stats.mediametrics.TrackType type = 9;
    //  2-letter ISO 639-1 language code.
    optional string language = 10;
    //  IETF BCP 47 optional language region subtag based on a two-letter country code
    optional string language_region = 11;
    //  Number of channels
    optional int32 channel_count = 12;
    //  Samples per second
    optional int32 sample_rate = 13;
    //  The width of the video in pixels.
    optional int32 width = 14;
    //  The height of the video in pixels.
    optional int32 height = 15;
    //  Video frame rate in frames per second.
    optional float video_frame_rate = 16;
}

message Experiments {
    // Experiment IDs sent by the player.
    repeated int64 experiments = 1;
}

/**
 * Logs when a Wifi network scan happens.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
 */
message WifiScanReported {
    enum Type {
        TYPE_UNKNOWN = 0;

        // Single scan.
        TYPE_SINGLE = 1;

        // Background scan (deprecated, should not happen).
        TYPE_BACKGROUND = 2;
    }

    enum Result {
        RESULT_UNKNOWN = 0;

        // Failed to start scan.
        RESULT_FAILED_TO_START = 1;

        // The HAL reported a scan failure after the scan was started.
        RESULT_FAILED_TO_SCAN = 2;

        // Scan succeeded.
        RESULT_SUCCESS = 3;
    }

    enum Source {
        SOURCE_UNKNOWN = 0;

        // No work source set - not possible to determine the origin.
        SOURCE_NO_WORK_SOURCE = 1;

        // The Wifi stack.
        SOURCE_WIFI_STACK = 2;

        // GMS on behalf of some other app.
        SOURCE_GMS = 3;

        // Settings app.
        SOURCE_SETTINGS_APP = 4;

        // Other app directly.
        SOURCE_OTHER_APP = 5;
    }

    enum Importance {
        IMPORTANCE_UNKNOWN = 0;

        // Foreground app. Corresponds to the value of
        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND or less.
        IMPORTANCE_FOREGROUND = 1;

        // Foreground service. Corresponds to the value of
        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE
        IMPORTANCE_FOREGROUND_SERVICE = 2;

        // Everything else.
        IMPORTANCE_BACKGROUND = 3;
    }

    // Scan type
    optional Type type = 1;

    // Outcome: success/failure
    optional Result result = 2;

    // What initiated a scan.
    optional Source source = 3;

    // Process importance of the initiator.
    // This is only available for non-system calls.
    optional Importance importance = 4;

    // Time taken for the scan.
    optional int32 scan_duration_millis = 5;

    // Count of found networks.
    optional int32 count_networks_found = 6;
}

/**
 * Logs when a Wifi PNO (Preferred Network Offload) scan happens.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
 */
message WifiPnoScanReported {
    enum State {
        UNKNOWN = 0;

        // Scan started.
        STARTED = 1;

        // Scan failed to start (e.g. bad request, unsupported by hardware, etc).
        FAILED_TO_START = 2;

        // Scan completed and a network was found.
        // Note - due to implementation constraints, nothing is reported when a scan completes but
        // doesn't find any networks.
        FINISHED_NETWORKS_FOUND = 3;

        // Scan failed.
        FAILED = 4;
    }

    optional State state = 1;
}

/**
 * Logs when an airplane mode session happens.
 *
 * Logged from:
 *   packages/modules/Wifi/service/java/com/android/server/wifi/WifiMetrics.java
 *   packages/modules/Bluetooth/service/java/com/android/server/bluetooth/BluetoothAirplaneModeListener.java
 */
message AirplaneModeSessionReported {
    enum PackageName {
        WIFI = 0;
        BLUETOOTH = 1;
    }
    // Module recording the airplane mode session
    optional PackageName package_name = 1;
    // State of the module before entering airplane mode
    // False - module off
    // True - module on
    optional bool previous_state = 2;
    // State of the module at the beginning of airplane mode
    optional bool entering_state = 3;
    // State of the module at the end of airplane mode
    optional bool exiting_state = 4;
    // Whether the user has activated the feature by
    // toggling the module in airplane mode
    optional bool feature_active = 5;
    // Whether the user toggled the module during current airplane mode
    optional bool user_toggled = 6;
    // Whether the user toggled the module within one minute
    optional bool user_toggled_within_minute = 7;
    // Whether media profile was connected before entering airplane mode
    // Only applicable to the Bluetooth module
    optional bool media_profile_connected = 8;
}

/**
 * Logs when a package installation session happens.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/pm/InstallPackageHelper.java
 */
message PackageInstallationSessionReported {
    // Used to correlate with Play logging metrics
    optional int32 session_id = 1;
    // Only logged for failed installations
    optional string package_name = 2;

    // UID of the app that is successfully installed
    optional int32 uid = 3 [(is_uid) = true];
    // Users that will have this package installed
    repeated int32 user_ids = 4;
    // User types for the users listed above
    repeated int32 user_types = 5;
    // Users that originally had this package installed if it already exists
    repeated int32 original_user_ids = 6;
    // User types for original users
    repeated int32 original_user_types = 7;
    // PackageManager.INSTALL_FAILED_* error codes
    optional int32 public_return_code = 8;
    // Internal error codes that indicate detailed installation failures
    optional int32 internal_error_code = 9;
    // Total size of the new APKs in the current session
    optional int64 apks_size_bytes = 10;
    // Version code of the app
    optional int64 version_code = 11;

    // List of install steps defined in
    // frameworks/base/services/core/java/com/android/server/pm/PackageMetrics.java
    repeated int32 install_steps = 12;
    // Duration of each step in the installation; order must match install_steps
    repeated int64 step_duration_millis = 13;
    // Total duration can be greater than zero even if install failed
    optional int64 total_duration_millis = 14;
    // Installation flags including DONT_KILL
    optional int32 install_flags = 15;
    // UID of the package that initiates the installation
    optional int32 installer_package_uid = 16 [(is_uid) = true];
    // UID of the package that previously installed the app
    optional int32 original_installer_package_uid = 17 [(is_uid) = true];
    // {@see android.content.pm.DataLoaderType}
    optional int32 data_loader_type = 18;
    // {@see android.content.pm.UserActionRequirement}
    optional int32 user_action_required_type = 19;

    // Install types might overlap, therefore using booleans for each type
    // A regular new app install has every field as false.
    optional bool is_instant = 20;
    optional bool is_replace = 21;
    optional bool is_system = 22;
    optional bool is_inherit = 23;
    optional bool is_installing_existing_as_user = 24;
    optional bool is_move_install = 25;
    // Whether this is a staged installation
    optional bool is_staged = 26;
}

message PackageUninstallationReported {
    // UID of the package being uninstalled
    optional int32 uid = 1 [(is_uid) = true];
    // Users on which the package (or system app update) is uninstalled from
    // If uninstall for all users, list all the user ids
    repeated int32 user_ids = 2;
    // Types of the users listed above. Order must match above.
    repeated int32 user_types = 3;
    // Users that originally had this package (or system app update) installed
    repeated int32 original_user_ids = 4;
    repeated int32 original_user_types = 5;
    // Flags of uninstallation, including KEEP_DATA
    optional int32 uninstall_flags = 6;
    // PackageManager.DELETE_SUCCEEDED or PackageManager.DELETE_FAILED_*
    optional int32 return_code = 7;
    // Special uninstall types might overlap, therefore booleans
    // An uninstall of a non-system app on all users should have all fields false
    optional bool is_system = 8;
    // When this is true, user_ids != original_user_ids
    optional bool is_uninstall_for_users = 9;
}

/**
 * Logs when the entitlement configuration of an IMS service is queried/updated.
 *
 * Logged from: ImsServiceEntitlement app
 */
message ImsServiceEntitlementUpdated {
    // The purpose of entitlement query/update
    enum Purpose {
        UNKNOWN_PURPOSE = 0;

        // Initial service activation in foreground
        ACTIVATION = 1;

        // Updating service configuration in foreground
        UPDATE = 2;

        // Background polling for querying service entitlement
        POLLING = 3;
    }

    // The IMS services
    enum ServiceType {
        UNKNOWN_SERVICE = 0;
        VOWIFI = 1;
        VOLTE = 2;
        SMSOIP = 3;
    }

    // The result of activation
    enum AppResult {
        UNKNOWN_RESULT = 0;
        ENABLED = 1;
        DISABLED = 2;
        INCOMPATIBLE = 3;
        PROVISIONING = 4;
        SUCCESSFUL = 5;
        FAILED = 6;
        CANCELED = 7;
        TIMEOUT = 8;
        UNEXPECTED_RESULT = 9;
    }

    // The Android carrier ID for the carrier providing the IMS service.
    // This may not be the actual carrier of the device, e.g. a MVNO
    // may use the IMS service of its MNO.
    optional int64 carrier_id = 1;

    // The Android carrier ID of the actual carrier.
    // E.g. a MVNO may use its MNO's IMS service. In this case,
    // actual_carrier_id is the MVNO and carrier_id is the MNO.
    optional int64 actual_carrier_id = 2;

    // The purpose of this query/update.
    optional Purpose purpose = 3;

    // Which IMS service's entitlement status were queried/updated.
    optional ServiceType service_type = 4;

    // Result of this query/update.
    optional AppResult app_result = 5;

    // How long (in milliseconds) this query/update took.
    optional int64 duration_millis = 6;
}

/**
 * Logged when a SIM-specific settings restore was attempted.
 *
 * Logged from:
 *    packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyProvider.java
 */
message SimSpecificSettingsRestored {
    optional android.telephony.SimSpecfifcSettingsRestoreResult result = 1;

    // Indicates which restore flow was followed.
    optional android.telephony.SimSpecificSettingsRestoreCase restored_from_suw = 2;

    // Indicates which criteria was used to match the inserted SIM to backed up
    // SIM. Only relevant when result is SUCCESS
    optional android.telephony.SimSpecificSettingsRestoreMatchingCriteria matching_criteria = 3;
}

/**
 * The latency of Binder calls broken down by calling API and method name.
 * This is different from BinderCalls as it collects a histogram of the
 * latencies (to get more detailed data) not just the count, sum, and maximum.
 *
 * Logged from:
 * frameworks/base/core/java/com/android/internal/os/BinderLatencyObserver.java
 */
message BinderLatencyReported {
    message Dims {
        enum ProcessSource {
            UNKNOWN_PROCESS_SOURCE = 0;
            SYSTEM_SERVER = 1;
            TELEPHONY = 2;
            BLUETOOTH = 3;
            WIFI = 4;
        }
        enum ServiceClassName {
            UNKNOWN_CLASS = 0;
        }
        enum ServiceMethodName {
            UNKNOWN_METHOD = 0;
        }

        // Required.
        optional ProcessSource process_source = 1;

        // The class name of the API making the call to Binder. Enum value
        // is preferred as uses much less data to store.
        // This field does not contain PII.
        oneof service_class {
            ServiceClassName service_class_name_as_enum = 2;
            string service_class_name = 3;
        }

        // Method name of the API call. It can also be a transaction code if we
        // cannot resolve it to a name. See Binder#getTransactionName. Enum value
        // is preferred as uses much less data to store.
        // This field does not contain PII.
        oneof service_method {
            ServiceMethodName service_method_name_as_enum = 4;
            string service_method_name = 5;
        }
    }

    message ApiStats {
        // required.
        optional Dims dims = 1;

        // Indicates the first bucket that had any data. Allows omitting any empty
        // buckets at the start of the bucket list and thus save on data size.
        optional int32 first_bucket_index = 2;
        // Stores the count of samples for each bucket. The number of buckets and
        // their sizes are controlled server side with a flag.
        repeated int32 buckets = 3;
    }

    message RepeatedApiStats {
        repeated ApiStats api_stats = 1;
    }

    // The binder latency data broken down by the dimensions specified above.
    // The message wrapper is used for the repeated field as top level repeated
    // fields are not allowed.
    // MODE_BYTES is used as nested messages are not allowed otherwise.
    // Required.
    optional RepeatedApiStats repeated_api_stats = 1 [(android.os.statsd.log_mode) = MODE_BYTES];

    // The fraction of samples that are recorded in the histogram.
    // Required.
    optional float sampling_rate = 2;

    // Indicates how many shards the APIs are divided in - e.g. for 3 every
    // 3rd API will be included in the data for this shard.
    // Required.
    optional int32 sharding_modulo = 3;

    // Params for histogram buckets.
    // The number of buckets the histogram should have.
    optional int32 bucket_count = 4;

    // The size (upper bound) of the first bucket (used to avoid creating an
    // excessive amount of small buckets). E.g. for first_bucket_size of 5, the
    // first bucket will be [0, 5) and the second will be [5, 5 * scaleFactor).
    optional int32 first_bucket_size = 5;

    // The rate in which each consecutive bucket increases (before rounding).
    // Implemented in: com.android.internal.os.BinderLatencyBuckets.
    optional float scale_factor = 6;
}

/**
 * Log audio device types that are used for input/output.
 * Next Tag: 2
 */
message AudioDevice {
    // See audio_devices_t in system/media/audio/include/system/audio-hal-enums.h
    repeated int32 type = 1;
}

/**
 * Track information about AAudio Stream
 * Logged from
 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
 */
message MediametricsAAudioStreamReported {
    // The implementation of aaudio.
    optional android.media.audio.CallerPath path = 1;

    // The direction of the stream.
    optional android.media.audio.Direction direction = 2;

    // The amount read or written in one shot by the Mixer or DSP.
    optional int32 frames_per_burst = 3;
    // The number of frames that the buffer is used.
    optional int32 buffer_size = 4;
    // The allocated number of frames for the buffer.
    optional int32 buffer_capacity = 5;
    // The channel count of the aaudio stream.
    optional int32 channel_count = 6;
    // Total frames transferred (written or read)
    optional int64 total_frames_transferred = 7;

    // The performance mode requested by the applications.
    optional android.media.audio.PerformanceMode perf_mode_requested = 8;
    // The actual performance mode used by aaudio.
    optional android.media.audio.PerformanceMode perf_mode_actual = 9;

    // The mode requested for sharing the device
    optional android.media.audio.SharingMode sharing = 10;

    // Approximate number of glitches.
    // Underrun on output stream. Overrun on input stream.
    optional int32 xrun_count = 11;
    // Devices that are used by the aaudio stream.
    optional AudioDevice types = 12 [(log_mode) = MODE_BYTES];

    // Format request by the applications
    optional int32 format_app = 13;
    // Format processed by the framework
    optional int32 format_device = 14;

    // Android S metric log session id, a Base64Url encoded string representing a 128-bit integer.
    optional string log_session_id = 15;

    // The sample rate of the aaudio stream.
    optional int32 sample_rate = 16;

    // The content type of the aaudio stream.
    optional android.media.audio.ContentType content_type = 17;

    // The mode of sharing the device requested by the client.
    optional android.media.audio.SharingMode sharing_requested = 18;

    // Android U
    // The format used by the audio hardware.
    optional int32 format_hardware = 19;

    // Android U
    // The channel count used by the audio hardware.
    optional int32 channel_count_hardware = 20;

    // Android U
    // The sample rate used by the audio hardware.
    optional int32 sample_rate_hardware = 21;

    // Android U
    // The UID of the client.
    optional int32 uid = 22 [(is_uid) = true];

    // Android U
    // The sample rate used by the client.
    optional int32 sample_rate_client = 23;
}

/**
 * Logs media transcoding session ended events.
 *
 * Logged from:
 *   frameworks/av/media/libmediatranscoding/TranscoderWrapper.cpp
 */
message MediaTranscodingSessionEnded {

    enum Reason {
        UNKNOWN = 0;       // Unused.
        FINISHED = 1;      // Transcoding session finished successfully.
        ERROR = 2;         // Transcoding session returned error while running.
        PAUSED = 3;        // Transcoding session was paused, potentially failed.
        CANCELLED = 4;     // Transcoding session was cancelled.
        START_FAILED = 5;  // Transcoding session failed to start.
        RESUME_FAILED = 6; // Transcoding session failed to resume.
        CREATE_FAILED = 7; // Transcoder instance failed to crate.
        CONFIG_SRC_FAILED = 8;    // Configure source failed.
        CONFIG_DST_FAILED = 9;    // Configure destination failed.
        CONFIG_TRACK_FAILED = 10; // Configure track failed.
        OPEN_SRC_FD_FAILED = 11;  // Open source fd failed.
        OPEN_DST_FD_FAILED = 12;  // Open destination fd failed.
        NO_TRACKS = 13;  // No tracks in source file.
    }

    // Reason for logging the atom.
    optional Reason reason = 1;

    // UID of client connecting to media transcoding service.
    optional int32 calling_uid = 2 [(is_uid) = true];

    // Transcode session status flag (media_status_t).
    optional int32 transcode_status = 3;

    // Transcode speed as framerate, if status is success.
    optional int32 transcode_fps = 4;

    // Source video dimensions.
    optional int32 src_width = 5;
    optional int32 src_height = 6;

    // Source video codec information.
    optional string src_codec_type = 7;
    optional int32 src_profile = 8;
    optional int32 src_level = 9;

    // Source video framerate.
    optional int32 src_fps = 10;

    // Source video duration.
    optional int32 src_duration_millis = 11;

    // Whether source video is HDR.
    optional bool src_is_hdr = 12;

    // Destination video dimensions.
    optional int32 dst_width = 13;
    optional int32 dst_height = 14;

    // Destination video codec information.
    optional string dst_codec_type = 15;

    // Whether destination video is HDR.
    optional bool dst_is_hdr = 16;
}

/** Logs information about an unattended reboot that took place. This is logged
 *  after the next boot, when the device is first unlocked.
 *
 * Logged from:
 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
 */
message UnattendedRebootOccurred {

    // Time between the reboot readiness state checks starting, and the device
    // becoming reboot-ready.
    optional int64 time_until_reboot_ready_millis= 1;

    // Time taken for the device to be unlocked (i.e. for the keyguard to be
    // gone) after an unattended reboot took place.
    optional int64 time_until_first_unlock_millis = 2;

    // Number of times the reboot was blocked by the device being interactive.
    optional int32 times_blocked_by_interactivity = 3;

    // Number of times the reboot was blocked by a callback registered by a
    // subsystem or a privileged app.
    optional int32 times_blocked_by_subsystems = 4;

    // Number of times the reboot was blocked by background app activity.
    optional int32 times_blocked_by_app_activity = 5;

    // Time until next user interaction with the device.
    optional int64 time_until_next_interaction_ms = 6;
}


/**
 * Logs information about an app uid or registered system component that has
 * been blocking the device from being reboot-ready for a long time.
 *
 * Logged from:
 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
 */
message LongRebootBlockingReported {

    enum RebootBlockReason {
        SYSTEM_COMPONENT = 1;
        APP_UID = 2;
    }

    // The reason why the reboot has been blocked. This is either a system
    // component that has registered a callback, or an app UID running in the
    // background.
    optional RebootBlockReason reboot_block_reason = 1;

    // Only one of the following two fields should be set, depending on the
    // RebootBlockReason.

    // The name supplied by a system component when it registered a callback
    // to block the reboot.
    optional string component_name = 2;

    // The uid of an app that is running in the background.
    optional int32 uid = 3;
}

/**
 * Logs the magnification activated mode and its duration of the usage
 * when the magnification is disabled.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 */
message MagnificationUsageReported {
    // The definition of the magnification mode.
    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.MagnificationMode activated_mode = 1;

    // The duration of this magnification mode activation in milliseconds
    optional int64 duration_millis = 2;

    // The last magnification scale for the activation in percentage
    optional int64 scale_percentage = 3;
}

/**
 * Logs the magnification activated mode when IME dialog shows on the screen.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 */
message MagnificationModeWithImeOnReported {
    // The definition of the magnification mode.
    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
}

/**
 * Logs the duration for the magnification session which is activated by the triple tap and
 * hold gesture.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 */
message MagnificationTripleTapAndHoldActivatedSessionReported {
    // The duration of the triple tap and hold activated session in milliseconds
    optional int64 duration_millis = 1;
}

/**
 * Logs the duration for the following typing focus activated session.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 */
message MagnificationFollowTypingFocusActivatedSessionReported {
    // The duration of the following typing focus activated session in milliseconds
    optional int64 duration_millis = 1;
}

/*
 * Logged when hardware based user-configurable device state changes.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
 */
message DeviceStateChanged {
    optional int32 new_device_state = 1
            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
    optional bool boot_state = 2;
}

/*
 * Logged when device folded state changes.
 *
 * Logged from:
 *     frameworks/base/packages/SystemUI/src/com/android/systemui/unfold/FoldStateLogger.kt
 */
message FoldStateDurationReported {
    enum State {
      UNKNOWN = 0;
      OPEN = 1;
      CLOSED = 2;
      HALF_OPEN = 3;
    }

    optional State start_state = 1;
    optional State end_state = 2;
    optional int64 duration_millis = 3;
}

/**
 * This metric is collected at the end of playback
 * as a pulled atom.
 *
 *   DrmHal::cleanup() {
 *     // ...
 *     reportFrameworkMetrics(reportPluginMetrics());
 *     // ...
 *   }
 * This proto should be kept in-sync with
 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
 */
message DrmFrameworkMetrics {

    // Attributes are associated with a recorded value. E.g. A counter may
    // represent a count of an operation returning a specific error code. The
    // error code will be an attribute.
    message Attributes {
        // Reserved for compatibility with logging proto.
        reserved 2 to 13;

        // A general purpose error code where 0 means OK.
        optional int32 error_code = 1;

        // Defined at ::android::hardware::drm::V1_0::KeyStatusType;
        optional uint32 key_status_type = 14;

        // Defined at ::android::hardware::drm::V1_0::EventType;
        optional uint32 event_type = 15;
    }

    // The Counter message is used to store a count value with an associated
    // Attribute.
    message Counter {
        optional uint64 count = 1;
        // Represents the attributes associated with this counter instance.
        optional Attributes attributes = 2;
    }

    // The DistributionMetric is meant to capture the moments of a normally
    // distributed (or approximately normal) value.
    message DistributionMetric {
        optional float min = 1;
        optional float max = 2;
        optional float mean = 3;
        optional double variance = 4;
        optional uint64 operation_count = 5;

        // Represents the attributes associated with this distribution metric
        // instance.
        optional Attributes attributes = 6;
    }

    message SessionLifetime {
        // Start time of the session in milliseconds since epoch.
        optional uint64 start_time_millis = 1;
        // End time of the session in milliseconds since epoch.
        optional uint64 end_time_millis = 2;
    }

    // The count of open session operations. Each instance has a specific error
    // code associated with it.
    repeated Counter open_session_counter = 1;

    // The count of close session operations. Each instance has a specific error
    // code associated with it.
    repeated Counter close_session_counter = 2;

    // Count and execution time of getKeyRequest calls.
    repeated DistributionMetric get_key_request_time_us = 3;

    // Count and execution time of provideKeyResponse calls.
    repeated DistributionMetric provide_key_response_time_us = 4;

    // Count of getProvisionRequest calls.
    repeated Counter get_provisioning_request_counter = 5;

    // Count of provideProvisionResponse calls.
    repeated Counter provide_provisioning_response_counter = 6;

    // Count of key status events broken out by status type.
    repeated Counter key_status_change_counter = 7;

    // Count of events broken out by event type
    repeated Counter event_callback_counter = 8;

    // Count getPropertyByteArray calls to retrieve the device unique id.
    repeated Counter get_device_unique_id_counter = 9;

    message SessionLifetimeEntry {
        optional string session_id = 1;
        optional SessionLifetime session_lifetime = 2;
    }
    // Session ids to lifetime (start and end time) map.
    // Session ids are strings of hex-encoded byte arrays.
    // This field is equivalent to the map<string, SessionLifetime>
    // field in frameworks/av/drm/libmediadrm/protos/metrics.proto.
    repeated SessionLifetimeEntry session_lifetimes = 10;
}

/**
 * The metric is collected at the end of playback
 * as a pulled atom MediaDrmActivityInfo.
 *
 * The framework_metrics is defined in
 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
 *
 * The format of vendor_metrics is  MediaDrm plugin dependent.
 *
 *   DrmHal::cleanup() {
 *     // ...
 *     reportFrameworkMetrics(reportPluginMetrics());
 *     // ...
 *   }
 *
 * This pulled atom is then collected in
 * frameworks/av/services/mediametrics/MediaMetricsService.cpp.
 */
message MediaDrmActivityInfo {
    optional string package_name = 1;
    optional int64 package_version_code = 2;

    // vendor+description tell about which DRM plugin is in use on this device
    optional string vendor = 3;
    optional string description = 4;

    optional DrmFrameworkMetrics framework_metrics = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
    optional bytes vendor_metrics = 6 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/*
 * A canonical form time zone suggestion for metrics use.
 */
message MetricsTimeZoneSuggestion {
    enum Type {
        UNKNOWN = 0;
        CERTAIN = 1;
        UNCERTAIN = 2;
    }
    optional Type type = 1;

    // The ordinals for time zone(s) in the suggestion. Always empty for
    // UNCERTAIN, and can be empty for CERTAIN, for example when the device is in
    // a disputed area / on an ocean.
    //
    // The suggestion's time zone IDs (which relate to location) are obfuscated by
    // mapping them to an ordinal. When the ordinal is assigned consistently across
    // several objects (i.e. so the same time zone ID is always mapped to the same
    // ordinal), this allows comparisons between those objects. For example, we can
    // answer "did these two suggestions agree?", "does the suggestion match the
    // device's current time zone?", without leaking knowledge of location. Ordinals
    // are also significantly more compact than full IANA TZDB IDs, albeit unstable
    // and of limited use.
    repeated int32 time_zone_ordinals = 2;

    // The actual time zone ID(s) in the suggestion. Similar to time_zone_ordinals
    // but contains the actual string IDs.
    //
    // This information is only captured / reported for some devices based on the
    // value of a server side flag, i.e. it could be enabled for internal testers.
    // Therefore the list can be empty even when time_zone_ordinals is populated.
    //
    // When enabled, see time_zone_ordinals for the expected number of values.
    repeated string time_zone_ids = 3;
}

/*
 * Logs a snapshot of time zone detector state.
 *
 * Logged from:
 * frameworks/base/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
 */
message TimeZoneDetectorState {

    // True if telephony-based time zone detection is supported on the device.
    optional bool telephony_supported = 1;

    // True if geo-based time zone detection is supported on the device.
    optional bool geo_supported = 2;

    // The current user's master location setting value.
    optional bool location_enabled = 3;

    // The current user's auto time zone detection enabled setting value.
    optional bool auto_detection_setting = 4;

    // The current user's geo detection enabled setting.
    optional bool geo_detection_setting = 5;

    enum DetectionMode {
        UNKNOWN = 0;
        MANUAL = 1;
        TELEPHONY = 2;
        GEO = 3;
    }

    // The functional / behavioral state for how time zones are currently determined on the device.
    // Avoids needing to duplicate the logic used.
    optional DetectionMode detection_mode = 6;

    // The device's current time zone ordinal (see MetricsTimeZoneSuggestion).
    optional int32 device_time_zone_ordinal = 7;

    // The latest suggestion received from the user, e.g. via SettingsUI (non-persistent).
    optional MetricsTimeZoneSuggestion latest_manual_suggestion = 8
            [(log_mode) = MODE_BYTES];

    // The latest telephony-derived suggestion (non-persistent).
    optional MetricsTimeZoneSuggestion latest_telephony_suggestion = 9
            [(log_mode) = MODE_BYTES];

    // The latest geo-derived suggestion (non-persistent).
    optional MetricsTimeZoneSuggestion latest_geo_suggestion = 10
            [(log_mode) = MODE_BYTES];

    // True if fallback to telephony time zone detection is supported on the device.
    optional bool telephony_time_zone_fallback_supported = 11;

    // The device's current time zone ID (see MetricsTimeZoneSuggestion).
    optional string device_time_zone_id = 12;

    // True if enhanced metrics collection is enabled.
    optional bool enhanced_metrics_collection_enabled = 13;

    // True if the device may run geolocation time zone detection in the
    // background. This is the raw server flag value, not the value after
    // considering other state like the user's "use location" setting that also
    // affects runtime behavior. See LocationTimeZoneProviderController for
    // details.
    optional bool geo_detection_run_in_background_enabled = 14;
}

/*
 * Logs information about an individual location time zone provider's state.
 *
 * Logged from:
 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealProviderMetricsLogger.java
 */
message LocationTimeZoneProviderStateChanged {
    // The index of the provider (primary = 0, secondary = 1)
    optional int32 provider_index = 1 [(state_field_option).primary_field = true];

    enum State {
        // A placeholder for unknown values.
        UNKNOWN = 0;

        // The provider is initializing.
        INITIALIZING = 1;

        // The provider is certain of the time zone.
        CERTAIN = 2;

        // The provider is uncertain of the time zone.
        UNCERTAIN = 3;

        // The provider has been stopped.
        STOPPED = 4;

        // The provider has failed.
        PERM_FAILED = 5;

        // The provider has been destroyed.
        DESTROYED = 6;
    }

    // The state of the provider.
    optional State state = 2 [(state_field_option).exclusive_state = true];
}

/*
 * Logs information about the location time zone provider controller's state.
 *
 * Logged from:
 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealControllerMetricsLogger.java
 */
message LocationTimeZoneProviderControllerStateChanged {

    enum State {
        // A placeholder for unknown values.
        UNKNOWN = 0;

        // The providers are initializing.
        PROVIDERS_INITIALIZING = 1;

        // The controller is / has been stopped.
        STOPPED = 2;

        // The controller is started and is initializing.
        INITIALIZING = 3;

        // The controller is started and is certain of the time zone.
        CERTAIN = 4;

        // The controller is started and is uncertain of the time zone.
        UNCERTAIN = 5;

        // The controller has been destroyed.
        DESTROYED = 6;

        // The controller has failed.
        FAILED = 7;
    }

    // The state of the provider.
    optional State state = 1;
}

/*
 * Reports fdtrack state change.
 *
 * Logged from:
 *   frameworks/base/services/java/com/android/server/SystemServer.java
 */
message FdtrackEventOccurred {
    enum FdtrackEventType {
      DISABLED = 1;
      ENABLED = 2;

      // Aborting because we're above the abort threshold.
      ABORTING = 3;
    }

    optional FdtrackEventType event = 1;
    optional int32 fd_count = 2;
}

/**
 * Pushed when delivering a batch of alarms.
 *
 * Logged from:
 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
 */
message AlarmBatchDelivered {
    // The total number of alarms delivered in the batch.
    optional int32 num_alarms = 1;

    // The number of wakeup alarms delivered in the batch.
    optional int32 wakeups = 2;

    // A list of uids receiving the alarm delivery.
    repeated int32 uids = 3 [(is_uid) = true];

    // The number of alarms delivered to each of the {@link uids} above.
    repeated int32 num_alarms_per_uid = 4;

    // The number of wakeup alarms delivered to each of the {@link uids} above.
    repeated int32 num_wakeups_per_uid = 5;
}

/**
 * Pushed when an app schedules an alarm.
 *
 * Logged from:
 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
 */
message AlarmScheduled {
    optional int32 calling_uid = 1 [(is_uid) = true];

    optional bool is_exact = 2;
    optional bool is_wakeup = 3;
    optional bool is_allow_while_idle = 4;
    optional bool is_alarm_clock = 5;
    optional bool is_repeating = 6;

    enum ReasonCode {
        NOT_APPLICABLE = 0;
        PERMISSION = 1;
        ALLOW_LIST = 2;
        CHANGE_DISABLED = 3;
        POLICY_PERMISSION = 4;
        LISTENER = 5;
        PRIORITIZED = 6;
    }
    optional ReasonCode exact_alarm_allowed_reason = 7;
    optional bool is_rtc = 8;
    // The state of the callingUid, from frameworks/proto_logging/stats/enums/app/enums.proto.
    optional android.app.ProcessStateEnum calling_process_state = 9;
}

/**
 * Logs statistics about pending alarms.
 *
 * Pulled from:
 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
 */
message PendingAlarmInfo {
    optional int32 num_total = 1;
    optional int32 num_exact = 2;
    optional int32 num_wakeup = 3;
    optional int32 num_allow_while_idle = 4;
    optional int32 num_prioritized = 5;
    optional int32 num_foreground_service = 6;
    optional int32 num_activity = 7;
    optional int32 num_service = 8;
    optional int32 num_listener = 9;
    optional int32 num_indefinite_future = 10;
    optional int32 num_repeating = 11;
    optional int32 num_alarm_clock = 12;
    optional int32 num_rtc = 13;
}

/*
 * Logged when a package's user-level hibernation state changes.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
 */
 message UserLevelHibernationStateChanged {
    // Name of the package that had its hibernation state change.
    optional string package_name = 1;

    // Android user id to which this event belongs. This can only be 0, 10, 11 and so on.
    optional int32 user_id = 2;

    // New hibernation state. True if hibernating, false otherwise
    optional bool is_hibernating = 3;
}

/*
 * Pull atom for the number of hibernated packages on the device for the given user.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
 */
message UserLevelHibernatedApps {
    // Total number of apps hibernated for the user
    optional int32 hibernated_app_count = 1;

    // Android user id of the queried user which can only be 0, 10, 11 and so on.
    optional int32 user_id = 2;
}

/**
 * Pull atom for total number of globally hibernated packages on the device and the storage savings
 * from these apps being hibernated.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
 */
message GlobalHibernatedApps {
    // Total number of apps in global hibernation
    optional int32 hibernated_app_count = 1;

    // Cumulative storage savings from apps being hibernated
    optional int64 storage_saved_mb = 2;
}

/*
 * Report the event of app process kills.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/AppExitInfoTracker.java
 */
message AppProcessDied {
    // Uid of the package of the dying process
    optional int32 uid = 1 [(is_uid) = true];

    // Name of the dying process, it'll be omitted if the process name and package name are the same
    optional string process_name = 2;

    // The reason code of why the process dies
    optional android.app.AppExitReasonCode reason = 3;

    // The supplemental reason code of why the process dies
    optional android.app.AppExitSubReasonCode sub_reason = 4;

    // The importance of the process when it dies
    optional android.app.Importance importance = 5;

    // The last known PSS (in kB) of the process before it dies, could be 0.
    optional int32 pss = 6;

    // The last known RSS (in kB) of the process before it dies, could be 0.
    optional int32 rss = 7;

    // Whether or not this process is hosting one or more foregound services.
    optional bool has_foreground_services = 8;
}

// Each pull creates multiple atoms. One for each incremental package.
message InstalledIncrementalPackage {
    optional int32 uid = 1 [(is_uid) = true];
    optional bool is_loading = 2;
    optional int64 loading_completed_timestamp = 3;
}

/**
 * Memory management statistics pulled atom based on /proc/vmstat.
 * Logged from StatsPullAtomService.
 */
message VmStat {
    optional int32 oom_kill_count = 1;
}

/**
* Log that the user has interacted with an app on the permission usage
* fragment.
* Logged from permission/debug/PermissionUsageV2Frament.kt
*/
message PermissionUsageFragmentInteraction {
    // id which identifies single session of user interacting with permission hub
    optional int64 session_id = 1;

    enum Action {
        UNDEFINED = 0;
        OPEN = 1;
        LOCATION_ACCESS_TIMELINE_VIEWED = 2;
        CAMERA_ACCESS_TIMELINE_VIEWED = 3;
        MICROPHONE_ACCESS_TIMELINE_VIEWED = 4;
        SHOW_SYSTEM_CLICKED = 5;
        SEE_OTHER_PERMISSIONS_CLICKED = 6;
    }

    // The action the user took to interact with the fragment
    optional Action action = 2;
}

/**
* Log that the user has clicked on .
* Logged from permission/debug/PermissionDetailsFragment.kt
*/
message PermissionDetailsInteraction {
    // id which identifies single session of user interacting with permission details fragment.
    optional int64 session_id = 1;

    // The name of a permission group whose details are viewed.
    optional string permission_group_name = 2;

    enum Action {
        UNDEFINED = 0;
        SHOW_SYSTEM_CLICKED = 1;
        INFO_ICON_CLICKED = 2;
    }

    // Package name for which the info icon was clicked.
    optional string package_name = 3;

    // The action the user took to interact with the fragment
    optional Action action = 4;
}

/**
* Log that the user has toggled the sensor privacy.
*/
message PrivacySensorToggleInteraction {

    enum Sensor {
        SENSOR_UNKNOWN = 0;
        MICROPHONE = 1;
        CAMERA = 2;
    }

    // Sensor for which sensor privacy was toggled.
    optional Sensor sensor = 1;

    enum Action {
        ACTION_UNKNOWN = 0;
        TOGGLE_ON = 1;
        TOGGLE_OFF = 2;
    }

    // Action taken on sensor.
    optional Action action = 2;

    enum Source {
        SOURCE_UNKNOWN = 0;
        DIALOG = 1;
        SETTINGS = 2;
        QS_TILE = 3;
    }

    // Source for the toggling.
    optional Source source = 3;

    // Amount of time a user spent in the previous sensor privacy state in minutes.
    optional int64 time_in_previous_state_in_mins = 4;
}

message PrivacyToggleDialogInteraction {

    enum Action {
        ACTION_UNKNOWN = 0;
        ENABLE = 1;
        CANCEL = 2;
    }

    // Action taken on the toggle dialog.
    optional Action action = 1;

    // Name of the package for which the dialog was shown.
    optional string package_name = 2;
}

message VendorApexInfo {
  optional string package_name = 1;
  optional string version_code = 2;
  optional string version_name = 3;
  optional string source_dir = 4;
  optional string signing_certs_hash = 5;
  optional string file_hash = 6;
}

/**
 * Logs the non-a11yTool service warning status and its duration of the usage.
 *
 * Logged from:
 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
 *   packages/apps/Settings
 */
message NonA11yToolServiceWarningReported {
    // Package name of the non-a11yTool service.
    optional string package_name = 1;

    // Warning status of the non-a11yTool service.
    optional android.stats.accessibility.WarningStatus status = 2;

    // Duration between status in milliseconds.
    optional int64 duration_millis = 3;
}

message MediaCapabilities {
    message AudioEncodings {
        repeated android.stats.mediametrics.AudioEncoding audio_encodings = 1;
    }

    message HdrFormats {
        repeated android.stats.mediametrics.HdrFormat hdr_formats = 1;
    }


    message DisplayMode {
        optional int32 height = 1;
        optional int32 width = 2;
        optional float refresh_rate = 3;
        optional int32 seamless_refresh_rates_group_id = 4;
    }

    message DisplayModes {
        repeated DisplayMode display_modes = 1;
    }

    // Surround sound capabilities

    // List of surround sound encodings supported by this device
    optional AudioEncodings surround_encodings = 1 [(log_mode) = MODE_BYTES];
    // List of surround sound encodings supported by the sink device
    optional AudioEncodings sink_surround_encodings = 2 [(log_mode) = MODE_BYTES];
    // List of supported surround sound encodings disabled by user
    optional AudioEncodings user_disabled_surround_encodings = 3 [(log_mode) = MODE_BYTES];
    // List of unsupported surround sound encodings enabled by user
    optional AudioEncodings user_enabled_surround_encodings = 4 [(log_mode) = MODE_BYTES];
     // The surround sound output mode chosen by user
    optional android.stats.mediametrics.EncodedSurroundOutputMode surround_output_mode = 5;


    // Display capabilities

    // List of HDR display formats supported by the sink device
    optional HdrFormats sink_hdr_formats = 6 [(log_mode) = MODE_BYTES];
    // List of modes supported by the sink device. Each mode has height, width, refresh rate and a list
    // of refresh-rates between which a seamless switch is possible.
    optional DisplayModes sink_display_modes = 7 [(log_mode) = MODE_BYTES];
    // The HDCP level with which the display is connected
    optional int32 hdcp_level = 8;

    // Display settings

    // The Match content refresh rate user preference
    optional android.stats.mediametrics.MatchContentFrameRatePreference
                match_content_refresh_rate_preference = 9;
    // List of HDR formats disabled by the user
    optional HdrFormats user_disabled_hdr_formats = 10 [(log_mode) = MODE_BYTES];
    // The resolution height selected by the user
    optional int32 user_preferred_resolution_height = 11;
    // The resolution width selected by the user
    optional int32 user_preferred_resolution_width = 12;
    // The refresh rate selected by the user
    optional float user_preferred_refresh_rate = 13;
    // Whether the user has disabled auto low latency mode
    optional bool has_user_disabled_allm = 14;
}

/**
 * Logs when NNAPI model is compiled successfully
 * Logged from
 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
 */
message NeuralNetworksCompilationCompleted {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // id which identifies single session of client interacting with NNAPI runtime
    optional int32 session_id = 2;

    // NNAPI mainline module version.
    optional int64 version_nnapi_module = 3;

    // An identifier that can be used to match events for ML model architecture.
    // Hash is generated from model operations and operands definition, but not weights.
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];

    // Device driver identifier used by this compilation.
    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
    // device driver version]. If multiple device drivers are used, all device driver identifiers
    // are sorted and concatenated with comma as a separator.
    optional string device_id = 5;

    // Type of tensors used for inputs
    optional android.neuralnetworks.DataClass input_data_class = 6;

    // Type of tensors used for outputs
    optional android.neuralnetworks.DataClass output_data_class = 7;

    // Did the compilation had to fallback to cpu due to an error?
    optional bool fallback_to_cpu_from_error = 8;

    // Did client name target devices explicitly?
    optional bool introspection_enabled = 9;

    // Was cache enabled?
    optional bool cache_enabled = 10;

    // Was control flow used in the model?
    optional bool has_control_flow = 11;

    // Whether there exists a partition boundary in the compilation that has dynamic size
    optional bool has_dynamic_temporaries = 12;

    // Time taken to compile a model
    optional int64 compilation_time_sum_millis = 13;
    optional int64 compilation_time_min_millis = 14;
    optional int64 compilation_time_max_millis = 15;
    optional int64 compilation_time_sum_squared_millis = 16;
    optional int32 compilation_time_count = 17;

    // How many times this atom occurred locally before being pushed.
    optional int32 count = 18;

    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
    optional int64 model_arch_hash_64 = 19;
}

/**
 * Logs when NNAPI model fails compilation
 * Logged from
 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
 */
message NeuralNetworksCompilationFailed {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // id which identifies single session of client interacting with NNAPI runtime
    optional int32 session_id = 2;

    // NNAPI mainline module version.
    optional int64 version_nnapi_module = 3;

    // An identifier that can be used to match events for ML model architecture.
    // Hash is generated from model operations and operands definition, but not weights.
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];

    // Device driver identifier used by this compilation.
    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
    // device driver version]. If multiple device drivers are used, all device driver identifiers
    // are sorted and concatenated with comma as a separator.
    optional string device_id = 5;

    // Type of tensors used for inputs
    optional android.neuralnetworks.DataClass input_data_class = 6;

    // Type of tensors used for outputs
    optional android.neuralnetworks.DataClass output_data_class = 7;

    // Error code returned by compilation call
    optional android.neuralnetworks.ResultCode error_code = 8;

    // Did client name target devices explicitly?
    optional bool introspection_enabled = 9;

    // Was cache enabled?
    optional bool cache_enabled = 10;

    // Was control flow used in the model?
    optional bool has_control_flow = 11;

    // Whether there exists a partition boundary in the compilation that has dynamic size
    optional bool has_dynamic_temporaries = 12;

    // How many times this atom occurred locally before being pushed.
    optional int32 count = 13;

    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
    optional int64 model_arch_hash_64 = 14;
}

/**
 * Logs when NNAPI model is executed successfully
 *
 * Logged from
 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
 */
message NeuralNetworksExecutionCompleted {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // id which identifies single session of client interacting with NNAPI runtime
    optional int32 session_id = 2;

    // NNAPI mainline module version.
    optional int64 version_nnapi_module = 3;

    // An identifier that can be used to match events for ML model architecture.
    // Hash is generated from model operations and operands definition, but not weights.
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];

    // Device driver identifier used by this execution.
    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
    // The device driver identifier is a concatenation of [device driver name, =, and device driver
    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
    // concatenated with comma as a separator.
    optional string device_id = 5;

    // Execution mode
    optional android.neuralnetworks.Mode mode = 6;

    // Type of tensors used for inputs
    optional android.neuralnetworks.DataClass input_data_class = 7;

    // Type of tensors used for outputs
    optional android.neuralnetworks.DataClass output_data_class = 8;

    // Did client name target devices explicitly?
    optional bool introspection_enabled = 9;

    // Was cache enabled?
    optional bool cache_enabled = 10;

    // Was control flow used in the model?
    optional bool has_control_flow = 11;

    // Whether there exists a partition boundary in the compilation that has dynamic size
    optional bool has_dynamic_temporaries = 12;

    // Time taken to execute from runtime, including runtime/ipc overhead
    optional int64 duration_runtime_sum_micros = 13;
    optional int64 duration_runtime_min_micros = 14;
    optional int64 duration_runtime_max_micros = 15;
    optional int64 duration_runtime_sum_squared_micros = 16;
    optional int32 duration_runtime_count = 17;

    // Time taken to execute in the driver, excluding runtime/ipc overhead
    optional int64 duration_driver_sum_micros = 18;
    optional int64 duration_driver_min_micros = 19;
    optional int64 duration_driver_max_micros = 20;
    optional int64 duration_driver_sum_squared_micros = 21;
    optional int32 duration_driver_count = 22;

    // Time taken to execute on the hardware, excluding driver overhead
    optional int64 duration_hardware_sum_micros = 23;
    optional int64 duration_hardware_min_micros = 24;
    optional int64 duration_hardware_max_micros = 25;
    optional int64 duration_hardware_sum_squared_micros = 26;
    optional int32 duration_hardware_count = 27;

    // How many times this atom occurred locally before being pushed.
    optional int32 count = 28;

    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
    optional int64 model_arch_hash_64 = 29;
}

/**
 * Logs when NNAPI model fails execution
 * Logged from
 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
 */
message NeuralNetworksExecutionFailed {
    // Linux process uid for the package.
    optional int32 uid = 1 [(is_uid) = true];

    // id which identifies single session of client interacting with NNAPI runtime
    optional int32 session_id = 2;

    // NNAPI mainline module version.
    optional int64 version_nnapi_module = 3;

    // An identifier that can be used to match events for ML model architecture.
    // Hash is generated from model operations and operands definition, but not weights.
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];

    // Device driver identifier used by this execution.
    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
    // The device driver identifier is a concatenation of [device driver name, =, and device driver
    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
    // concatenated with comma as a separator.
    optional string device_id = 5;

    // Execution mode
    optional android.neuralnetworks.Mode mode = 6;

    // Type of tensors used for inputs
    optional android.neuralnetworks.DataClass input_data_class = 7;

    // Type of tensors used for outputs
    optional android.neuralnetworks.DataClass output_data_class = 8;

    // Error code returned by execution call
    optional android.neuralnetworks.ResultCode error_code = 9;

    // Did client name target devices explicitly?
    optional bool introspection_enabled = 10;

    // Was cache enabled?
    optional bool cache_enabled = 11;

    // Was control flow used in the model?
    optional bool has_control_flow = 12;

    // Whether there exists a partition boundary in the compilation that has dynamic size
    optional bool has_dynamic_temporaries = 13;

    // How many times this atom occurred locally before being pushed.
    optional int32 count = 14;

    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
    optional int64 model_arch_hash_64 = 15;
}

/**
 * Logs boot-time info for a Context Hub.
 */
message ContextHubBooted {
  // The amount of time it took the framework to connect to CHRE/Context Hub HAL
  // since the framework has booted.
  optional int64 boot_time_nanos = 1;

  // The number of Context Hub instances found on this system.
  optional int32 num_context_hubs = 2;
}

/**
 * Logs Context Hub restart events (e.g. crashes).
 */
message ContextHubRestarted {
  // The duration of time between the last time Context Hub restart and this event.
  // This should use the SystemClock.elapsedRealTime() API.
  optional int64 elapsed_time_millis_since_boot = 1;

  // The ID of the Context Hub that has restarted (zero-indexed).
  optional int32 context_hub_id = 2;
}

/**
 * Logs a snapshot of all the nanoapps loaded on this Context Hub.
 */
message ContextHubLoadedNanoappSnapshotReported {
  // The ID of the Context Hub the snapshot is for (zero-indexed).
  optional int32 context_hub_id = 1;

  // The nanoapp this snapshot is for. The nanoapp ID is the 64-bit unique identifier
  // for the application, and the version is the semantic versioning (https://semver.org)
  // used to determine the software version.
  optional int64 nanoapp_id = 2;
  optional int32 nanoapp_version = 3;
}

/**
 * Logs details of a dynamic CHRE nanoapp code download transaction.
 */
message ChreCodeDownloadTransacted {
  enum Type {
    TYPE_UNKNOWN = 0;
    TYPE_LOAD = 1;
    TYPE_UNLOAD = 2;
  }
  // The ID/version of the nanoapp this code download was for.
  optional int64 nanoapp_id = 1;
  optional int32 nanoapp_version = 2;

  // The type of code download transaction.
  optional Type transaction_type = 3;

  // The result of this transaction.
  optional android.contexthub.ContextHubTransactionResult transaction_result = 4;
}

/**
 * Stats about each feature tag that was included in the registration.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message ImsRegistrationFeatureTagStats {
    // the carrier id associated with this SIP delegate
    // Used as a dimension
    optional int32 carrier_id = 1;

    // The slot id associated with this SIP delegate
    // Used as a dimension
    optional int32 slot_id = 2;

    // The name of the feature tag
    // used as a dimension
    optional android.telephony.ImsFeatureTag feature_tag_name = 3;

    // The underlying radio technology type associated with the feature tag
    // used as a dimension
    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
    optional int32 registration_tech = 4;

    // The time this feature tag was registered, rounded to 5 minutes
    optional int32 registered_seconds = 5;
}

/**
 * Stats about the messaging client interacting with telephony
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message RcsClientProvisioningStats {
    enum EventType {
        EVENT_TYPE_UNSPECIFIED = 0;
        // The client sent its client params to the ACS service.
        CLIENT_PARAMS_SENT = 1;
        // The client has manually triggered reconfiguration
        TRIGGER_RCS_RECONFIGURATION = 2;
        // Default messaging application changed.
        DMA_CHANGED = 3;
    }
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // Used as a dimension
    optional EventType event = 3;

    // The number of times this event has occurred.
    optional int32 count = 4;
}

/**
 * Stats about the RCS provisioning via ACS
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message RcsAcsProvisioningStats {
    enum ResponseType {
        RESPONSE_TYPE_UNSPECIFIED = 0;
        // a provisioning request resulted in an error.
        ERROR = 1;
        // a provisioning request succeeded and provided an xml
        PROVISIONING_XML = 2;
        // a provisioning request has resulted in a "pre-provisioning" xml, which
        // means RCS is not provisioned and requires the user to intervene.
        PRE_PROVISIONING_XML = 3;
    }

    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // The response code of provisioning if the provisioning resulted in
    // ResponseType.ERROR
    // Used as a dimension
    optional int32 response_code = 3;

    // used as a dimension.
    optional ResponseType response_type = 4;

    // Does the provisioning XML have single registration provisioned.
    // Populated if response_type is ResponseType.PROVISIONING_XML
    // used as a dimension
    optional bool is_single_registration_enabled = 5;

    // The number of times this event has occurred.
    optional int32 count = 6;

    // The amount of time in seconds that the device was in this state in total, rounded 5 minutes
    optional int32 state_timer_sec = 7;
}

/**
 * Metrics surrounding the lifetime of a SIP delegate created by applications.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message SipDelegateStats {
    // The random number identifier with this SIP delegate
    optional int32 dimension = 1;

    // The carrier id associated with this SIP delegate
    optional int32 carrier_id = 2;

    // The slot id associated with this SIP delegate
    optional int32 slot_id = 3;

    // The total uptime of this delegate, rounded 5 minutes
    optional int32 uptime_seconds = 4;

    // The reason why this SIP delegate was destroyed.
    // See the SipDelegateManager#SIP_DELEGATE_DESTROY_REASON*
    optional int32 destroy_reason = 5;
}

/**
 * Tracks each feature tag associated with the SipDelegates that are currently active.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message SipTransportFeatureTagStats {
    // the carrier id associated with this SIP delegate
    // Used as a dimension
    optional int32 carrier_id = 1;

    // The slot id associated with this SIP delegate
    // Used as a dimension
    optional int32 slot_id = 2;

    // The name of the feature tag
    // used as a dimension
    optional android.telephony.ImsFeatureTag feature_tag_name = 3;

    // The reason why this feature tag was denied on the SIP Transport
    // used as a dimension
    // Use SIP transport denied reason.
    // See the SipDelegateManager#DENIED_REASON*
    optional int32 sip_transport_denied_reason = 4;

    // The reason why this feature tag was associated with the SIP Transport but not
    // marked as deregistered.
    // used as a dimension
    // Use SIP transport deregistered reason.
    // See the DelegateRegistrationState#DEREGISTERING_REASON*
    optional int32 sip_transport_deregistered_reason = 5;

    // the time this feature tag was in this state, rounded 5 minutes
    optional int32 associated_seconds = 6;
}

/**
 * Tracks each SIP message and the response from either the app or network.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message SipMessageResponse {
    enum Direction {
        UNKNOWN = 0;
        INCOMING = 1;
        OUTGOING = 2;
    }
    // the carrier id associated with this SIP delegate
    // Used as a dimension
    optional int32 carrier_id = 1;

    // The slot id associated with this SIP delegate
    // Used as a dimension
    optional int32 slot_id = 2;

    // The SIP message method type (INVITE, MESSAGE, etc...)
    // used as a dimension
    optional android.telephony.SipRequestMethodType sip_message_method = 3;

    // The SIP message response code, used if this is a response to a request.
    // used as a dimension.
    optional int32 sip_message_response = 4;

    // The SIP message direction
    // used as a dimension
    optional Direction sip_message_direction = 5;

    // The response from the SIP stack to sending/receiving the message
    // used as a dimension
    // See the SipDelegateManager#MESSAGE_FAILURE_REASON*
    optional int32 message_error = 6;

    // The number of messages that fit this criteria.
    optional int32 count = 7;
}

/**
 * Tracks SIP sessions managed by the SIP transport.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message SipTransportSession {
    enum Direction {
        UNKNOWN = 0;
        INCOMING = 1;
        OUTGOING = 2;
    }
    // the carrier id associated with this SIP delegate
    // Used as a dimension
    optional int32 carrier_id = 1;

    // The slot id associated with this SIP delegate
    // Used as a dimension
    optional int32 slot_id = 2;

    // The SIP message method that started the session (INVITE, SUBSCRIBE, etc...)
    // used as a dimension
    optional android.telephony.SipRequestMethodType session_method = 3;

    // The SIP message direction
    // used as a dimension
    optional Direction sip_message_direction = 4;

    // The response from the SIP stack or network.
    // used as a dimension.
    optional int32 sip_response = 5;

    // The number of these sessions counted
    optional int32 session_count = 6;

    // The number of sessions that were started properly and did not require
    // the SIP transport to forcefully close them.
    optional int32 ended_gracefully_count = 7;
}

/**
 * Used to determine if there were dedicated bearers set up for a specific listener.
 * If not, this indicates that there may have been a network issue in the dedicated bearer setup.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message ImsDedicatedBearerListenerEvent {
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // Radio access technology (RAT) used by the registration when it terminated.
    // The value is either 4G or 5G.
    // Used as a dimension
    optional android.telephony.NetworkTypeEnum rat_at_end = 3;

    // QoS class identifier.
    // dimension
    optional int32 qci = 4;

    // True if there was a dedicated bearer established for this listener.
    // dimension
    optional bool dedicated_bearer_established = 5;

    // The count of listeners with this result.
    optional int32 event_count = 6;
}

/**
 * Logs information related to ims dedicated bearer which fulfills required qos and provides guaranteed service.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message ImsDedicatedBearerEvent {
    enum State {
        STATE_UNSPECIFIED = 0;
        STATE_ADDED = 1;
        STATE_MODIFIED = 2;
        STATE_DELETED = 3;
    }
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // Radio access technology (RAT) used by the registration when it terminated.
    // The value is either 4G or 5G.
    // Used as a dimension
    optional android.telephony.NetworkTypeEnum rat_at_end = 3;

    // Qos class identifier.
    // Used as a dimension
    optional int32 qci = 4;

    // Dedicated bearer state from the network.
    // Used as a dimension
    optional State bearer_state = 5;

    // Whether location connection information is received.
    // Used as a dimension
    optional bool local_connection_info_received = 6;

    // Whether remote connection information is received.
    // Used as a dimension
    optional bool remote_connection_info_received = 7;

    // Whether or not the QoS indication had listeners.
    // Used as a dimension
    optional bool has_listeners = 8;

    // The count that matches the above conditions.
    optional int32 count = 9;
}

/**
 * Stats about each ServiceDescription that was included in the PIDF XML sent to the network during publish.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message ImsRegistrationServiceDescStats {
    // Describe Service IDs will be included PUBLISH
    // See RcsContactPresenceTuple.java
    enum ServiceId {
        SERVICE_ID_UNSPECIFIED = 0;
        SERVICE_ID_CUSTOM = 1;
        SERVICE_ID_MMTEL = 2;
        SERVICE_ID_CHAT_V1 = 3;
        SERVICE_ID_CHAT_V2 = 4;
        SERVICE_ID_FT = 5;
        SERVICE_ID_FT_OVER_SMS = 6;
        SERVICE_ID_GEO_PUSH = 7;
        SERVICE_ID_GEO_PUSH_VIA_SMS = 8;
        SERVICE_ID_CALL_COMPOSER = 9;
        SERVICE_ID_POST_CALL = 10;
        SERVICE_ID_SHARED_MAP = 11;
        SERVICE_ID_SHARED_SKETCH = 12;
        SERVICE_ID_CHATBOT = 13;
        SERVICE_ID_CHATBOT_STANDALONE = 14;
        SERVICE_ID_CHATBOT_ROLE = 15;
    }

    // the carrier id associated with this SIP delegate
    // Used as a dimension
    optional int32 carrier_id = 1;

    // The slot id associated with this SIP delegate
    // Used as a dimension
    optional int32 slot_id = 2;

    // The service id portion of the ServiceDescription
    // used as a dimension
    optional ServiceId service_id_name = 3;

    // The version portion of the ServiceDescription
    // used as a dimension
    optional float service_id_version = 4;

    // The underlying radio technology type associated with the feature tag
    // used as a dimension
    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
    optional int32 registration_tech = 5;

    // the time this feature tag was registered, rounded 5 minutes
    optional int32 published_seconds = 6;
}

/**
 * Stats related to UCE queries to the network
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message UceEventStats {
    enum MessageType {
        MESSAGE_TYPE_UNSPECIFIED = 0;
        PUBLISH = 1;
        SUBSCRIBE = 2;
        INCOMING_OPTION = 3;
        OUTGOING_OPTION = 4;
    }
    enum CommandCode {
        SERVICE_UNKNOWN = 0;
        GENERIC_FAILURE = 1;
        INVALID_PARAM = 2;
        FETCH_ERROR = 3;
        REQUEST_TIMEOUT = 4;
        INSUFFICIENT_MEMORY = 5;
        LOST_NETWORK_CONNECTION = 6;
        NOT_SUPPORTED = 7;
        NOT_FOUND = 8;
        SERVICE_UNAVAILABLE = 9;
        NO_CHANGE = 10;
    }
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // Used to identify the message type.
    // Used as a dimension
    optional MessageType type = 3;

    // Whether the UCE event is successfully finished. If false, the request to the
    // modem timed out and we sent a timeout error back to the requesting app.
    // Used as a dimension
    optional bool successful = 4;

    // The command error code for the Uce event. Not populated if the modem
    // accepted the request and delivered a network_response.
    // Used as a dimension
    optional CommandCode command_code = 5;

    // The network response code for the Uce event. Will not be populated if
    // command_code is present.
    // Used as a dimension
    optional int32 network_response = 6;

    // The count that matches the above conditions;
    optional int32 count = 7;
}

/**
 * Information related to a SIP NOTIFY event from modem.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message PresenceNotifyEvent {
    // See RFC3265 Section 3.2.4 for more information about these subscription states.
    enum TerminatedReason {
        REASON_UNSPECIFIED = 0;
        // Not spec defined, the network returned a custom code that is not spec defined.
        REASON_CUSTOM = 1;
        REASON_DEACTIVATED = 2;
        REASON_PROBATION = 3;
        REASON_REJECTED = 4;
        REASON_TIMEOUT = 5;
        REASON_GIVEUP = 6;
        REASON_NORESOURCE = 7;
    }

    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // The terminated reason associated with the subscription state.
    // Used as a dimension
    optional TerminatedReason reason = 3;

    // Whether or not the NOTIFY received contained at least one body with PIDF
    // content before moving to the terminated state.
    // Used as a dimension
    optional bool content_body_received = 4;

    // The count of PIDF info received that contained RCS caps.
    optional int32 rcs_caps_count = 5;

    // The count of PIDF info received that contained MMTEL caps.
    optional int32 mmtel_caps_count = 6;

    // The count of PIDF info received that contained no mmtel or RCS caps.
    optional int32 no_caps_count = 7;

    // The count that matches the above conditions;
    optional int32 count = 8;
}

/**
 * Tracks GBA requests from applications
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
 */
message GbaEvent {
    enum FailedReason {
        UNKNOWN = 0;
        FEATURE_NOT_SUPPORTED = 1;
        FEATURE_NOT_READY = 2;
        NETWORK_FAILURE = 3;
        INCORRECT_NAF_ID = 4;
        SECURITY_PROTOCOL_NOT_SUPPORTED = 5;
    }
    // Carrier ID of the SIM used for IMS registration.
    // See https://source.android.com/devices/tech/config/carrierid.
    // Used as a dimension
    optional int32 carrier_id = 1;

    // Index of the SIM used, 0 for single-SIM devices.
    // Used as a dimension
    optional int32 slot_id = 2;

    // Whether the GBA event is successful.
    // Used as a dimension
    optional bool successful = 3;

    // Gba authentication failed reason.
    // Used as a dimension
    optional FailedReason failed_reason = 4;

    // The count that matches the above conditions.
    optional int32 count = 5;
}

/*
 * Logs details of initiated UWB ranging session
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbSessionInitiated {
    // UWB profiles
    optional android.uwb.Profile profile = 1;
    // Scrambled timestamp sequence (STS) Type
    optional android.uwb.Sts sts = 2;
    // Was it an initiator as opposed to responder?
    optional bool is_initiator = 3;
    // Was it a controller as opposed to controlee?
    optional bool is_controller = 4;
    // Was the discovery done by the framework?
    optional bool is_discovered_by_framework = 5;
    // Was it out-of-band connection as opposed to in-band connection?
    // Note that this field is ignored if is_discovered_by_framework is false.
    optional bool is_out_of_band = 6;
    // UWB channel 5, 6, 9, etc.
    optional int32 channel = 7;
    // The status code of session initialization.
    optional android.uwb.Status status = 8;
    // Initialization latency in ms if is_discovered_by_framework is true.
    optional int32 latency_ms = 9;
    // Initialization latency in step size of 200 ms if is_discovered_by_framework is true.
    optional int32 latency_200ms = 10;
    // The uid of the app that initiates the connection.
    optional int32 uid = 11 [(is_uid) = true];
    // Ranging interval of the session in ms.
    optional int32 ranging_interval_ms = 12;
    // How many ongoing session when current session is initiated?
    optional int32 parallel_session_count = 13;
    // Composed value for UWB filter configurations.
    // This value combines the boolean value of multiple feature flags for
    // UWB filter configuration into one integer, where the bits of its binary value
    // are for the flags
    // Below are the flags from LSB to MSB, 1 for enabled and 0 for disabled
    // bit 0: filter_enabled
    // bit 1: enable_azimuth_mirroring
    // bit 2: enable_primer_aoa
    // bit 3: enable_primer_est_elevation
    // bit 4: enable_primer_fov
    // bit 5: predict_rear_azimuths
    // For example, when all flags are enabled this value is 63 (0b111111)
    // Refer to packages/modules/Uwb/service/ServiceUwbResources/res/values/config.xml
    // for more information about the flags
    optional int32 filter_config_value = 14;
}

/*
 * Logs details of closed UWB ranging session
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbSessionClosed {
    // UWB profiles
    optional android.uwb.Profile profile = 1;
    // Scrambled timestamp sequence (STS) Type
    optional android.uwb.Sts sts = 2;
    // Was it an initiator as opposed to responder?
    optional bool is_initiator = 3;
    // Was it a controller as opposed to controlee?
    optional bool is_controller = 4;
    // Was the connection done by the app as opposed to by the framework?
    optional bool is_framework_initiated = 5;
    // Was it out-of-band connection as opposed to in-band connection?
    // Note that this field is ignored if is_framework_initiated is false.
    optional bool is_out_of_band = 6;
    // Session active duration in seconds
    optional int32 duration_sec = 7;
    // Session active duration bucket
    optional android.uwb.DurationBucket duration_bucket = 8;
    // Total ranging measurement count
    optional int32 ranging_count = 9;
    // Valid ranging measurement count
    optional int32 valid_ranging_count = 10;
    // Ranging measurement count bucket.
    optional android.uwb.CountBucket ranging_count_bucket = 11;
    // Valid ranging measurement count bucket.
    optional android.uwb.CountBucket valid_ranging_count_bucket = 12;
    // Ranging start count
    optional int32 start_count = 13;
    // Ranging start failure count
    optional int32 start_failure_count = 14;
    // Ranging start without valid ranging result count
    optional int32 start_no_valid_report_count = 15;
    // Total Rx data packet count
    optional int32 rx_packet_count = 16;
    // Total Tx data packet count
    optional int32 tx_packet_count = 17;
    // Count of Rx data packet with error
    optional int32 rx_error_count = 18;
    // Count of Tx data packet with error
    optional int32 tx_error_count = 19;
    // Count of Rx data packets sent to upper layer
    optional int32 rx_to_upper_layer_count = 20;
    // Ranging Measurement Type
    optional android.uwb.RangingType ranging_type = 21;
}

/*
 * Logs details of start UWB ranging
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbStartRanging {
    // UWB profiles
    optional android.uwb.Profile profile = 1;
    // Scrambled timestamp sequence (STS) Type
    optional android.uwb.Sts sts = 2;
    // Was it an initiator as opposed to responder?
    optional bool is_initiator = 3;
    // Was it a controller as opposed to controlee?
    optional bool is_controller = 4;
    // Was the connection done by the app as opposed to by the framework?
    optional bool is_framework_initiated = 5;
    // Was it out-of-band connection as opposed to in-band connection?
    // Note that this field is ignored if is_framework_initiated is false.
    optional bool is_out_of_band = 6;
    // The status code of ranging start.
    optional android.uwb.RangingStatus status = 7;
}

/*
 * Log that the ranging measurement is received
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbRangingMeasurementReceived {
    // UWB profiles
    optional android.uwb.Profile profile = 1;
    // None-Line-of-sight (LOS) indication
    optional android.uwb.Nlos nlos = 2;
    // Was the distance valid?
    optional bool is_distance_valid = 3;
    // The distance measurement in centimeters.
    optional int32 distance_cm = 4;
    // The distance measurement in step size of 50 cm
    optional int32 distance_50cm = 5;
    // RSSI of ranging report, in dBm
    optional int32 rssi = 6;
    // Was azimuth angle valid?
    optional bool is_azimuth_valid = 7;
    // The azimuth angle measurement in degrees.
    optional int32 azimuth_degree = 8;
    // The azimuth angle measurement in step size of 10 degree.
    optional int32 azimuth_10degree = 9;
    // The figure of merit of azimuth angle measurement.
    optional int32 azimuth_fom = 10;
    // Was elevation angle valid?
    optional bool is_elevation_valid = 11;
    // The elevation angle measurement in degrees.
    optional int32 elevation_degree = 12;
    // The elevation angle measurement in step size of 10 degree.
    optional int32 elevation_10degree = 13;
    // The figure of merit of elevation angle measurement.
    optional int32 elevation_fom = 14;
    // Ranging Measurement Type
    optional android.uwb.RangingType ranging_type = 15;
    // The filtered distance measurement in centimeters.
    optional int32 filtered_distance_cm = 16;
    // The filtered azimuth angle measurement in degrees.
    optional int32 filtered_azimuth_degree = 17;
    // The filtered figure of merit of azimuth angle measurement.
    optional int32 filtered_azimuth_fom = 18;
    // The filtered elevation angle measurement in degrees.
    optional int32 filtered_elevation_degree = 19;
    // The filtered figure of merit of elevation angle measurement.
    optional int32 filtered_elevation_fom = 20;
}

/*
 * Log that the first ranging measurement is received
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbFirstRangingReceived {
    // UWB profiles
    optional android.uwb.Profile profile = 1;
    // The latency between the ranging start/resume and 1st ranging measurement, in ms.
    optional int32 latency_ms = 2;
    // The ranging latency in 200ms.
    optional int32 latency_200ms = 3;
}

/*
 * Log that UWB device error is detected
 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
 */
message UwbDeviceErrorReported {
    enum Type {
        UNKNOWN = 0;
        // Initialization error
        INIT_ERROR = 1;
        // Device status error
        DEVICE_STATUS_ERROR = 2;
        // UCI generic error
        UCI_GENERIC_ERROR = 3;
    }
    // Error type
    optional Type type= 1;
}

/**
 * Log that the clipboard has been cleared
 * Logged from frameworks/base/services/core/java/android/content/ClipboardAutoWipeService.java
 */
message ClipboardCleared {
    enum Source {
        SOURCE_UNKNOWN = 0;
        AUTO_CLEAR = 1;
    }

    // Source of the wipe
    optional Source source = 1;
}

/**
 * Pulls status for a SIM.
 *
 * Each pull creates multiple atoms, one for each SIM. The atom holds the status for a SIM that's
 * sensitive per carrier. The atom would be aggregated per carrier for analysis.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message PerSimStatus {
    enum WfcMode {
        UNKNOWN = 0;
        WIFI_ONLY = 1;
        CELLULAR_PREFERRED = 2;
        WIFI_PREFERRED = 3;
    }
    enum SimVoltageClass {
        VOLTAGE_CLASS_UNKNOWN = 0;
        VOLTAGE_CLASS_A = 1;
        VOLTAGE_CLASS_B = 2;
        VOLTAGE_CLASS_C = 3;
    }

    // Index of the SIM, 0 for single-SIM devices.
    optional int32 sim_slot_index = 1;

    // Carrier ID of the SIM.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 2;

    // Indicates whether phone number source UICC provides a phone number
    // and whether it agrees with other sources:
    //  - 0: no number provided
    //  - a positive integer (> 0): sources providing the same phone number
    //    shall use the same integer. The integer shall start from 1, and
    //    for each new unique source the next integer (2, 3, …) is used.
    // This way, the raw phone number cannot be derived from the value of
    // this field.
    // This also allows a quick check of conflicts: any field > 1 means conflict,
    // and the max means the count of unique phone numbers.
    optional int32 phone_number_source_uicc = 3;

    // Indicates whether phone number source CARRIER provides a phone number
    // and whether it agrees with other sources.
    // See field phone_number_source_uicc.
    optional int32 phone_number_source_carrier = 4;

    // Indicates whether phone number source IMS provides a phone number
    // and whether it agrees with other sources.
    // See field phone_number_source_uicc.
    optional int32 phone_number_source_ims = 5;

    // Indicates whether VoLTE is enabled
    optional bool volte_enabled = 6;

    // Indicates whether WFC is enabled
    optional bool wfc_enabled = 7;

    // Indicates the user's WFC mode
    optional WfcMode wfc_mode = 8;

    // Indicates the user's WFC mode when roaming
    optional WfcMode wfc_roaming_mode = 9;

    // Indicates the user's setting for video calling.
    optional bool video_calling_enabled = 10;

    // Indicates if data roaming is enabled
    optional bool data_roaming_enabled = 11;

    // Indicates the list of networks allowed by the user. Bitmask is encoded as
    // TelephonyManager#NetworkTypeBitMask.
    optional int64 allowed_networks_by_user = 12;

    // Indicates if 2G is disabled by the user using the "Allow 2G" toggle
    optional bool is_2g_disabled = 13;

    // Indicates if PIN1 of the SIM card is enabled
    optional bool is_pin1_enabled = 14;

    // Indicates the lowest voltage class supported by the SIM
    optional SimVoltageClass sim_voltage_class = 15;

    // APN type bitmask of the APNs added or modified by user:
    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
    optional int32 user_modified_apn_type_bitmask = 16;

    // Indicates the unmetered networks
    // Bitmask is encoded as TelephonyManager#NetworkTypeBitMask.
    optional int64 unmetered_networks = 17;

    // Indicates whether VoNR is enabled
    optional bool vonr_enabled = 18;

    // Indicates whether cross-SIM calling (WiFi calling over cellular data) is
    // enabled.
    optional bool cross_sim_calling_enabled = 19;
}

/*
 * Logs Device Scan State events generated by Nearby Scan API.
 */
message NearbyDeviceScanStateChanged {
  // Uid of the client that triggers the Nearby scan.
  optional int32 uid = 1 [(is_uid) = true];

  // Scan start timestamp as session id.
  optional int64 scan_session_id = 2;

  // Scan state.
  optional android.nearby.NearbyScanState scan_state = 3;

  // Scan type.
  optional android.nearby.NearbyScanType scan_type = 4;

  // Medium that this device was discovered/lost.
  optional android.nearby.NearbyNetworkMedium network_medium = 5;

  // Received Signal Strength Indication (RSSI) value of the device discovered/lost.
  optional int32 rssi = 6;

  // Model of the device discovered/lost.
  optional string scanned_device_model = 7;

  // Manufacturer of the device discovered/lost.
  optional string scanned_device_manufacturer = 8;
}

/**
 * Logs when locales of an application are changed.
 * Logged from
 *   frameworks/base/services/core/java/com/android/server/locales/LocaleManagerService.java
 */
message ApplicationLocalesChanged {
    // The uid which invoked this update. The locales for an application
    // could be changed from the in-app picker OR from the settings UI.
    optional int32 calling_uid = 1 [(is_uid) = true];

    // The uid for which the locale change is being done.
    optional int32 target_uid = 2 [(is_uid) = true];

    // The new locales for the target package. A comma separated list of BCP 47
    // locale identifiers, compatible with LocaleList#forLanguageTags.
    optional string new_locales = 3;

    // The previous locales for the target package. A comma separated list of
    // BCP 47 locale identifiers, compatible with LocaleList#forLanguageTags.
    optional string prev_locales = 4;

    // Application locales changed status.
    enum Status {
        // A placeholder for unspecified values.
        STATUS_UNSPECIFIED = 0;

        // New locales were committed.
        CONFIG_COMMITTED = 1;

        // Likely because no change is required.
        CONFIG_UNCOMMITTED = 2;

        // Failed because the target package is invalid.
        FAILURE_INVALID_TARGET_PACKAGE = 3;

        // Failed because the calling package does not have the required permission.
        FAILURE_PERMISSION_ABSENT = 4;
    }

    optional Status status = 5;

    // The caller where changes application locales.
    enum Caller {
        // A placeholder for unknown value.
        CALLER_UNKNOWN = 0;

        // The change was called from the delegate.
        CALLER_DELEGATE = 1;

        // The change was called from Apps.
        CALLER_APPS = 2;

        // The change was called from the system due to backup and restore.
        CALLER_BACKUP_RESTORE = 3;

        // The change was called from the system when the app languages
        // feature or the set per-app locales was changed from opt-in to
        // opt-out.
        CALLER_APP_UPDATE_LOCALES_CHANGE = 4;

        // The change was called from the system due to the dynamic locales
        // change.
        CALLER_DYNAMIC_LOCALES_CHANGE = 5;
    }

    optional Caller caller = 6;
}

/* Logs when the display HBM state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/display/HighBrightnessModeController.java
 */
message DisplayHbmStateChanged {
    optional int32 display_id = 1;

    // New HBM state
    optional android.server.display.HbmState state = 2;

    // The reason the state changes.
    optional android.server.display.HbmStateTransitionReason reason = 3;
}

/*
 * Logs when the display HBM brightness changes.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessControllerjava
 */
message DisplayHbmBrightnessChanged {
    optional int32 display_id = 1;

    // display brightness
    optional float brightness = 2;
}

/**
 * Per-UID time spent running work on the GPU.
 *
 * Each pull creates multiple atoms, one per (GPU ID, UID) pair, for at most 10
 * randomly selected UIDs.
 *
 * Pulled from:
 *    frameworks/native/services/gpuservice/gpuwork/GpuWork.cpp
 */
message GpuWorkPerUid {
  // The UID (i.e. app id) that scheduled work on the GPU.
  optional int32 uid = 1 [(is_uid) = true];

  // The GPU ID for which we have work information.
  optional int32 gpu_id = 2;

  // The time duration (in seconds) over which this data was collected (most
  // likely 24 hours).
  optional int32 time_duration_seconds = 3;

  // The total amount of time (in milliseconds) the GPU spent running work for
  // |uid|.
  optional int32 total_active_duration_millis = 4;

  // The total amount of time (in milliseconds) the GPU was inactive while
  // running "continuous" work for |uid|. This is estimated by adding up the
  // duration of the small gaps between GPU work for |uid|.
  optional int32 total_inactive_duration_millis = 5;
}

/**
 * Logs when entries are dropped in DropBox and the reason for the drop.
 *
 * Logged from: frameworks/base/services/
 */
message DropboxEntryDropped {
    // Explains at which stage of the DropBox workflow the entry was dropped.
    enum DropReason {
        UNKNOWN = 0;
        CLEARING_DATA = 3;
        AGED = 4;
        WRITE_FAILURE = 5;
        ENTRY_TOO_LARGE = 6;

        reserved 1, 2;
    }

    optional DropReason drop_reason = 1;

    // Tag describing the type of dropbox entry.
    optional string tag = 2;

    // The age (millis) of the dropped dropbox entry.
    optional int64 age_millis = 3;
}

message PersistentUriPermissionsFlushed {
    // Current amount of persistent uri permissions overall
    optional int32 permissions_flushed_amount = 1;
}

message PersistentUriPermissionsAmountPerPackage {
    // The uid persistent uri permissions amount reported for
    optional int32 uid = 1 [(is_uid) = true];
    // Current amount of persistent uri permissions for this package
    optional int32 amount = 2;
}

/**
 * VBMeta Digest cryptographically encapsulates the composition of signed images or partitions of
 * a particular build.
 *
 * Logs when boot is complete.
 * Pushed from:
 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
 */
message VBMetaDigestReported {
    // the hex encoded string of VBMeta Digest value
    optional string vbmeta_digest = 1;
}

/**
 * APEXs can either be signed by Google or OEMs. This atom captures basic metadata of APEXs
 * pre-installed on a build or a device.
 *
 * Logs when boot is complete.
 * Pushed from:
 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
 */
message ApexInfoGathered {
    // APEX package names are determined by OEMs
    optional string package_name = 1;
    // the version code of the APEX
    optional int64 version_code = 2;

    // the hex encoded value of digest of the content of this APEX
    // we are deprecating the use of this going forward
    optional string content_digest = 3;

    // the algorithm that the content digest is computed
    optional com.android.os.transparency.DigestAlgorithmType algo_type = 4;

    // the SHA256 digest(s) of the APEX's signer certificate(s)
    repeated string signer_sha256_digest = 5;
}

/**
 * MobileBundledApps (MBAs) include preloaded apps and apps that are installed in the background
 * without user knowledge/consent.
 *
 * However, note that we will only be recording *updated* preloaded apps + dynamic MBAs.
 *
 * Pushed from:
 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
 *
 * Next ID: 12
 */
message MobileBundledAppInfoGathered {
    // MBA package names are determined by developers (which can include OEMs)
    optional string package_name = 1;
    // the package version code of the MBA
    optional int64 version_code = 2;
    // the split name (empty if it's the base)
    optional string split_name = 11;

    // the hex encoded value of digest of the content of the MBA
    optional string content_digest = 3;
    // the algorithm that the content_digest is computed
    optional com.android.os.transparency.DigestAlgorithmType algo_type = 4;
    // the SHA256 digest(s) of the APEX's signer certificate(s)
    repeated string signer_sha256_digest = 5;

    enum MBAStatus {
        ERROR = 0;
        PRELOADED = 1;
        UPDATED_PRELOAD = 2;
        NEW_MBA = 3;
        UPDATED_NEW_MBA = 4;
    }
    // whether or not the MBA is preloaded or dynamically installed
    optional MBAStatus mba_status = 6;
    // the package that initiated the installation of this MBA
    optional string initiator = 7;
    // the SHA256 digest(s) of the initiator's signer certificate(s)
    repeated string initiator_signer_sha256_digest = 8;
    // the package that installs this MBA
    optional string installer = 9;
    // the package on behalf of which initiator requested the installation of this MBA
    optional string originator = 10;
}

/**
 * PVM is protected virtual machine. This atom captures the notion of a container
 * that describes a virtual machine.
 *
 * Will be pushed from:
 *      frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
 */
message PvmInfoGathered {
    // PVM names are determined by OEMs
    optional string name = 1;
    // an int describing the version of the VM
    optional int64 version = 2;
    // the hex encoded SHA256 digest of the pvm descriptor file
    optional string sha256_digest = 3;
}

/**
 * This will be pulled from
 *     frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
 */
message SignedPartitionInfo {
    // partition name (e.g. vendor, product) is determined by OEM
    optional string partition_name = 1;
    // the hex encoded SHA256 digest of the partition image file
    optional string sha256_digest = 2;
}

/**
 * Logs when Wear Settings UI is interacted with
 */
message WearSettingsUIInteracted {
    /** The UI action category */
    optional android.app.wearsettings.Action action = 1;

    /** The ID of the entry that the users actioned on. */
    optional android.app.wearsettings.ItemId item_id = 2;
}

message TracingServiceReportEvent {
    enum Event {
      TRACING_SERVICE_REPORT_UNDEFINED = 0;

      // Checkpoints inside TracingServiceProxy.
      TRACING_SERVICE_REPORT_BEGIN = 1;
      TRACING_SERVICE_REPORT_SVC_HANDOFF = 2;

      // Guardrails inside TracingServiceProxy.
      TRACING_SERVICE_REPORT_BIND_PERM_INCORRECT = 3;
      TRACING_SERVICE_REPORT_SVC_PERM_MISSING = 4;
      TRACING_SERVICE_REPORT_SVC_COMM_ERROR = 5;
  }

  // Which stage of the pipeline we are reporting from.
  optional Event event = 1;

  // UUID of the trace.
  optional int64 trace_uuid_lsb = 2;
  optional int64 trace_uuid_msb = 3;
}

/** Pulled from PinnerService. */
message PinnedFileSizesPerPackage {
    // If the file is pinned but not as part of a specific pinned app,
    // this will be set to 1000 - the value of system_server.
    optional int32 uid = 1 [(is_uid) = true];

    // Consists of only the pinned file's filename, not its full path; for example
    // Given a pinned file at ‘/vendor/lib64/libCB.so’, then this field will be
    // Determined to have have the value ‘libCB.so’.
    optional string filename = 2;

    // The size of the pinned file, in kilobytes.
    optional int32 size_kb = 3;
}

/** Pulled from PendingIntentController. */
message PendingIntentsPerPackage {
    // The UID of the app that sent the PendingIntent.
    optional int32 uid = 1 [(is_uid) = true];
    // The total number of currently active PendingIntents belonging to this uid.
    optional int32 pending_intent_count = 2;
    // The total size of all currently active PendingIntents belonging to this uid, in kilobytes.
    optional int32 pending_intent_total_bundle_size_kb = 3;
}

/*
 * Logs changes to game state set by game applications via GameService.
 */
message GameStateChanged {
    enum State {
        // Game mode is unknown.
        MODE_UNKNOWN = 0;

        // The game is not in active play, e.g.e the user is using a game menu.
        MODE_NONE = 1;

        // The game is in active, but interruptible, game play.
        MODE_GAMEPLAY_INTERRUPTIBLE = 2;

        // The game is in active user play mode, which cannot be interrupted.
        MODE_GAMEPLAY_UNINTERRUPTIBLE = 3;

        // The current content shown is not gameplay related (e.g. an ad).
        MODE_CONTENT = 4;
    }

    // Provided to ensure package is available even with UID sharing.
    optional string package_name = 1;

    // The UID (i.e. app id).
    optional int32 uid = 2 [(is_uid) = true];

    // Whether the device enabled performance boost when the state was changed.
    optional bool boost_enabled = 3;

    // This includes a top-level state for the game.
    optional State state = 4;

    // Indicates if the game is loading assets/resources/compiling/etc.
    optional bool is_loading = 5;

    // A developer-selected enum, for example to indicate level or scene.
    optional int32 label = 6;

    // A developer-supplied enum, e.g. to indicate the current quality level.
    optional int32 quality = 7;
}

/**
 *  Logs for a background fetch process when the runBackgroundFetch() is called.
 */
message BackgroundFetchProcessReported {
    optional int32 latency_in_millis = 1;
    optional int32 num_of_eligible_to_update_cas = 2;
    optional int32 result_code = 3;
}

/**
 *  Logs for an updating a single custom audience process when the updateCustomAudience() is called.
 */
message UpdateCustomAudienceProcessReported {
    optional int32 latency_in_millis = 1;
    optional int32 result_code = 2;
    optional int32 data_size_of_ads_in_bytes = 3;
    optional int32 num_of_ads = 4;
}

/**
 * Logs for the bidding stage of an ad selection process when the getBuyersCustomAudience() or
 * the runAdBidding() is called.
 */
message RunAdBiddingProcessReported {
    /* Logs when the getBuyersCustomAudience() is called. */
    optional int32 get_buyers_custom_audience_latency_in_millis = 1;
    optional int32 get_buyers_custom_audience_result_code = 2;
    optional int32 num_buyers_requested = 3;
    optional int32 num_buyers_fetched = 4;

    /* Logs when the runAdBidding() is called. */
    optional int32 num_of_ads_entering_bidding = 5;
    optional int32 num_of_cas_entering_bidding = 6;
    optional int32 num_of_cas_post_bidding = 7;
    optional float ratio_of_cas_selecting_rmkt_ads = 8;
    optional int32 run_ad_bidding_latency_in_millis = 9;
    optional int32 run_ad_bidding_result_code = 10;

    /* Time from the start of the getBuyersCustomAudience() to the end of the runAdBidding(). */
    optional int32 total_ad_bidding_stage_latency_in_millis = 11;
}

/**
 * Logs for the scoring stage of an ad selection process when the runAdScoring() is called.
 */
message RunAdScoringProcessReported {
    /* Logs when the getAdSelectionLogic() is called. */
    optional int32 get_ad_selection_logic_latency_in_millis = 1;
    optional int32 get_ad_selection_logic_result_code = 2;
    optional android.adservices.service.ScriptType get_ad_selection_logic_script_type = 3;
    optional int32 fetched_ad_selection_logic_script_size_in_bytes = 4;

    /* Logs when the getTrustedScoringSignals() is called. */
    optional int32 get_trusted_scoring_signals_latency_in_millis = 5;
    optional int32 get_trusted_scoring_signals_result_code = 6;
    optional int32 fetched_trusted_scoring_signals_data_size_in_bytes = 7;

    /* Logs when the getAdScores() is called. */
    // the total scoreAds script execution time when getAdScores() is called.
    optional int32 score_ads_latency_in_millis = 8;
    // the overall latency of the getAdScores().
    optional int32 get_ad_scores_latency_in_millis = 9;
    optional int32 get_ad_scores_result_code = 10;

    optional int32 num_of_cas_entering_scoring = 11;
    optional int32 num_of_remarketing_ads_entering_scoring = 12;
    optional int32 num_of_contextual_ads_entering_scoring = 13;
    // the overall latency of the runAdScoring process.
    optional int32 run_ad_scoring_latency_in_millis = 14;
    optional int32 run_ad_scoring_result_code = 15;
}

/* Logs for the ad selection process when the runAdSelection() is called.*/
message RunAdSelectionProcessReported {
    /* Logs for the persisting ad selection process. */
    optional bool is_remarketing_ads_won = 1;
    optional int32 db_ad_selection_size_in_bytes = 2;
    optional int32 persist_ad_selection_latency_in_millis = 3;
    optional int32 persist_ad_selection_result_code = 4;

    /* Logs for the overall runAdSelection process. */
    optional int32 run_ad_selection_latency_in_millis = 5;
    optional int32 run_ad_selection_result_code = 6;
}

/**
 *  Logs for the bidding process on a single custom audience when the runAdBiddingPerCA() is called.
 */
message RunAdBiddingPerCAProcessReported {
    optional int32 num_of_ads_for_bidding = 1;
    optional int32 run_ad_bidding_per_ca_latency_in_millis = 2;
    optional int32 run_ad_bidding_per_ca_result_code = 3;

    /* Logs for the getting buyer's decision logic script process. */
    optional int32 get_buyer_decision_logic_latency_in_millis = 4;
    optional int32 get_buyer_decision_logic_result_code = 5;
    optional android.adservices.service.ScriptType buyer_decision_logic_script_type = 6;
    optional int32 fetched_buyer_decision_logic_script_size_in_bytes = 7;

    /* Logs for the getting trusted bidding signals process. */
    optional int32 num_of_keys_of_trusted_bidding_signals = 8;
    optional int32 fetched_trusted_bidding_signals_data_size_in_bytes = 9;
    optional int32 get_trusted_bidding_signals_latency_in_millis = 10;
    optional int32 get_trusted_bidding_signals_result_code = 11;

    /* Logs when runBidding() is called. */
    // the total generateBids script execution time when runBidding() is called..
    optional int32 generate_bids_latency_in_millis = 12;
    // the overall latency of runBidding().
    optional int32 run_bidding_latency_in_millis = 13;
    optional int32 run_bidding_result_code = 14;
}

/**
 * Logs for AdServices GetTopics API call on T+ only due to repeated fields.
 * Keep in sync with AdServicesBackCompatGetTopicsReported for R+ logging.
 */
message AdServicesGetTopicsReported {
    // List of topic ids returned.
    repeated int32 topic_ids = 1;

    // Number of filtered duplicate topics.
    optional int32 duplicate_topic_count = 2;

    // Number of filtered blocked topics.
    optional int32 filtered_blocked_topic_count = 3;

    // Number of topic ids returned.
    optional int32 count_of_topic_ids = 4;
}

/**
 * Logs for AdServices Epoch computation GetTopTopics.
 */
message AdServicesEpochComputationGetTopTopicsReported {
    // Number of top topics generated.
    optional int32 top_topics_count = 1;

    // Number of padded random topics generated.
    optional int32 padded_random_topics_count = 2;

    // Number of apps considered for calculating top topics.
    optional int32 apps_considered_count = 3;

    // Number of sdks that called Topics API in the epoch.
    optional int32 sdks_considered_count = 4;
}

/**
 * Logs for AdServices Epoch Computation Classifier on T+ only due to repeated fields.
 * Keep in sync with AdServicesBackCompatEpochComputationClassifierReported for R+ logging.
 * One atom should be logged for each app classification.
 */
message AdServicesEpochComputationClassifierReported {

    // List of topics returned by the classifier for each app. The classification
    // does not depend on the user's usage of the app.
    repeated int32 topic_ids = 1;

    // Build id of the assets.
    optional int32 build_id = 2;

    // Version of the assets used.
    optional string asset_version = 3;

    // Type of the classifier used for classifying apps.
    enum ClassifierType {
       /** Unknown classifier option. */
       UNKNOWN_CLASSIFIER = 0;
       /** Only on-device classification. */
       ON_DEVICE_CLASSIFIER = 1;
       /** Only Precomputed classification. */
       PRECOMPUTED_CLASSIFIER = 2;
       /** Precomputed classification values are preferred over on-device classification values. */
       PRECOMPUTED_THEN_ON_DEVICE_CLASSIFIER = 3;
    }
    optional ClassifierType classifier_type = 4;

    // On Device classifier status.
    enum OnDeviceClassifierStatus {
       ON_DEVICE_CLASSIFIER_STATUS_UNSPECIFIED = 0;
       ON_DEVICE_CLASSIFIER_STATUS_NOT_INVOKED = 1;
       ON_DEVICE_CLASSIFIER_STATUS_SUCCESS = 2;
       ON_DEVICE_CLASSIFIER_STATUS_FAILURE = 3;
    }
    optional OnDeviceClassifierStatus on_device_classifier_status = 5;

    // Precomputed classifier status.
    enum PrecomputedClassifierStatus {
       PRECOMPUTED_CLASSIFIER_STATUS_UNSPECIFIED = 0;
       PRECOMPUTED_CLASSIFIER_STATUS_NOT_INVOKED = 1;
       PRECOMPUTED_CLASSIFIER_STATUS_SUCCESS = 2;
       PRECOMPUTED_CLASSIFIER_STATUS_FAILURE = 3;
    }
    optional PrecomputedClassifierStatus precomputed_classifier_status = 6;
}

/**
 * Logs when an AdServices api is called.
 */
message AdServicesApiCalled {
    // The name of the api that was called.
    // Can be classified as one of the following:
    //
    // Targeting
    //  * GetTopics()
    //
    // FLEDGE
    //  * joinCustomAudience()
    //  * leaveCustomAudience()
    //  * overrideCustomAudienceRemoteInfo()
    //  * removeCustomAudienceRemoteInfoOverride()
    //  * resetAllCustomAudienceOverrides()
    //  * selectAds()
    //  * reportImpression()
    //  * overrideAdSelectionConfigRemoteInfo()
    //  * removeAdSelectionConfigRemoteInfoOverride()
    //  * resetAllAdSelectionConfigRemoteOverrides()
    //  * setAppInstallAdvertisers()
    //  * reportInteraction()
    //  * updateAdCounterHistogram()
    //  * fetchAndJoinCustomAudience()
    //
    // Measurement - client side
    //   * register() : SOURCE
    //   * register() : TRIGGER
    //   * deleteRegistrations()
    //   * registerWebSource()
    //   * registerWebTrigger()
    //   * getMeasurementApiStatus()
    //   * registerSource() : accepts a list of source registration URIs
    //
    // AdId
    //   * GetAdId()
    //
    // AppsetId
    //   * GetAppsetId()
    //
    // AdExtDataService
    //   * onGetAdServicesExtData()
    //   * onPutAdServicesExtData()


    enum AdServicesApiClassType {
        UNKNOWN = 0;
        TARGETING = 1;
        FLEDGE = 2;
        MEASUREMENT = 3;
        ADID = 4;
        APPSETID = 5;
        ADEXT_DATA_SERVICE = 6;
    }

    enum AdServicesApiName {
        API_NAME_UNKNOWN = 0;
        GET_TOPICS = 1;
        JOIN_CUSTOM_AUDIENCE = 2;
        LEAVE_CUSTOM_AUDIENCE = 3;
        SELECT_ADS = 4;
        REGISTER_SOURCE = 5;
        DELETE_REGISTRATIONS = 6;
        REPORT_IMPRESSION = 7;
        OVERRIDE_CUSTOM_AUDIENCE_REMOTE_INFO = 8;
        REMOVE_CUSTOM_AUDIENCE_REMOTE_INFO_OVERRIDE = 9;
        RESET_ALL_CUSTOM_AUDIENCE_OVERRIDES = 10;
        OVERRIDE_AD_SELECTION_CONFIG_REMOTE_INFO = 11;
        REMOVE_AD_SELECTION_CONFIG_REMOTE_INFO_OVERRIDE = 12;
        RESET_ALL_AD_SELECTION_CONFIG_REMOTE_OVERRIDES = 13;
        GET_ADID = 14;
        GET_APPSETID = 15;
        REGISTER_TRIGGER = 16;
        REGISTER_WEB_SOURCE = 17;
        REGISTER_WEB_TRIGGER = 18;
        GET_MEASUREMENT_API_STATUS = 19;
        GET_TOPICS_PREVIEW_API = 20;
        SELECT_ADS_FROM_OUTCOMES = 21;
        SET_APP_INSTALL_ADVERTISERS = 22;
        REPORT_INTERACTION = 23;
        UPDATE_AD_COUNTER_HISTOGRAM = 24;
        FETCH_AND_JOIN_CUSTOM_AUDIENCE = 25;
        REGISTER_SOURCES = 26;
        GET_AD_SERVICES_EXT_DATA = 27;
        PUT_AD_SERVICES_EXT_DATA = 28;
    }

    optional AdServicesApiClassType api_class = 1 [deprecated = true];

    // The actual name of the api within the 3 classes described above.
    optional AdServicesApiName  api_name = 2;

    optional string app_package_name = 3; // [(datapol.semantic_type) = ST_SOFTWARE_ID, (contains_pii) = false]
    optional string sdk_package_name = 4;

    optional int32 latency_millis = 5;

    // response_code is the error/failure code for the given api.
    optional int32 response_code = 6;
}

/**
 * Logs when an AdServices measurement reports are being uploaded.
 */
message AdServicesMeasurementReportsUploaded {
    enum ReportType {
        UNKNOWN_REPORT = 0;
        EVENT = 1;
        AGGREGATE = 2;
        DEBUG_EVENT = 3;
        DEBUG_AGGREGATE = 4;
        VERBOSE_DEBUG_SOURCE_DESTINATION_LIMIT = 5;
        VERBOSE_DEBUG_SOURCE_NOISED = 6;
        VERBOSE_DEBUG_SOURCE_STORAGE_LIMIT = 7;
        VERBOSE_DEBUG_SOURCE_SUCCESS = 8;
        VERBOSE_DEBUG_SOURCE_UNKNOWN_ERROR = 9;
        VERBOSE_DEBUG_SOURCE_FLEXIBLE_EVENT_REPORT_VALUE_ERROR = 10;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_DEDUPLICATED = 11;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_INSUFFICIENT_BUDGET = 12;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_NO_CONTRIBUTIONS = 13;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_REPORT_WINDOW_PASSED = 14;
        VERBOSE_DEBUG_TRIGGER_ATTRIBUTIONS_PER_SOURCE_DESTINATION_LIMIT = 15;
        VERBOSE_DEBUG_TRIGGER_EVENT_DEDUPLICATED = 16;
        VERBOSE_DEBUG_TRIGGER_EVENT_EXCESSIVE_REPORTS = 17;
        VERBOSE_DEBUG_TRIGGER_EVENT_LOW_PRIORITY = 18;
        VERBOSE_DEBUG_TRIGGER_EVENT_NO_MATCHING_CONFIGURATIONS = 19;
        VERBOSE_DEBUG_TRIGGER_EVENT_NOISE = 20;
        VERBOSE_DEBUG_TRIGGER_EVENT_REPORT_WINDOW_PASSED = 21;
        VERBOSE_DEBUG_TRIGGER_NO_MATCHING_FILTER_DATA = 22;
        VERBOSE_DEBUG_TRIGGER_NO_MATCHING_SOURCE = 23;
        VERBOSE_DEBUG_TRIGGER_REPORTING_ORIGIN_LIMIT = 24;
        VERBOSE_DEBUG_TRIGGER_EVENT_STORAGE_LIMIT = 25;
        VERBOSE_DEBUG_TRIGGER_UNKNOWN_ERROR = 26;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_STORAGE_LIMIT = 27;
        VERBOSE_DEBUG_TRIGGER_AGGREGATE_EXCESSIVE_REPORTS = 28;
        VERBOSE_DEBUG_UNKNOWN = 29;
    }

    optional ReportType type = 1;

    enum ReportUploadStatus {
        UNKNOWN_STATUS = 0;
        SUCCESS = 1;
        FAILURE = 2;
    }

    optional ReportUploadStatus response_code = 2;
    optional android.adservices.service.measurement.ReportUploadFailureType failure_type = 3;
    optional android.adservices.service.measurement.ReportUploadMethod upload_method = 4;
    // delay (in milliseconds) between scheduled delivery time and actual delivery time.
    optional int64 reporting_delay_millis = 5;
    optional string app_package_name = 6; // [(datapol.semantic_type) = ST_SOFTWARE_ID, (contains_pii) = false]
    optional int32 retry_count = 7;
    optional int32 http_response_code = 8;
    optional bool is_marked_for_deletion = 9;
}

/**
 * Logs registration response size when registration URI is pinged.
 */
message AdServicesMeasurementRegistrations {
    enum RegistrationType {
        UNKNOWN_REGISTRATION = 0;
        SOURCE = 1;
        TRIGGER = 2;
    }

    optional RegistrationType type = 1;
    optional int64 response_size_in_bytes = 2;
    optional string adtech_url_domain_if_size_above_threshold = 3;
    optional android.adservices.service.measurement.SourceType source_type = 4;
    optional android.adservices.service.measurement.RegistrationSurfaceType surface_type = 5;
    optional android.adservices.service.measurement.Status status = 6;
    optional android.adservices.service.measurement.RegistrationFailureType failure_type = 7;
    // delay (in milliseconds) between registration queue request and the time it gets processed
    optional int64 registration_delay_millis = 8;
    optional string app_package_name = 9; // [(datapol.semantic_type) = ST_SOFTWARE_ID, (contains_pii) = false]
    optional int32 retry_count = 10;
    optional int32 http_response_code = 11;
    optional bool is_redirect = 12;
}

/**
 * Log the duration of executing all receivers of LOCKED_BOOT_COMPLETED or BOOT_COMPLETED broadcast.
 * The dispatch latency is the dispatchTime - enqueueTime.
 * The completion latency is the completeTime - enqueueTime.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
 */
message BootCompletedBroadcastCompletionLatencyReported {
    enum Event {
        UNKNOWN = 0;
        LOCKED_BOOT_COMPLETED = 1;
        BOOT_COMPLETED = 2;
    }

    optional Event event = 1;
    // from enqueueTime to dispatchTime.
    optional int32 dispatch_latency_uptime_millis = 2;
    // from enqueueTime to completeTime.
    optional int32 complete_latency_uptime_millis = 3;
    // from enqueueRealTime to dispatchRealTime.
    optional int32 dispatch_latency_realtime_millis = 4;
    // from enqueueRealTime to completeRealTime.
    optional int32 complete_latency_realtime_millis = 5;

    optional int32 user_id = 6;
    optional UserLifecycleJourneyReported.UserType user_type = 7;
}

/**
 * Log that the permission reminder notification has been displayed or clicked.
 */
message PermissionReminderNotificationInteracted {
    // id which identifies single session of user interacting with permission
    // controller
    optional int64 session_id = 1;

    enum Result {
        UNDEFINED = 0;
        // notification was presented to the user
        NOTIFICATION_PRESENTED = 1;
        // notification was clicked by the user
        NOTIFICATION_CLICKED = 2;
    }

    // View / interaction recorded
    optional Result result = 2;
}

/**
 * Log that the user has interacted with the permission decision screen.
 */
message RecentPermissionDecisionsInteracted {
    // id which identifies single session of user interacting with permission
    // controller
    optional int64 session_id = 1;

    enum Action {
        ACTION_UNKNOWN = 0;
        SCREEN_VIEWED = 1;
        REVIEW_DECISION = 2;
        VIEW_ALL_CLICKED = 3;
    }

    // Action taken on the recent permission decisions page.
    optional Action action = 2;

    // Uid of the package for the permission decision being reviewed
    optional int32 uid = 3 [(is_uid) = true];

    // Name of the permission for the permission decision being reviewed.
    optional string permission_group_name = 4;
}

/**
 * Logs information about app background restrictions.
 *
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/AppRestrictionController.java
 */
message AppBackgroundRestrictionsInfo {
    // the uid of the app.
    optional int32 uid = 1 [(is_uid) = true];

    enum RestrictionLevel {
        LEVEL_UNKNOWN = 0;
        LEVEL_UNRESTRICTED = 1;
        LEVEL_EXEMPTED = 2;
        LEVEL_ADAPTIVE_BUCKET = 3;
        LEVEL_RESTRICTED_BUCKET = 4;
        LEVEL_BACKGROUND_RESTRICTED = 5;
        LEVEL_HIBERNATION = 6;
    }
    // indicates the app background restriction level.
    optional RestrictionLevel restriction_level = 2;

    enum Threshold {
        THRESHOLD_UNKNOWN = 0;
        THRESHOLD_RESTRICTED = 1; // app was background restricted by the system.
        THRESHOLD_USER = 2; // app was background restricted by user action.
    }
    // indicates which threshold caused the app to be put into bg restriction.
    optional Threshold threshold = 3;

    enum StateTracker {
        UNKNOWN_TRACKER = 0;
        BATTERY_TRACKER = 1;
        BATTERY_EXEMPTION_TRACKER = 2;
        FGS_TRACKER = 3;
        MEDIA_SESSION_TRACKER = 4;
        PERMISSION_TRACKER = 5;
        BROADCAST_EVENTS_TRACKER = 6;
        BIND_SERVICE_EVENTS_TRACKER = 7;
    }
    // indicates the reason/tracker which caused the app to hit the threshold.
    optional StateTracker tracker = 4;

    message FgsTrackerInfo {
        // indicates whether an fgs notification was visible for this app or not.
        optional bool fgs_notification_visible = 1;
        // total FGS duration for this app.
        optional int64 fgs_duration = 2;
    }
    optional FgsTrackerInfo fgs_tracker_info = 5 [(log_mode) = MODE_BYTES];

    message BatteryTrackerInfo {
        // total battery usage within last 24h (1/10000th)
        optional int32 battery_24h = 1;
        // background battery usage (1/10000th)
        optional int32 battery_usage_background = 2;
        // FGS battery usage (1/10000th)
        optional int32 battery_usage_fgs = 3;
        // Foreground battery usage (1/10000th)
        optional int32 battery_usage_foreground = 4;
        // Cached battery usage (1/10000th)
        optional int32 battery_usage_cached = 5;
    }
    optional BatteryTrackerInfo battery_tracker_info = 6 [(log_mode) = MODE_BYTES];

    message BroadcastEventsTrackerInfo {
        // the number of broadcasts sent by this app.
        optional int32 broadcasts_sent = 1;
    }
    optional BroadcastEventsTrackerInfo broadcast_events_tracker_info = 7 [(log_mode) = MODE_BYTES];

    message BindServiceEventsTrackerInfo {
        // the number of bind service requests by this app.
        optional int32 bind_service_requests = 1;
    }
    optional BindServiceEventsTrackerInfo bind_service_events_tracker_info =
        8 [(log_mode) = MODE_BYTES];

    // The reasons listed below are defined in PowerExemptionManager.java
    enum ExemptionReason {
        // range 0-9 is reserved for default reasons
        REASON_UNKNOWN = 0;
        REASON_DENIED = 1;
        REASON_OTHER = 2;
        // range 10-49 is reserved for BG-FGS-launch allowed proc states
        REASON_PROC_STATE_PERSISTENT = 10;
        REASON_PROC_STATE_PERSISTENT_UI = 11;
        REASON_PROC_STATE_TOP = 12;
        REASON_PROC_STATE_BTOP = 13;
        REASON_PROC_STATE_FGS = 14;
        REASON_PROC_STATE_BFGS = 15;
        // range 50-99 is reserved for BG-FGS-launch allowed reasons
        REASON_UID_VISIBLE = 50;
        REASON_SYSTEM_UID = 51;
        REASON_ACTIVITY_STARTER = 52;
        REASON_START_ACTIVITY_FLAG = 53;
        REASON_FGS_BINDING = 54;
        REASON_DEVICE_OWNER = 55;
        REASON_PROFILE_OWNER = 56;
        REASON_COMPANION_DEVICE_MANAGER = 57;
        REASON_BACKGROUND_ACTIVITY_PERMISSION = 58;
        REASON_BACKGROUND_FGS_PERMISSION = 59;
        REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION = 60;
        REASON_INSTR_BACKGROUND_FGS_PERMISSION = 61;
        REASON_SYSTEM_ALERT_WINDOW_PERMISSION = 62;
        REASON_DEVICE_DEMO_MODE = 63;
        REASON_ALLOWLISTED_PACKAGE = 65;
        REASON_APPOP = 66;
        REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67;
        REASON_OP_ACTIVATE_VPN = 68;
        REASON_OP_ACTIVATE_PLATFORM_VPN = 69;
        REASON_TEMP_ALLOWED_WHILE_IN_USE = 70;
        REASON_CURRENT_INPUT_METHOD = 71;
        // range 100-199 is reserved for public reasons
        REASON_GEOFENCING = 100;
        REASON_PUSH_MESSAGING = 101;
        REASON_PUSH_MESSAGING_OVER_QUOTA = 102;
        REASON_ACTIVITY_RECOGNITION = 103;
        REASON_ACCOUNT_TRANSFER = 104;
        // range 200-299 is reserved for broadcast actions
        REASON_BOOT_COMPLETED = 200;
        REASON_PRE_BOOT_COMPLETED = 201;
        REASON_LOCKED_BOOT_COMPLETED = 202;
        REASON_BLUETOOTH_BROADCAST = 203;
        REASON_TIMEZONE_CHANGED = 204;
        REASON_TIME_CHANGED = 205;
        REASON_LOCALE_CHANGED = 206;
        REASON_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED = 207;
        REASON_REFRESH_SAFETY_SOURCES = 208;
        // range 300-399 is reserved for other internal reasons
        REASON_SYSTEM_ALLOW_LISTED = 300;
        REASON_ALARM_MANAGER_ALARM_CLOCK = 301;
        REASON_ALARM_MANAGER_WHILE_IDLE = 302;
        REASON_SERVICE_LAUNCH = 303;
        REASON_KEY_CHAIN = 304;
        REASON_PACKAGE_VERIFIER = 305;
        REASON_SYNC_MANAGER = 306;
        REASON_DOMAIN_VERIFICATION_V1 = 307;
        REASON_DOMAIN_VERIFICATION_V2 = 308;
        REASON_VPN = 309;
        REASON_NOTIFICATION_SERVICE = 310;
        REASON_PACKAGE_REPLACED = 311;
        REASON_LOCATION_PROVIDER = 312;
        REASON_MEDIA_BUTTON = 313;
        REASON_EVENT_SMS = 314;
        REASON_EVENT_MMS = 315;
        REASON_SHELL = 316;
        REASON_MEDIA_SESSION_CALLBACK = 317;
        REASON_ROLE_DIALER = 318;
        REASON_ROLE_EMERGENCY = 319;
        REASON_SYSTEM_MODULE = 320;
        REASON_CARRIER_PRIVILEGED_APP = 321;
        REASON_DPO_PROTECTED_APP = 322;
        REASON_DISALLOW_APPS_CONTROL = 323;
        REASON_ACTIVE_DEVICE_ADMIN = 324;
        // app requested to be exempt
        REASON_OPT_OUT_REQUESTED = 1000;
    }
    // indicates if the app is exempt from background restrictions and the reason if applicable.
    optional ExemptionReason exemption_reason = 9;

    enum OptimizationLevel {
        UNKNOWN = 0;
        OPTIMIZED = 1;
        BACKGROUND_RESTRICTED = 2;
        NOT_OPTIMIZED = 3;
    }
    // the user choice for the optimization level of the app.
    optional OptimizationLevel opt_level = 10;

    enum TargetSdk {
        SDK_UNKNOWN = 0;
        SDK_PRE_S = 1;
        SDK_S = 2;
        SDK_T = 3;
    }
    // indicates the target sdk level for this app.
    optional TargetSdk target_sdk = 11;

    // indicates if the current device is a low ram device.
    optional bool low_mem_device = 12;

    // indicates previous background restriction level.
    optional RestrictionLevel previous_restriction_level = 13;
}

/**
 * Logs failure reason when MmsSmsProvider#getThreadId fails to return a threadId
 */
message MmsSmsProviderGetThreadIdFailed {
    enum FailureCode {
        FAILURE_UNKNOWN = 0;
        // Did not return a threadId due to recipients being passed in
        FAILURE_NO_RECIPIENTS = 1;
        FAILURE_FIND_OR_CREATE_THREAD_ID_SQL = 2;
        // Found more than one threadId for the given of recipients
        FAILURE_MULTIPLE_THREAD_IDS_FOUND = 3;
    }

    optional FailureCode failure_code = 1;
}

/**
 * Logs failure reason when MmsSmsDatabaseHelperOnUpgradeFailed fails on an upgrade step
 */
message MmsSmsDatabaseHelperOnUpgradeFailed {
    enum FailureCode {
        FAILURE_UNKNOWN = 0;
        FAILURE_IO_EXCEPTION = 1;
        FAILURE_SECURITY_EXCEPTION = 2;
        FAILURE_SQL_EXCEPTION = 3;
    }

    // Database version being upgraded from
    optional int32 old_version = 1;
    // Database version being upgraded to
    optional int32 current_version = 2;
    // Version number of the database upgrade step that failed
    optional int32 upgrade_failed_to_version = 3;
    optional FailureCode failure_code = 4;
}

/** Log for autofill events. This captures events till the view goes out of
 * focus. For each auttofilled view going out of focus, and coming back, a
 * separate event would be generated.
 *
 * Logged from:
 * frameworks/base/services/autofill/java/com/android/server/autofill/
 */
message AutofillPresentationEventReported {
  enum PresentationEventResult {
    NONE_SHOWN_UNKNOWN_REASON =
        0;  // Includes reasons where losses can be partial: eg: IME not showing
            // certain datasets, while others are filtered out because user
            // started typing. So, it can either refer to a set of mixed of
            // known or unknown reasons.
    ANY_SHOWN =
        1;  // This is counter to the event name, but we need it in order to get
            // overall success rate.
    // Below ones corresponds to no presentation getting shown
    NONE_SHOWN_VIEW_FOCUS_CHANGED =
        2;  // User action leads to focus getting shifted to another field
    NONE_SHOWN_VIEW_CHANGED =
        3;  // This would also include if view becomes invisible.
    NONE_SHOWN_ACTIVITY_FINISHED = 4;  // Eg: User pressed back
    NONE_SHOWN_REQUEST_TIMEOUT =
        5;  // Autofill provider didn't respond in the given time.
    NONE_SHOWN_SESSION_COMMITTED_PREMATURELY =
        6;  // Session was prematurely committed. This can happen due to various
            // reasons, eg: app developers calling commit() earlier than when
            // they should.
    NONE_SHOWN_FILL_REQUEST_FAILED =
        7; // Autofill provider request failed. Different from timeout.
    NONE_SHOWN_NO_FOCUS =
        8; // Autofill provider request was triggered pre-focus. User never
           // focussed on autofillable fields. This can happen for FillDialog
           // where we trigger fill request at layout time.
    NONE_SHOWN_VIEW_FOCUSED_BEFORE_FILL_DIALOG_RESPONSE =
        9; // Users focus a field before the fill dialogs response is returned.
  }

  // Id number which increases for each subsequent request.
  optional int32 request_id = 1;

  // SessionId to aggregate requests within a session, and see overall
  // performance.
  optional int32 session_id = 2;

  // Result of autofill event.
  optional PresentationEventResult presentation_event_result = 3;

  // Count of datasets that should've been available for display. If the request
  // times out, this won't be populated.
  optional int32 available_count = 4;

  // Count of datasets that are shown to the user.
  optional int32 count_shown = 5;

  // Count of datasets that are eligible to be shown to the user, but aren't
  // shown because user started typing already, and the results were filtered.
  // If the user starts typing, dataset isn't shown at the moment, but then the
  // user deletes text, and the dataset becomes visible, it would count as
  // shown, and not as filtered out.
  optional int32 count_filtered_user_typing = 6;

  // Count of datasets that aren't shown because IME didn't use datasets at all.
  optional int32 count_not_shown_unused_by_ime = 7;

  // Count of datasets that are eligible to be shown to the user, but aren't
  // shown because display didn't show them (probably user didn't scroll to see
  // the view). The dataset was requested by display, but not shown.
  optional int32 count_not_shown_never_visible = 8;

  // How the dataset is supposed to be shown to the user
  optional AutofillDisplayPresentationType display_presentation_type = 9;

  // Autofill Service Provider's uid
  optional int32 autofill_service_uid = 10 [(is_uid) = true];

  // Inline suggestion host's uid. Populated only when
  // AutofillDisplayPresentationType = INLINE
  optional int32 inline_suggestion_host_uid = 11 [(is_uid) = true];

  // Whether a new request was triggered or alternatively served from cached
  // response.
  optional bool is_request_triggered = 12;

  // Timestamps are in milliseconds, relative to when the Session was created
  // For example, if timestamp has a value = 100, the event was triggered
  // 100ms after the session was created.
  // Since these are relative to Session creation, you can subtract events to
  // get the latency duration between events.
  // t1 = 100
  // t2 = 300
  // duration = t2 - t1 = 200ms
  // ------------------------------------------------------------------------
  // Timestamp of when FillRequest is sent to Autofill provider
  // This is also the latency of when a field is focused to Framework sending a FillRequest
  optional int32 fill_request_sent_timestamp_ms = 13;

  // Timestamp of when Autofill provider returns a FillResponse
  // The latency of the Autofill provider IPC can be calculated
  // by fillResponseReceivedTimestampMs - fillRequestSentTimestampMs
  optional int32 fill_response_received_timestamp_ms = 14;

  // Timestamp of when FillResponse is sent to the IME/Dropdown handler/Fill Dialog UI
  // The latency of processing provider FillResponse to when suggestions are sent to be rendered
  // can be calculated by suggestionSentTimestampMs - fillResponseReceivedTimestampMs
  optional int32 suggestion_sent_timestamp_ms = 15;

  // Timestamp of when the suggestion is shown
  // The latency of showing suggestions can be calculated by
  // suggestionPresentedTimestampMs - suggestionSentTimestampMs
  optional int32 suggestion_presented_timestamp_ms = 16;

  // The index of the dataset that a user selected. -1 if not selected.
  optional int32 selected_dataset_id = 17;

  // True if the user dismissed the fill UI.
  optional bool dialog_dismissed = 18;

  // True if the user clicked the negative CTA button.
  optional bool negative_cta_button_clicked = 19;

  // True if the user clicked the positive CTA button.
  optional bool positive_cta_button_clicked = 20;

  optional autofill.AuthenticationType authentication_type = 21;

  optional autofill.AuthenticationResult authentication_result = 22;

  // From response received to authentication UI displayed to the user.
  optional int64 latency_authentication_ui_display_millis = 23;

  // From the user finishing authentication to the dataset is displayed to the user.
  optional int64 latency_dataset_display_millis = 24;

  // Count of datasets that are available due to PCC Detection. These can include datasets
  // available via provider response, and would be eligible because of pcc too.
  // If PCC detection is preferred over Autofill provider, and Autofill provider had same detection
  // as PCC did, the following invariants would hold.
  // available_pcc_count = available_count
  // available_pcc_only_count = 0
  optional int32 available_pcc_count = 25;

  // Count of datasets that are available only due to PCC Detection.
  optional int32 available_pcc_only_count = 26;

  // The selection process of this dataset.
  optional autofill.DatasetPickedReason selected_dataset_picked_reason = 27;

  // Which detection was preferred
  optional autofill.DetectionPreference detection_preference = 28;

  // field_classification request id that was used for this event.
  optional int32 field_classification_request_id = 29;

  // App package Uid
  optional int32 app_package_uid = 30 [(is_uid) = true];
}

// Tells how Autofill dataset was/will-be displayed.
enum AutofillDisplayPresentationType {
  UNKNOWN_AUTOFILL_DISPLAY_PRESENTATION_TYPE = 0;
  MENU = 1;    // aka drop-down
  INLINE = 2;  // shown via IME
  DIALOG = 3;  // aka Bottom-sheet dialog
}

/**
 * Log the CompanionDeviceManager associations are created by various device
 * profiles
 *
 * Logged from:
 * frameworks/base/services/companion/java/com/android/server/companion/
 * CompanionDeviceManagerService.java
 */
message CdmAssociationAction {
    enum Action {
        UNKNOWN = 0;
        CREATED = 1;
        REMOVED = 2;
    }

    enum DeviceProfile{
        DEVICE_PROFILE_NULL = 0;
        DEVICE_PROFILE_WATCH = 1;
        DEVICE_PROFILE_APP_STREAMING = 2;
        DEVICE_PROFILE_AUTO_PROJECTION = 3;
        DEVICE_PROFILE_COMPUTER = 4;
        DEVICE_PROFILE_GLASSES = 5;
        DEVICE_PROFILE_NEARBY_DEVICE_STREAMING = 6;
    }

    // Action taken on the CDM association been created by companion apps.
    optional Action action = 1;

    // Name of the CDM Association Request profiles.
    optional DeviceProfile device_profile = 2;
}

/**
 * Logs when text and reading options changed.
 *
 * Logged from:
 *   packages/apps/Settings/src/com/android/settings/accessibility
 */
message AccessibilityTextReadingOptionsChanged {
    // The item name of the accessibility feature "Text and Reading Options".
    optional android.stats.accessibility.TextReadingOption name = 1;

    // The status value of the item of the accessibility feature "Text and Reading Options".
    optional int32 value = 2;

    // The entry point from which page.
    optional android.stats.accessibility.TextReadingEntry entry_point = 3;
}

/*
 * Pushed atom logged by ONS service.
 */
message OnsOpportunisticEsimProvisioningComplete {
    enum ResultCode {
      // Unknown
      RESULT_UNKNOWN = 0;

      // Operation was successful.
      RESULT_SUCCESS = 1;

      // Device capabilities not met such as eSIM and MultiSIM not supported.
      RESULT_DEVICE_NOT_CAPABLE = 2;

      // Internet connection is not available while trying to download opportunistic eSIM.
      RESULT_INTERNET_NOT_AVAILABLE = 3;

      // Error occurred while switching device from Single to MultiSIM mode.
      RESULT_SWITCH_TO_MULTISIM_FAILED = 4;

      // Connection error occurred while downloading opportunistic eSIM from SMDP server.
      RESULT_CONNECTION_ERROR = 5;

      // Download failed because there is no sufficient storage available in eUICC memory.
      RESULT_MEMORY_FULL = 6;

      // Installation of downloaded eSIM failed.
      RESULT_INSTALL_ESIM_PROFILE_FAILED = 7;

      // Unresolvable errors such as Invalid SMDP address or activation code.
      RESULT_UNRESOLVABLE_ERROR = 8;

      // Auto provisioning disabled
      RESULT_AUTO_PROVISIONING_DISABLED = 9;

      // eSIM provisioning failed
      RESULT_ESIM_PROVISIONING_FAILED = 10;
    }

    // CBRS carrier id. Filled only while reporting failure cases.
    optional int32 carrier_id = 1;

    // carrier id of the opportunistic eSIM downloaded from the SMDP server.
    //Filled only while reporting failure cases.
    optional int32 opportunistic_esim_carrier_id = 2;

    // Flag to indicate that the data connection was used for downloading.
    optional bool is_mobile_data_used = 3;

    // Error code occurred during the above operation.
    optional ResultCode error_code = 4;

    // Retry count of the above operation.
    optional int32 retry_count = 5;

    // Detailed error code.
    optional int32 detailed_error_code = 6;
}

/**
 * Logs when a telephony anomaly is reported.
 *
 * Logged from:
 *   frameworks/base/telephony/java/android/telephony/AnomalyReporter.java
 */
message TelephonyAnomalyDetected {
    // Carrier ID of the SIM card.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;
    // UUID of the anomaly, as generated by android.telephony.AnomalyReporter
    optional int64 event_id_lsb = 2;
    optional int64 event_id_msb = 3;
}

// Logs when the remote key provisioner application is invoked, either
// due to a periodically scheduled job, due to an attestation key being
// consumed from the pool, or when the system has detected that it's
// completely out of attestation keys.
//
// Logged from:
//   packages/modules/RemoteKeyProvisioning
message RemoteKeyProvisioningAttempt {
    // The reason for the provisioning attempt.
    enum Cause {
        CAUSE_UNKNOWN = 0;
        SCHEDULED = 1;          // A scheduled job issued the request
        KEY_CONSUMED = 2;       // A provisioned key was consumed from the pool
        OUT_OF_KEYS = 3;        // The system is out of keys
    }
    optional Cause cause = 1;

    // The name of the remotely provisioned component for whom keys are being
    // generated and certified. The string value is determined by the vendor,
    // and is fixed for the lifetime of the device. The number of unique string
    // values on a given device is determined by how many remotely provisioned
    // component HALs are on a given device. Typically, this is 2-3 HALs.
    optional string remotely_provisioned_component = 2;

    // The uptime of the device, organized into time ranges of interest.
    enum UpTime {
        UPTIME_UNKNOWN = 0;
        LESS_THAN_5_MINUTES = 1;
        BETWEEN_5_AND_60_MINUTES = 2;
        MORE_THAN_60_MINUTES = 3;
    }
    optional UpTime uptime = 3;

    // The state of remote provisioning enablement
    enum Enablement {
        ENABLEMENT_UNKNOWN = 0;
        ENABLED_WITH_FALLBACK = 1;
        ENABLED_RKP_ONLY = 2;
        DISABLED = 3;
    }
    optional Enablement enablement = 4;

    // If the key pool is completely exhausted, this is set to true. Typically,
    // we do not expect to see a pool with no spare keys available.
    optional bool is_key_pool_empty = 5;

    // Indicates success or failure of the provisioning attempt.
    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 6;

    // A digest of the root key that certified the provisioned certificates
    optional string root_cert_fingerprint = 7;

    // The depth of the cert chains issued to the device
    optional int32 cert_chain_length = 8;
}

// Logs that correlate remote key provisioning status with the active
// network for the given provisioning attempt.
//
// Logged from:
//   packages/modules/RemoteKeyProvisioning
message RemoteKeyProvisioningNetworkInfo {
    // The network transport, according ConnectivityManager::getActiveNetwork().
    optional android.stats.connectivity.TransportType transport_type = 1;

    // Indicates success or failure of the provisioning attempt.
    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 2;

    // If an HTTP error was received, this contains the code. Else, contains 200.
    optional int32 http_status_error = 3;
}

// Logs indicating timing data to understand how long the remote provisioner is
// taking to perform various sub-tasks. This is intended to be used with KLL metrics.
//
// Logged from:
//   packages/modules/RemoteKeyProvisioning
message RemoteKeyProvisioningTiming {
    // Time spent waiting on the RKP service to reply.
    optional int32 server_wait_millis = 1;

    // Time spent waiting on internal binder calls to the provisioning service.
    optional int32 binder_wait_millis = 2;

    // Time spent waiting on the serialization lock.
    optional int32 lock_wait_millis = 3;

    // Total time spent processing the attempt.
    optional int32 total_processing_time = 4;

    // The network transport, according ConnectivityManager::getActiveNetwork().
    optional android.stats.connectivity.TransportType transport_type = 5;

    // The name of the remotely provisioned component for whom keys are being
    // generated and certified. The string value is determined by the vendor,
    // and is fixed for the lifetime of the device. The number of unique string
    // values on a given device is determined by how many remotely provisioned
    // component HALs are on a given device. Typically, this is 2-3 HALs.
    optional string remotely_provisioned_component = 6;

    // Cause of the attempt which resulted in these timings.
    optional RemoteKeyProvisioningAttempt.Cause cause = 7;
}

// Deprecated in U.
//
// Counters that track how many errors we're seeing on the device for the
// given boot.
//
// Logged from:
//   packages/modules/RemoteKeyProvisioning
message RemoteKeyProvisioningErrorCounts {
    // The total number of RKP attempts there have been this boot.
    optional int32 total_count = 1;

    // How many errors this device has encountered this boot.
    optional int32 error_count = 2;

    // How many bytes of data have been sent that resulted in errors. These
    // bytes count against an error budget, so it's important to track.
    optional int32 error_bytes = 3;
}

/**
 * Logs information about sync exemptions when they occur.
 *
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/content/ContentService.java
 */
message SyncExemptionOccurred {
    optional int32 uid = 1 [(is_uid) = true]; // the uid of the app.

    enum ProcState {
        UNKNOWN = 0;
        PERSISTENT = 1;
        PERSISTENT_UI = 2;
        TOP = 3;
        BOUND_TOP = 4;
        FOREGROUND_SERVICE = 5;
        BOUND_FOREGROUND_SERVICE = 6;
        IMPORTANT_FOREGROUND = 7;
        IMPORTANT_BACKGROUND = 8;
        TRANSIENT_BACKGROUND = 9;
        BACKUP = 10;
        SERVICE = 11;
        RECEIVER = 12;
        TOP_SLEEPING = 13;
        HEAVY_WEIGHT = 14;
        HOME = 15;
        LAST_ACTIVITY = 16;
        CACHED_ACTIVITY = 17;
        CACHED_ACTIVITY_CLIENT = 18;
        CACHED_RECENT = 19;
        CACHED_EMPTY = 20;
    }
    optional ProcState proc_state = 2; // the proc state of the app when the exemption occurred.

    optional bool is_uid_active = 3; // was the uid active when the exemption occurred.

    optional AppBackgroundRestrictionsInfo.RestrictionLevel restriction_level = 4;
}

// Logs the overall Safety State of the device (as cached by the Safety Center)
message SafetyState {
    // The overall severity level of the Safety Center.
    optional android.stats.safetycenter.SafetySeverityLevel overall_severity_level = 1;

    // The number of open issues in the Safety Center.
    optional int64 open_issues_count = 2;

    // The number of dismissed issues in the Safety Center.
    optional int64 dismissed_issues_count = 3;
}

// Logs the state of an individual Safety Source when overall SafetyState is
// collected.
message SafetySourceStateCollected {
    optional int64 encoded_safety_source_id = 1;

    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 2;

    // The severity level of this source.
    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 3;

    // The number of open issues belonging to this Safety Source.
    optional int64 open_issues_count = 4;

    // The number of dismissed issues belonging to this Safety Source.
    optional int64 dismissed_issues_count = 5;

    optional int64 duplicate_filtered_out_issues_count = 6;

    enum SourceState {
        SOURCE_STATE_UNKNOWN = 0;
        DATA_PROVIDED = 1;
        NO_DATA_PROVIDED = 2;
        REFRESH_TIMEOUT = 3;
        REFRESH_ERROR = 4;
        SOURCE_ERROR = 5;
        SOURCE_CLEARED = 6;
    }
    optional SourceState source_state = 7;

    // Indicates the reason for which this event was collected.
    enum CollectionType {
        COLLECTION_TYPE_UNKNOWN = 0;
        AUTOMATIC = 1;
        SOURCE_UPDATED = 2;
    }
    optional CollectionType collection_type = 8;

    enum UpdateType {
        UPDATE_TYPE_UNKNOWN = 0;
        SELF_INITIATED = 1;
        REFRESH_RESPONSE = 2;
    }
    optional UpdateType update_type = 9;

    optional int64 refresh_reason = 10;

    optional bool data_changed = 11;

    optional int64 last_updated_elapsed_time_millis = 12;
}

// Logs system-health and performance related events from the Safety Center
message SafetyCenterSystemEventReported {
    enum EventType {
        EVENT_TYPE_UNKNOWN = 0;
        SINGLE_SOURCE_GET_NEW_DATA = 1;
        SINGLE_SOURCE_RESCAN = 2;
        COMPLETE_GET_NEW_DATA = 3;
        COMPLETE_RESCAN = 4;
        INLINE_ACTION = 5;
    }
    optional EventType event_type = 1;

    // Unset if this event isn't source-specific.
    optional int64 encoded_safety_source_id = 2;

    // Unset if this event isn't source-specific.
    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 3;

    // Unset if this event isn't specific to an issue.
    optional int64 encoded_issue_type_id = 4;

    optional int64 duration_millis = 5;

    enum Result {
        RESULT_UNKNOWN = 0;
        SUCCESS = 1;
        TIMEOUT = 2;
        ERROR = 3;
    }
    optional Result result = 6;

    optional int64 refresh_reason = 7;

    optional bool data_changed = 8;
}

// Logs a user interaction with the Safety Center. Various fields may or may not be
// set depending on the Action reported.
message SafetyCenterInteractionReported {
    // ID which identifies single session of user interacting with Safety Center.
    optional int64 session_id = 1;

    enum Action {
        ACTION_UNKNOWN = 0;

        SAFETY_CENTER_VIEWED = 1;
        SAFETY_ISSUE_VIEWED = 2;

        SCAN_INITIATED = 3;

        ISSUE_PRIMARY_ACTION_CLICKED = 4;
        ISSUE_SECONDARY_ACTION_CLICKED = 5;
        ISSUE_DISMISS_CLICKED = 6;

        MORE_ISSUES_CLICKED = 7;
        ENTRY_CLICKED = 8;
        ENTRY_ICON_ACTION_CLICKED = 9;
        STATIC_ENTRY_CLICKED = 10;

        PRIVACY_CONTROL_TOGGLE_CLICKED = 11;
        SENSOR_PERMISSION_REVOKE_CLICKED = 12;
        SENSOR_PERMISSION_SEE_USAGES_CLICKED = 13;
        REVIEW_SETTINGS_CLICKED = 14;

        NOTIFICATION_POSTED = 15;
        NOTIFICATION_DISMISSED = 16;

        STATUS_VIEWED = 17;
        ENTRY_VIEWED = 18;

        ISSUE_RESOLVED = 19;
    }

    // Action taken in the Safety Center.
    optional Action action = 2;

    enum ViewType {
        VIEW_TYPE_UNKNOWN = 0;
        FULL = 1;
        QUICK_SETTINGS = 2;
        SUBPAGE = 3;

        // Prefix required to distinguish from NavigationSource.NOTIFICATION (since
        // proto enums use C++ scoping rules, enum value names must be unique within
        // the enum's enclosing type, not just the enum itself).
        VIEW_TYPE_NOTIFICATION = 4;
    }

    // Which view of the Safety Center this interaction occurred in.
    optional ViewType view_type = 3;

    enum NavigationSource {
        SOURCE_UNKNOWN = 0;
        NOTIFICATION = 1;
        QUICK_SETTINGS_TILE = 2;
        SETTINGS = 3;
        SENSOR_INDICATOR = 4;

        // Set for navigations that start from within Safety Center. e.g. when a subpage
        // is opened from the main Safety Center page instead of from a notification.
        SAFETY_CENTER = 5;
    }

    // Where the session was initiated from.
    optional NavigationSource navigation_source = 4;

    // Severity level of the particular issue or entry, or the overall Safety
    // Center this interaction is associated with.
    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 5;

    // The hashed ID of the Safety Source that this interaction was with performed with,
    // or nothing if this event isn't source-specific.
    optional int64 encoded_safety_source_id = 6;

    // The kind of profile that this safety source originated from (sources from
    // personal and work profiles may have the same source ID)
    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 7;

    // A hash of the loggable issue type ID that this interaction was performed with.
    optional int64 encoded_issue_type_id = 8;

    enum Sensor {
        SENSOR_UNKNOWN = 0;
        MICROPHONE = 1;
        CAMERA = 2;
        LOCATION = 3;
    }

    // Which sensor was associated with this interaction (if any).
    optional Sensor sensor = 9;

    optional int64 encoded_safety_sources_group_id = 10;

    enum IssueState {
        ISSUE_STATE_UNKNOWN = 0;
        ACTIVE = 1;
        DISMISSED = 2;
    }
    optional IssueState issue_state = 11;
}

/**
 * Logs information about SettingsProvider setting changes when they occur.
 *
 * Logged from:
 *      frameworks/base/packages/src/com/android/providers/settings/SettingsProvider.java
 */
message SettingsProviderSettingChanged {
    optional int32 user_id = 1; // user for whom the setting has changed
    optional string name = 2; // name of the setting
    optional int32 type = 3; // the setting type, e.g., global, system or secure
    optional int32 change_type = 4; // the change type, e.g., insert, delete or update
}

/**
 * Pulls information for a single incoming MMS.
 *
 * Each pull creates multiple atoms, one for each MMS.
 * The sequence is randomized when pulled.
 *
 * Pulled from:
 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
 */
message IncomingMms {
    // Radio access technology (RAT) used for downloading the MMS.
    // It can be IWLAN in case of IMS.
    // RAT is logged at the end of the download.
    optional android.telephony.NetworkTypeEnum rat = 1;

    // Indicate a specific result handling the MMS.
    optional android.mms.MmsResultEnum result = 2;

    // Roaming type when MMS was received.
    optional android.telephony.RoamingTypeEnum roaming = 3;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 4;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 5;

    // Whether the MMS was received with an eSIM profile.
    optional bool is_esim = 6;

    // Carrier ID of the SIM card used for the MMS.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 7;

    // Average time in milliseconds to download MMS from the network.
    optional int64 avg_interval_millis = 8;

    // Total number of MMS having same configuration.
    optional int64 mms_count = 9;

    // Retry count: 0 for the first attempt and then increasing for each attempt.
    optional int32 retry_id = 10;

    // Whether MmsService or carrier app downloaded the MMS from the network.
    optional bool handled_by_carrier_app = 11;

    // Whether the MMS was received with an enterprise profile.
    optional bool is_managed_profile = 12;
}

/**
 * Pulls information for a single outgoing MMS.
 *
 * Each pull creates multiple atoms, one for each MMS.
 * The sequence is randomized when pulled.
 *
 * Pulled from:
 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
 */
message OutgoingMms {
    // Radio access technology (RAT) used for uploading the MMS.
    // It can be IWLAN in case of IMS.
    // RAT is logged at the end of the upload.
    optional android.telephony.NetworkTypeEnum rat = 1;

    // Indicate a specific result handling the MMS.
    optional android.mms.MmsResultEnum result = 2;

    // Roaming type when MMS was received.
    optional android.telephony.RoamingTypeEnum roaming = 3;

    // Index of the SIM used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 4;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 5;

    // Whether the MMS was sent with an eSIM profile.
    optional bool is_esim = 6;

    // Carrier ID of the SIM card used for the MMS.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 7;

    // Average time in milliseconds to download MMS from the network.
    optional int64 avg_interval_millis = 8;

    // Total number of MMS having same configuration.
    optional int64 mms_count = 9;

    // Whether the default MMS application sent the MMS (regardless of which application).
    optional bool is_from_default_app = 10;

    // Retry count: 0 for the first attempt and then increasing for each attempt.
    optional int32 retry_id = 11;

    // Whether MmsService or carrier app uploaded the MMS to the network.
    optional bool handled_by_carrier_app = 12;

    // Whether the MMS was sent with an enterprise profile.
    optional bool is_managed_profile = 13;
}

message PrivacySignalNotificationInteraction {

    enum Action {
        UNKNOWN = 0;
        NOTIFICATION_SHOWN = 1;
        NOTIFICATION_CLICKED = 2;
        DISMISSED = 3;
    }

    // Privacy source that triggered the notification
    optional android.stats.privacysignals.PrivacySource privacy_source = 1;

    // Optional Uid of the package for which the notification was sent.
    optional int32 uid = 2 [(is_uid) = true];

    // Action taken on the notification.
    optional Action action = 3;

    // Session Id to link the notification with the issue card.
    optional int64 session_id = 4; // to map the notification and issue card interaction
}

message PrivacySignalIssueCardInteraction {

    enum Action {
        ACTION_UNKNOWN = 0;
        CARD_SHOWN = 1;
        CARD_CLICKED = 2;
        CARD_DISMISSED = 3;
        CLICKED_CTA1 = 4;
        CLICKED_CTA2 = 5;
    }

    // Privacy source  that pushed the issue card.
    optional android.stats.privacysignals.PrivacySource privacy_source = 1;

    // Optional Uid of the package for which the issue card was sent.
    optional int32 uid = 2 [(is_uid) = true];

    // Action taken on the issue card.
    optional Action action = 3;

    // Session Id to link the notification with the issue card.
    optional int64 session_id = 4;
}

message PrivacySignalsJobFailure {

    // Which privacy source for which the daily job failed.
    optional android.stats.privacysignals.PrivacySource privacy_source = 1;

    enum JobFailureReason {
        REASON_UNKNOWN = 0;
        TIMEOUT = 1;
        COROUTINE_CANCELLED = 2;
    }
    optional JobFailureReason reason =2;
}

/**
 * Logs stats on the download status of file groups. Provides information on
 * download latency and download penetration.
 */
message MobileDataDownloadFileGroupDownloadStatusReported {
  // The status of the file group on device: PENDING, DOWNLOADED, FAILED
  optional android.stats.mobiledatadownload.DownloadStatus
      file_group_download_status = 1;
  // Timestamp of when this file group was added to the device.
  optional int64 group_added_timestamp = 2;
  // Timestamp of when MDD completed downloading the file group.
  optional int64 group_downloaded_timestamp = 3;
  // Stats specific to the file group
  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
  // Number of days since the last time the device attempted to log file group download status for any file group.
  optional int32 days_since_last_log = 5;
}

/**
 * Contains information about different method and code contention durations in
 * the ANR code path
 */
message ANRLatencyReported {
    /* Important durations */
    // Total duration of the ANR (in ms)
    optional int64 total_duration = 1;
    // The duration between when the ANR is triggered and when the stacks are dumped
    // (in ms)
    optional int64 triggering_to_stack_dump_duration = 2;

    /* Disjoint durations, each duration representing the time spent in the
    method before calling the next one on the ANR chain */
    // The duration between when the ANR is triggered and when appNotResponding starts.
    optional int64 triggering_to_app_not_responding_duration = 3;
    // The time taken by appNotResponding before the record is placed on the
    // queue.
    optional int64 app_not_responding_duration = 4;
    // The time spent by the ANR record on the ANR queue.
    optional int64 anr_record_placed_on_queue_duration = 5;
    // The time from the start of the ANR processing by the ANR thread until the
    // stacks are dumped.
    optional int64 anr_processing_duration = 6;
    // The time taken to dump the stacks.
    optional int64 dump_stack_traces_duration = 7;

    /* Helper methods */
    // The time spent waiting on updateCpuStatsNow to return.
    optional int64 update_cpu_stats_now_total_duration = 8;
    // The time spent waiting on currentPsiStateReturned to return.
    optional int64 current_psi_state_total_duration = 9;
    // The time spent waiting on ProcessCpuTracker methods to return
    optional int64 process_cpu_tracker_methods_total_duration = 10;
    // The time spent waiting on CriticalEventLog#logLinesForTraceFile to return.
    optional int64 critical_event_log_duration = 11;

    /* Lock contention */
    // The time spent waiting on the Global Lock.
    optional int64 global_lock_total_contention = 12;
    // The time spent waiting on the PID lock.
    optional int64 pid_lock_total_contention = 13;
    // The time spent waiting on the AMS lock.
    optional int64 ams_lock_total_contention = 14;
    // The time spent waiting on proc lock.
    optional int64 proc_lock_total_contention = 15;
    // The time spent waiting on the ANR record queue lock.
    optional int64 anr_record_lock_total_contention = 16;

    /* Misc */
    // The size of the ANR queue before pushing the ANR.
    optional int32 anr_queue_size_when_pushed = 17;
    // The type of the ANR.
    optional android.anr.AnrType anr_type = 18;
    // The number of dumped processes.
    optional int32 dumped_processes_count = 19;
    // Next ID: 20
}

/** Shared data among MobileDataDownload statistics. Not meant to be a top level atom proto.*/
message MobileDataDownloadFileGroupStats {
  // The name of the file group. This a string set server side used to retrieve
  // the files. Does not contain PII.
  optional string file_group_name = 1;
  // Allows the clients to identify a file group based on a given set of
  // properties. This string is set server side and does not contain PII.
  optional string variant_id = 2;
  // Identifier for the data file group created to identify the version of the
  // file group.
  optional int64 build_id = 3;
  // The number of files in the file group.
  optional int32 file_count = 4;
  // Whether the file group has an account associated with it.
  optional bool has_account = 5;
  // Inverse of the sampling rate used to sample this event.
  optional int32 sampling_interval = 6;
  // Note: we do not have owner_package since that's already transmitted.
}

/**
* Logs stats on the result of download attempts of file groups. Provides info on individual download attempts.
*/
message MobileDataDownloadDownloadResultReported {
  // The result of the download attempt
  optional android.stats.mobiledatadownload.DownloadResult download_result = 1;

  // Specifies which file group the download attempt was for
  optional MobileDataDownloadFileGroupStats file_group_stats = 2 [(log_mode) = MODE_BYTES];
}

/**
* Logs stats on the amount of storage being used by file groups.
*/
message MobileDataDownloadFileGroupStorageStatsReported {
  // Storage stats for all file groups in the MDD Instance
  optional MobileDataDownloadStorageStats storage_stats = 1  [(log_mode) = MODE_BYTES];
  // All the bytes used by mdd file groups
  optional int64 total_mdd_bytes_used = 2;
  // All the bytes used in the entire mdd directory
  optional int64 total_mdd_directory_bytes_used = 3;
}

/**
* Container for MobileDataDownloadFileGroupStorageStats
*/
message MobileDataDownloadStorageStats {
    repeated MobileDataDownloadFileGroupStorageStats mobile_data_download_file_group_storage_stats = 1;
}

/**
* Storage stats for a single file group. This is logged as a nested field and is not meant to be logged as a top level proto.
*/
message MobileDataDownloadFileGroupStorageStats {
  // The total number of bytes used by this file group
  optional int64 total_bytes_used = 1;
  // The total number of inline file bytes used by this file group
  optional int64 total_inline_bytes_used = 2;
  // The number of bytes used for the downloaded version of the file group
  optional int64 downloaded_group_bytes_used = 3;
  // Specifies which file group this storage is associated with
  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(log_mode) = MODE_BYTES];
}

// Logs Display Brightness change events.
message DisplayBrightnessChanged {

    enum Reason {
        REASON_UNKNOWN = 0;
        REASON_MANUAL = 1;
    }

    // Display brightness before the brightness event, in nits.
    optional float initial_nits = 1;

    // Display brightness after the brightness event, in nits.
    optional float end_nits = 2;

    // Estimated ambient light, in lux.
    optional float lux = 3;

    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
    // "local:$PHYSICAL_ID".
    optional string physical_display_id = 4;

    // Whether the short term model was active at the time of the event.
    optional bool short_term_model_active = 5;

    // The factor to adjust the screen brightness in low power mode in the range
    // 0 (screen off) to 1 (no change).
    // If not applied, this is set to -1.
    optional float power_brightness_factor = 6;

    // The level of Reduce Bright Colors (RBC) intensity, the range is [0, 100].
    // If RBC is not enabled, this is set to -1;
    optional int32 reduce_bright_colors_strength = 7;

    // Max nits value when High Brightness Mode (HBM) is enabled.
    // If HBM is not enabled, this is set to -1;
    optional float hbm_current_max = 8;

    // Thermal throttling cap.
    // If thermal throttling not enabled, this is -1.
    optional float thermal_throttling_cap = 9;

    // Whether adaptive brightness is enabled.
    optional bool adaptive_brightness_enabled = 10;

    // Historical: replaced by entire_reason after 2023-04-10
    optional Reason reason = 11 [deprecated = true];

    // Reason that triggered the brightness event to occur.
    optional android.display.DisplayBrightnessChangeReasonEnum entire_reason = 12;

    // New brightness bucket index, from frameworks/proto_logging/stats/enums/display/enums.proto.
    optional android.display.DisplayBrightnessRangeEnum bucket_index = 13;

    // Brightness is at maximum allowable value regarding the current context.
    optional bool brightness_at_max = 14;

    // Whether HBM mode is enabled due to sunlight
    optional bool hbm_mode_sunlight = 15;

    // Whether HBM mode is enabled due to HDR
    optional bool hbm_mode_hdr = 16;

    // Whether modified by low power mode.
    optional bool modified_by_low_power_mode = 17;

    // Value defined in frameworks/base/core/java/android/hardware/display/BrightnessInfo.java
    // BRIGHTNESS_MAX_REASON_NONE = 0
    // BRIGHTNESS_MAX_REASON_THERMAL = 1
    // BRIGHTNESS_MAX_REASON_* defined in the future
    optional int32 throttling_reason = 18;

    // Whether modified by dimming.
    optional bool modified_by_dimming = 19;

    // Whether Reduce Bright Colors (RBC) is enabled.
    optional bool rbc_enabled = 20;

    // Whether ambient lux is invalid.
    optional bool ambient_lux_invalid = 21;

    // Whether doze scale applied for auto brightness.
    optional bool doze_scale_applied = 22;

    // Whether the value is set by the user.
    optional bool set_by_user = 23;

    // Whether idle mode is active.
    optional bool idle_mode_active= 24;

    // Whether low power mode is enabled.
    optional bool low_power_mode_enabled= 25;
}


/**
 * Logs when various Privacy Sandbox settings are used.
 */
message AdServicesSettingsUsageReported {
    // Region of the user who interacted with AdServicesSettings UI.
    enum AdServiceSettingRegion {
        // fallback when getDeviceRegion call failed.
        REGION_UNSPECIFIED = 0;
        // European Union user (based on isoCountryInfo).
        EU = 1;
        // Non-European Union user (based on isoCountryInfo).
        ROW = 2;
    }
    // Region where the device was used.
    optional AdServiceSettingRegion region = 1;

    // UI settings page action performed by the user.
    enum AdServiceSettingsName {
        // fallback when getAction call failed.
        ACTION_UNSPECIFIED = 0;
        // notification was requested to be sent to the user.
        REQUESTED_NOTIFICATION = 1;
        // the notification landing page was displayed.
        LANDING_PAGE_DISPLAYED = 2;
        // user opt-in for PP API.
        OPT_IN_SELECTED = 3;
        // user opt-out of PP API.
        OPT_OUT_SELECTED = 4;
        // the topics page was displayed.
        MANAGE_TOPICS_SELECTED = 5;
        // the fledge page was displayed.
        MANAGE_APPS_SELECTED = 6;
        // user reset topics.
        RESET_TOPIC_SELECTED = 7;
        /// user reset fledge apps.
        RESET_APP_SELECTED = 8;
        // user blocked topics.
        BLOCK_TOPIC_SELECTED = 9;
        // user unblocked topics.
        UNBLOCK_TOPIC_SELECTED = 10;
        // user blocked fledge apps.
        BLOCK_APP_SELECTED = 11;
        // user unblocked fledge apps.
        UNBLOCK_APP_SELECTED = 12;
        // Measurement page and data reset.
        MANAGE_MEASUREMENT_SELECTED = 13;
        RESET_MEASUREMENT_SELECTED = 14;
        // user opt-in to topics.
        TOPICS_OPT_IN_SELECTED = 15;
        // user opt-out of topics.
        TOPICS_OPT_OUT_SELECTED = 16;
        // user opt-in to fledge.
        FLEDGE_OPT_IN_SELECTED = 17;
        // user opt-out of fledge.
        FLEDGE_OPT_OUT_SELECTED = 18;
        // user opt-in to measurement.
        MEASUREMENT_OPT_IN_SELECTED = 19;
        // user opt-out of measurement.
        MEASUREMENT_OPT_OUT_SELECTED = 20;
        // Notification and landing page for kids policy
        // notification was requested for GA  user.
        GA_UX_NOTIFICATION_REQUESTED = 21;
        // GA landing page was displayed.
        GA_UX_NOTIFICATION_LANDING_PAGE_DISPLAYED = 22;
        // GA confirmation page was displayed.
        GA_UX_NOTIFICATION_CONFIRMATION_PAGE_DISPLAYED = 23;
        // GA version of opt_in/out selected.
        // opt-in for GA user.
        NOTIFICATION_OPT_IN_SELECTED = 24;
        // opt-out for GA user.
        NOTIFICATION_OPT_OUT_SELECTED = 25;
        // user selected manage settings in consent notification.
        NOTIFICATION_MANAGE_SETTINGS_SELECTED = 26;
        // the privacy sandbox settings page was displayed.
        PRIVACY_SANDBOX_SETTINGS_PAGE_DISPLAYED = 27;
        // the confirmation page was displayed for a user.
        CONFIRMATION_PAGE_DISPLAYED = 28;
        // notification was blocked by a user.
        NOTIFICATION_DISABLED = 29;
        // notification was blocked by a GA user.
        GA_UX_NOTIFICATION_DISABLED = 30;
        // notification was displayed to a user.
        NOTIFICATION_DISPLAYED = 31;
        // notification was displayed to a GA user.
        GA_UX_NOTIFICATION_DISPLAYED = 32;
        // user clicked on the more button on the landing page.
        LANDING_PAGE_MORE_BUTTON_CLICKED = 33;
        // GA user clicked on the more button on the landing page.
        GA_UX_LANDING_PAGE_MORE_BUTTON_CLICKED = 34;
        // user clicked the additional info button on the landing page.
        LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 35;
        // GA user clicked the additional info button on the landing page.
        GA_UX_LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 36;
        // user scrolled the landing page.
        LANDING_PAGE_SCROLLED = 37;
        // GA user scrolled the landing page.
        GA_UX_LANDING_PAGE_SCROLLED = 38;
        // user scrolled to the bottom of the landing page.
        LANDING_PAGE_SCROLLED_TO_BOTTOM = 39;
        // GA user scrolled to the bottom of the landing page.
        GA_UX_LANDING_PAGE_SCROLLED_TO_BOTTOM = 40;
        // user clicked the settings button on the landing page.
        LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 41;
        // GA user clicked the settings button on the landing page.
        GA_UX_LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 42;
        // user clicked the got it button on the landing page.
        LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 43;
        // GA user clicked the got it button on the landing page.
        GA_UX_LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 44;
        // user clicked opt-out on the landing page.
        LANDING_PAGE_OPT_OUT_CLICKED = 45;
        // GA user clicked opt-out on the landing page.
        GA_UX_LANDING_PAGE_OPT_OUT_CLICKED = 46;
        // user dismissed the landing page.
        LANDING_PAGE_DISMISSED = 47;
        // GA user dismissed the landing page.
        GA_UX_LANDING_PAGE_DISMISSED = 48;
        // user opt-in from the landing page.
        LANDING_PAGE_OPT_IN = 49;
        // GA user opt-in from the landing page.
        GA_UX_LANDING_PAGE_OPT_IN = 50;
        // user clicked settings on the opt-in confirmation page.
        OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 51;
        // GA user clicked settings on the opt-in confirmation page.
        GA_UX_OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 52;
        // user clicked settings on the opt-out confirmation page.
        OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 53;
        // GA user clicked settings on the opt-out confirmation page.
        GA_UX_OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 54;
        // user clicked got it on the opt-in confirmation page.
        OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 55;
        // GA user clicked got it on the opt-in confirmation page.
        GA_UX_OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 56;
        // user clicked got it on the opt-out confirmation page.
        OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 57;
        // GA user clicked got it on the opt-out confirmation page.
        GA_UX_OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 58;
        // user dismissed confirmation page.
        CONFIRMATION_PAGE_DISMISSED = 59;
        // GA user dismissed confirmation page.
        GA_UX_CONFIRMATION_PAGE_DISMISSED = 60;
        // user clicked more info on the opt in confirmation page.
        OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 61;
        // user clicked more info on the opt out confirmation page.
        OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 62;
        // GA user clicked more info on the opt in confirmation page.
        GA_UX_OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 63;
        // GA user clicked more info on the opt out confirmation page.
        GA_UX_OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 64;
        // GA user clicked opt out on the landing page.
        GA_UX_LANDING_PAGE_OPT_OUT = 65;
        // user clicked opt out on the landing page.
        LANDING_PAGE_OPT_OUT = 66;
        // (enrolled) user clicked on the privacy sandbox entry point.
        PRIVACY_SANDBOX_ENTRY_POINT_CLICKED = 67;
        // daily maintenance job was run.
        DAILY_MAINTENANCE_JOB_FINISHED = 68;
    }
    // UI action performed by user.
    optional AdServiceSettingsName action = 2;

    enum AdServicesSettingsDefaultConsent {
        // fallback when getDefaultConsent failed.
        CONSENT_UNSPECIFIED = 0;
        // user was opted-in to PP API by default.
        PP_API_DEFAULT_OPT_IN = 1;
        // user was opted-out of PP API by default.
        PP_API_DEFAULT_OPT_OUT = 2;
        // user was opted-in to topics by default.
        TOPICS_DEFAULT_OPT_IN = 3;
        // user was opted-in to topics by default.
        TOPICS_DEFAULT_OPT_OUT = 4;
        // user was opted-in to fledge by default.
        FLEDGE_DEFAULT_OPT_IN = 5;
        // user was opted-in to fledge by default.
        FLEDGE_DEFAULT_OPT_OUT = 6;
        // user was opted-in to measurement by default.
        MEASUREMENT_DEFAULT_OPT_IN = 7;
        // user was opted-in to measurement by default.
        MEASUREMENT_DEFAULT_OPT_OUT = 8;
    }
    // AdServices consents of a user when consent notification was first sent.
    optional AdServicesSettingsDefaultConsent default_consent = 3;

    // AdId state of a user when consent notification was first sent.
    enum AdServicesSettingsDefaultAdIdState {
        // fallback when getDefaultAdId failed.
        STATE_UNSPECIFIED = 0;
        // AdId was not zeroed-out when user first received consent notification.
        AD_ID_ENABLED = 1;
        // AdId was zeroed-out when user first received consent notification.
        AD_ID_DISABLED = 2;
    }

    // Default ad id state when consent notification was first sent.
    optional AdServicesSettingsDefaultAdIdState default_ad_id_state = 4;

    // (Deprecated) Type of AdService feature running on device.
    enum PrivacySandboxFeatureType {
        // fallback when getFeature failed.
        FEATURE_UNSPECIFIED = 0;
        // the first consent feature is enabled.
        PRIVACY_SANDBOX_FIRST_CONSENT = 1;
        // the reconsent feature is enabled.
        PRIVACY_SANDBOX_RECONSENT = 2;
        // privacy sandbox is not yet supported on the device.
        PRIVACY_SANDBOX_UNSUPPORTED = 3;
        // privacy sandbox is already running on the device.
        PRIVACY_SANDBOX_ALREADY_RUNNING = 4;
        // the first consent feature with flipped flow is enabled.
        PRIVACY_SANDBOX_FIRST_CONSENT_FF = 5;
        // the reconsent feature with flipped flow is enabled.
        PRIVACY_SANDBOX_RECONSENT_FF = 6;
    }

    // (Deprecated) Privacy sandbox feature currently running on the device.
    optional PrivacySandboxFeatureType feature_type = 5 [deprecated = true];

    // Type of privacy sandbox UX.
    enum PrivacySandboxUx {
        // fallback when no UX can be selected.
        UNSUPPORTED_UX = 0;
        // all UXs that are not unspecified.
        UNSPECIFIED_UX = 1;
        // GA UX.
        GA_UX = 2;
        // Beta UX.
        BETA_UX = 3;
        // UX for Android RVC.
        RVC_UX = 4;
    }

    // Type of privacy sandbox UX.
    optional PrivacySandboxUx ux = 6;

    // Type of privacy sandbox enrollment channel.
    enum PrivacySandboxUxEnrollmentChannel {
        // fallback when no enrollment channel can be selected.
        UNSUPPORTED_CHANNEL = 0;
        // all enrollment channels that are unspecified.
        UNSPECIFIED_CHANNEL = 1;
        // already enrolled channel.
        ALREADY_ENROLLED_CHANNEL = 2;
        // consent notification debug channel.
        CONSENT_NOTIFICATION_DEBUG_CHANNEL = 3;
        // first consent notification.
        FIRST_CONSENT_NOTIFICATION_CHANNEL = 4;
        // reconsent notification.
        RECONSENT_NOTIFICATION_CHANNEL = 5;
        // consent notification reset channel.
        CONSENT_NOTIFICATION_RESET_CHANNEL = 6;
        // 2nd GA notification post R OTA.
        RVC_POST_OTA_NOTIFICATION_CHANNEL = 7;
    }

    // Type of privacy sandbox enrollment channel.
    optional PrivacySandboxUxEnrollmentChannel enrollment_channel = 7;
}

// Logs daily ambient brightness stats.
message AmbientBrightnessStatsReported {

    // How much time was spent in each of the buckets, in seconds.
    repeated float bucket_size_seconds = 1;

    // Ambient brightness values for creating bucket boundaries from.
    repeated float bucket_boundary_lux = 2;
}

// Logs information about bpf maps in BpfNetMaps.
//
// Logged from:
//   packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java
message NetworkBpfMapInfo {
    // The size of cookie tag bpf map.
    optional int32 cookie_tag_map_size = 1;

    // The size of uid owner bpf map.
    optional int32 uid_owner_map_size = 2;

    // The size of uid permission bpf map.
    optional int32 uid_permission_map_size = 3;
}

/**
 * Pulls information for a single outgoing short code sms.
 *
 * Each pull generates multiple atoms, one for each category and xml_version combination.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message OutgoingShortCodeSms {
    /* Short code sms category. */
    optional android.telephony.ShortCodeSmsEnum category = 1;

    /* sms_short_codes.xml file version used by the device. */
    optional int32 xml_version = 2;

    /* Number of short code sms with the same configuration. */
    optional int32 short_code_sms_count = 3;
}

/**
 * Logs information when a hearing aid is bonded
 *
 * Logged from:
 *   frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/
 *   LocalBluetoothProfileManager.java
 */
message HearingAidInfoReported {
    // The device mode of the bonded hearing aid
    // Mode definition for hearing aids. See {@link HearingAidInfo}
    enum DeviceMode {
        MODE_UNKNOWN = -1;
        MONAURAL = 0;
        BINAURAL = 1;
        BANDED = 2;
    }
    optional DeviceMode device_mode = 1;

    // The device side of the bonded hearing aid
    // Side definition for hearing aids. See {@link HearingAidInfo}.
    enum DeviceSide {
        SIDE_UNKNOWN = -1;
        LEFT = 0;
        RIGHT = 1;
        LEFT_AND_RIGHT = 2;
    }
    optional DeviceSide device_side = 2;

    // The entry page id where the bonding process starts
    enum BondEntry {
        PAGE_UNKNOWN = -1;
        CONNECTED_DEVICES = 0;
        ACCESSIBILITY_HEARING_AIDS = 1;
        ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER = 2;
        BLUETOOTH = 3;
        ACCESSIBILITY_HEARING_AID_SETTINGS = 4;
    }
    optional BondEntry bond_entry = 3;
}

/**
 * Logs when Ambient/OFFLOAD Mode is entered or exited.
 *
 * Logged from:
 *  1. vendor/google_clockwork/packages/Ambient/src/com/google/
 *     android/wearable/ambient/AmbientService.java
 *  2. vendor/google_clockwork/packages/Ambient/src/com/google/android/
 *     wearable/ambient/autoresume/AmbientLiteFlowController.java
 *  3. frameworks/opt/wear/src/com/google/android/clockwork/
 *     displayoffload/DisplayOffloadService.java
 */
message AmbientModeChanged {
    enum AmbientStateEnum {
        AMBIENT_ENTER = 1;
        AMBIENT_EXIT = 2;
        AMBIENT_LITE_ENTER = 3;
        AMBIENT_LITE_EXIT = 4;
        OFFLOAD_ENTER = 5;
        OFFLOAD_EXIT = 6;
    }

    optional AmbientStateEnum state = 1;
}


/**
 * Contains statistics about time spent fetching resource information from an APK.
 * Logged from:
 *   frameworks/base/core/java/android/content/res/ResourceTimer.java
 */
message ResourceValueApiStatisticsReported {

  // The api that is being reported.
  optional android.app.ResourceApiEnum api = 1;

  // The total number of events recorded.
  optional int32 event_count = 2;

  // The total time spent in thie API.  The units are ns.
  optional int64 cumulative_event_time_ns = 3;

  // Four percentile values.  Units are in ns.  A value of zero means the percentile could not be
  // computed.
  optional int32 p50_ns = 4;
  optional int32 p90_ns = 5;
  optional int32 p95_ns = 6;
  optional int32 p99_ns = 7;

  // The five largest values recorded.  Units are in ns.  A value of zero means the value is
  // missing (which means fewer than 5 events were recorded).  Values that exceed INT_MAX are
  // capped at INT_MAX.
  optional int32 l0_ns = 8;
  optional int32 l1_ns = 9;
  optional int32 l2_ns = 10;
  optional int32 l3_ns = 11;
  optional int32 l4_ns = 12;
}

/**
 * Logs when Iwlan responds the setup data call request.
 *
 * Logged from:
 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
 */
message IwlanSetupDataCallResultReported {
  enum IwlanError {
    NO_ERROR = 0;
    IKE_PROTOCOL_EXCEPTION = 1;
    IKE_INTERNAL_IO_EXCEPTION = 2;
    IKE_GENERIC_EXCEPTION = 3;
    EPDG_SELECTOR_SERVER_SELECTION_FAILED = 4;
    TUNNEL_TRANSFORM_FAILED = 5;
    SIM_NOT_READY_EXCEPTION = 6;
    NETWORK_FAILURE = 7;
    UNKNOWN_EXCEPTION = 8;
  }

  // Setup data call apn type
  // See go/apntypedefinition
  optional int32 apn_type = 1;
  // Is the request for handover
  optional bool is_handover = 2;
  // ePDG server address
  optional string epdg_server_address = 3;
  // If the request type is handover, record the source network type
  // See
  // frameworks/base/telephony/java/android/telephony/TelephonyManager.java
  optional int32 source_rat = 4;
  // If the request type is handover, record the source network roaming status
  optional bool is_cellular_roaming = 5;
  // Is network connected
  optional bool is_network_connected = 6;
  // Default network transport type
  // See
  // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
  optional int32 transport_type = 7;
  // Setup result
  optional int32 setup_request_result = 8;
  // Iwlan error code if setup failed
  optional IwlanError iwlan_error = 9;
  // Data call fail cause
  // See
  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
  optional int32 data_call_fail_cause = 10;
  // Setup request processing duration
  optional int32 processing_duration_millis = 11;
  // Time for doing ePDG server selection through DNS query of FQDNs
  optional int32 epdg_server_selection_duration_millis = 12;
  // Time for establishing IKE tunnel
  optional int32 ike_tunnel_establishment_duration_millis = 13;
  // Tunnel State
  // See
  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
  optional int32 tunnel_state = 14;
  // Handover failure mode
  // See
  // frameworks/base/telephony/java/android/telephony/data/DataCallResponse.java
  optional int32 handover_failure_mode = 15;
  // Retry duration
  optional int32 retry_duration_millis = 16;
  // Iwlan error wrapped exception classname
  optional string iwlan_error_wrapped_classname = 17;
  // Iwlan error wrapped exception 1st line of stack trace
  optional string iwlan_error_wrapped_stack_first_frame = 18;
  // Error count of the same error cause
  optional int32 error_count_of_same_cause = 19;
}

/**
 * Logs when Iwlan reports IWLAN PDN disconnected without deactivation request.
 *
 * Logged from:
 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
 */
message IwlanPdnDisconnectedReasonReported {
  // Disconnection cause
  // See
  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
  optional int32 cause = 1;
  // Is network connected
  optional bool is_network_connected = 2;
  // default network transport type
  // See
  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
  optional int32 transport_type = 3;
  // Wifi signal level
  optional int32 wifi_signal_level = 4;
}

/**
 * Logs the number of network count on each list of transports
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkCountPerTransports {
    // the number of network count on each list of transports
    repeated NetworkCountForTransports network_count_for_transports = 1;
}

/**
 * Logs the number of network count and transport type
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkCountForTransports {
    // Transport types of the network
    optional int32 transport_types = 1;

    // Number of networks for one list of transport types
    optional int32 network_count = 2;
}

/**
 * Logs a list of networks
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkList {
    repeated NetworkDescription network_description = 1;
}

/**
 * Logs connection duration in seconds and list of transports
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message ConnectionDurationForTransports {
    // Transport types of the network
    optional int32 transport_types = 1;

    // Time duration that the device stays connected to the network
    optional int32 duration_sec = 2;
}

/**
 * Logs connection duration on each list of transports, in seconds
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message ConnectionDurationPerTransports {
    repeated ConnectionDurationForTransports connection_duration_for_transports = 1;
}

/**
 * Logs network request count & request type
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message RequestCountForType {
    // The type of network request
    optional android.stats.connectivity.RequestType request_type = 1;

    // Number of network requests
    optional int32 request_count = 2;
}

/**
 * Logs network request count
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkRequestCount {
    // Network request count for request type
    repeated RequestCountForType request_count_for_type = 1;
}

/**
 * Logs information about a network
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkDescription {
    // The transport types of the network. A network may include multiple transport types.
    // Each transfer type is represented by a different bit, defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 transport_types = 1;

    // Indicates the network is metered, non-metered or temporarily-unmetered
    optional android.stats.connectivity.MeteredState metered_state = 2;

    // Indicates the network is validated, non-validated, partial or portal
    optional android.stats.connectivity.ValidatedState validated_state = 3;

    // Record the bitmask of all the policies applied to this score of network.
    // Each policy is represented by a different bit, defined in
    // packages/modules/Connectivity/service/src/com/android/server/connectivity/FullScore.java
    optional int64 score_policies = 4;

    // The capabilities of the network. A network may include multiple network capabilities.
    // Each capability is represented by a different bit, defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int64 capabilities = 5;

    // Bitfield representing the network's enterprise capability identifier, defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 enterprise_id = 6;
}

/**
 * Pulls a list of NumberOfRematchesPerReason.
 *
 * Pulled from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NumberOfRematchesPerReason {
    // Number of network rematches for each rematch reason
    repeated NumberOfRematchesForReason number_of_rematches_per_reason= 1;
}

/**
 * Logs number of network rematches for rematch reason
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NumberOfRematchesForReason {
    // The reason of network rematch
    optional android.stats.connectivity.RematchReason rematch_reason = 1;

    // Number of network rematches
    optional int32 rematch_count = 2;
};

/**
 * Pulls information for connectivity stats.
 *
 * Pulled from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message ConnectivityStateSample {
    // Number of networks per list of transports
    optional NetworkCountPerTransports network_count_per_transports = 1
    [(android.os.statsd.log_mode) = MODE_BYTES];

    // This is a list of networks with their transports and the duration
    optional ConnectionDurationPerTransports connection_duration_per_transports = 2
    [(android.os.statsd.log_mode) = MODE_BYTES];

    // Number of requests per category
    optional NetworkRequestCount network_request_count  = 3
    [(android.os.statsd.log_mode) = MODE_BYTES];

    // Full list of network details (slice by transport / meteredness / internet+validated)
    optional NetworkList networks = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
}


/**
 * Pulls information for network selection rematch info.
 *
 * Pulled from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkSelectionRematchReasonsInfo {
    // Number of rematch per rematch reason
    optional NumberOfRematchesPerReason number_of_rematches_per_reason = 1
    [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Logs rematch information for the default network
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message DefaultNetworkRematchInfo {
    // The session id comes from each reboot, this is used to correlate the statistics of the
    // networkselect on the same boot
    optional int64 session_id = 1;

    // The information of old device default network
    optional NetworkDescription old_network = 2 [(android.os.statsd.log_mode) = MODE_BYTES];

    // The information of new device default network
    optional NetworkDescription new_network = 3 [(android.os.statsd.log_mode) = MODE_BYTES];

    // The reason of network rematch
    optional android.stats.connectivity.RematchReason rematch_reason = 4;

    // The time duration the device kept the old network as the default in seconds
    optional int32 time_duration_on_old_network_sec = 5;
}

/**
 * Logs network selection performance
 *
 * Logs from:
 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
 */
message NetworkSelectionPerformance {
    // Number of network requests
    optional int32 number_of_network_requests = 1;

    // List of networks right now
    // (slice by transport / meteredness / internet+validated)
    optional NetworkList networks = 2 [(android.os.statsd.log_mode) = MODE_BYTES];

    // The latency of selection computed in milli-second
    optional int32 selection_computed_latency_milli = 3;

    // The latency of selection applied in milli-second
    optional int32 selection_applied_latency_milli = 4;

    // The latency of selection issued in milli-second
    optional int32 selection_issued_latency_milli = 5;
}

message NetworkSliceRequestCountSample {
    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int64 slice_id = 1;

    // Bitfield representing the network's enterprise capability identifier
    // (e.g. NET_ENTERPRISE_ID_1), defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 enterprise_id = 2;

    // number of request for this slice
    optional int32 request_count = 3;

    // number of apps with outstanding request(s) for this slice
    optional int32 distinct_app_count = 4;
}

message NetworkSliceSessionEnded {
    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int64 slice_id = 1;

    // Bitfield representing the network's enterprise capability identifier
    // (e.g. NET_ENTERPRISE_ID_1), defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 enterprise_id = 2;

    // Number of bytes received at the device on this slice id
    optional int64 rx_bytes = 3;

    // Number of bytes transmitted by the device on this slice id
    optional int64 tx_bytes = 4;

    // Number of apps that have used this slice
    optional int32 number_of_apps = 5;

    // How long(in seconds) this slice has been connected
    optional int32 slice_connection_duration_sec = 6;
}

message NetworkSliceDailyDataUsageReported {
    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int64 slice_id = 1;

    // Bitfield representing the network's enterprise capability identifier
    // (e.g. NET_ENTERPRISE_ID_1), defined in
    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
    optional int32 enterprise_id = 2;

    // Number of bytes received at the device on this slice id
    optional int64 rx_bytes = 3;

    // Number of bytes transmitted by the device on this slice id
    optional int64 tx_bytes = 4;

    // Number of apps that have used this slice
    optional int32 number_of_apps = 5;

    // How long(in seconds) this slice has been connected
    optional int32 slice_connection_duration_sec = 6;
}

/**
 * Logs the Brightness Configuration pushed by the long term model. The Brightness Configuration is
 * expressed as a curve where each point is a pair of ambient light (lux) and the corresponding
 * screen brightness (nits).
 *
 * Logged from:
 *    frameworks/base/services/core/java/com/android/server/display/DisplayManagerService.java
 */
message BrightnessConfigurationUpdated {
    // Array of ambient light values (in lux) to define the configuration.
    repeated float lux = 1;
    // Array of screen brightness values (in nits) corresponding to the lux
    // values above.
    repeated float nits = 2;
    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
    // "local:$PHYSICAL_ID".
    optional string physical_display_id = 3;
}

/**
 * Logs data when wear media output switcher is launched.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherLaunched {
    // Name of the media app package from where Output Switcher got triggered.
    optional string triggering_package_name = 1;

    // The operation type for invoking the OutputSwitcher
    optional com.google.android.wearable.media.routing.OpType op_type = 2;

    // The result of OutputSwticher launch.
    optional com.google.android.wearable.media.routing.LaunchResult result = 3;
}

/**
 * Logs data when wear media output switcher is finished.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherFinished {
    optional bool user_did_some_activity = 1;
    optional bool is_device_connected = 2;
}

/**
 * Logs data when wear media output switcher operation is INITIATED
 * or COMPLETED.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherConnectionReported {
    // Type of the medium through which media is played
    optional com.google.android.wearable.media.routing.MediumType source = 1;
    optional com.google.android.wearable.media.routing.MediumType target  = 2;

    // Reason for the connection reported
    optional com.google.android.wearable.media.routing.ConnectionReportReason reason = 3;

    // Current status of switching the media.
    optional com.google.android.wearable.media.routing.ConnectionState state =4;

    // Type of target device.
    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 5;

    // The operation type for invoking the OutputSwitcher
    optional com.google.android.wearable.media.routing.OpType op_type = 6;

    optional bool is_retry = 7;

    // For differentiating if the bluetooth device is connected from already
    // paired device list or from the bluetooth settings flow.
    optional bool is_already_paired = 8;
}

/**
 * Logs data when wear media output switcher starts scanning
 * for already paired devices.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherDeviceScanTriggered {
    // The current status of the scanned device.
    optional com.google.android.wearable.media.routing.ScanState scan_state = 1;

    // Name of the media app package from where Output Switcher got triggered.
    optional string triggering_package_name = 2;

    optional com.google.android.wearable.media.routing.OpType op_type = 3;
}

/**
 * Logs the latency for scanning the first device.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherFirstDeviceScanLatency {
    // The latency of scanning the first device
    optional int32 latency_in_millis = 1;
}

/**
 * Logs the latency for scanning all devices.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherAllDevicesScanLatency {
    // The latency of scanning all available devices in milli-second
    optional int32 latency_in_millis = 1;

    // Type of target device.
    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 2;
}

/**
 * Logs the latency in connecting to an already paired device.
 *
 * Logged from:
 * package: vendor/google_clockwork/packages/Media
 */
message WearMediaOutputSwitcherConnectDeviceLatency {
    // The latency of connecting to an already paired device in milli-second.
    optional int32 latency_in_millis = 1;

    // Type of target medium.
    optional com.google.android.wearable.media.routing.MediumType target_device_medium_type = 2;

    // Type of target device.
    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 3;
}

/**
 * Logs package manager snapshot performance.
 *
 * Logs from:
 *   frameworks/base/services/core/java/com/android/server/pm/SnapshotStatistics.java
 */
message PackageManagerSnapshotReported {
    // The histogram of snapshot rebuild latency in a period. Each bucket
    // represents a range of rebuild latency such as less than 1 ms, and the
    // value of the bucket is the number of snapshots in this range.
    repeated int32 rebuild_latency_buckets= 1;

    // The histogram of the snapshot usage in a period. Each bucket
    // represents a range of snapshot uses such as less than 1, and the
    // value is the number of snapshots in this range.
    repeated int32 reuse_count_buckets = 2;

    // The maximum rebuild latency in a period.
    optional int64 max_rebuild_latency_us = 3;

    // The maximum number of snapshot usage in a period.
    optional int32 max_reuse_count = 4;

    // The average rebuild latency for each snapshot in a period.
    optional int64 rebuild_latency_us_avg = 5;

    // The average snapshot usage for each snapshot in a period.
    optional int32 reuse_count_avg = 6;

    // The number of packages on the device.
    optional int32 packages_count = 7;
}

/**
 * Logs package manager apps filter cache built performance.
 *
 * Logs from:
 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
 */
message PackageManagerAppsFilterCacheBuildReported {
    // An event id to indicate the type of the cache building.
    enum Event {
        UNSPECIFIED = 0;
        BOOT = 1;
        USER_CREATED = 2;
        USER_DELETED = 3;
    }
    optional Event event_type = 1;

    // The time to build the cache in microseconds.
    optional int64 build_cache_latency_us = 2;

    // The number of users on the device.
    optional int32 user_count = 3;

    // The number of packages on the device.
    optional int32 packages_count = 4;

    // The size of the cache.
    optional int32 cache_size_bytes = 5;
}

/**
 * Logs package manager apps filter cache updated performance.
 *
 * Logs from:
 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
 */
message PackageManagerAppsFilterCacheUpdateReported {
    // An event id to indicate the type of cache updating.
    enum Event {
        UNSPECIFIED = 0;
        PACKAGE_ADDED = 1;
        PACKAGE_DELETED = 2;
        PACKAGE_REPLACED = 3;
        COMPAT_CHANGED = 4;
    }
    optional Event event_type = 1;

    // The package's uid.
    optional int32 uid = 2 [(is_uid) = true];

    // The time to update the cache in microseconds.
    optional int64 update_cache_latency_us = 3;

    // The number of users on the device.
    optional int32 user_count = 4;

    // The number of packages on the device.
    optional int32 packages_count = 5;

    // The size of the cache.
    optional int32 cache_size_bytes = 6;
}

/**
* Logged during the watch face editing session in Wear Services
* This atom will log the duration with SessionStateEnum#END.
*
* Logged from :
* com/google/wear/services/watchfaces/editing/api/WatchFaceEditingApiImpl.java
*/
message WsWatchFaceEdited {
   // Depicts the state of the session eg: START/END/ABORT.
   optional android.app.wearservices.SessionStateEnum session_state = 1;

   // Session duration for watch face editing.
   optional int32 session_duration_millis = 2;

   // Enum to depict the source of the request. Values (PHONE, WATCH)
   optional android.app.wearservices.RequestSource request_source = 3;

   // Component package for watch face.
   optional int32 component_package_uid = 4 [(is_uid) = true];
}

/**
* Logged for watch face favorite feature in Wear Services.
*
* Logged from :
* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
*/
message WsWatchFaceFavouriteActionReported {
   // Component package for watch face.
   optional int32 component_package_uid = 1 [(is_uid) = true];

   // Depicts the action for wf favorites eg: Add/Remove.
   optional android.app.wearservices.ActionEnum favorite_action = 2;

   // Enum to depict the source of the request. Values (PHONE, WATCH)
   optional android.app.wearservices.RequestSource request_source = 3;
}

/**
* Logged for the watch face set feature in Wear Services.
*
* Logged from :
* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
*/
message WsWatchFaceSetActionReported {
   // Component package for watch face.
   optional int32 component_package_uid = 1 [(is_uid) = true];

  // Result for WF, whether it resulted in SAME/FAVORITE/FALLBACK
  optional android.app.wearservices.SetResultEnum wf_set_result = 2;

  // Enum to depict the source of the request. Values (PHONE, WATCH)
   optional android.app.wearservices.RequestSource request_source = 3;
}

/**
* Logged when tile list is modified (go/wear-dd-wearservices-telemetry)
*/
message WsTileListChanged {
    enum Event {
        EVENT_UNKNOWN = 0;
        TILE_ADDED = 1;
        TILE_REMOVED = 2;
    }
    // Component package for the tile that is being changed.
    optional int32 component_package_uid = 1 [(is_uid) = true];

    // Class name for the tile.
    optional string component_class_name = 2;

    // The event in result of which tile list has changed.
    optional Event event = 3;

    // Where a tile has been changed from. When changed on the companion equals
    // to the phone source, otherwise watch source if it's changed from the watch.
    optional android.app.wearservices.RequestSource request_source = 4;
}

/**
* A snapshot of all visible tiles in the order they appear on the watch.
* (go/wear-dd-wearservices-telemetry)
*/
message WsTileSnapshot {
    // Component package name for the tiles.
    repeated string component_package_name = 1;

    // Class name for the tiles.
    repeated string component_class_name = 2;
}
/*
* Logs calls to getType of a contentProvider, where the caller has potentially no access to
* the provider.
*
* Logs from :
* frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
* frameworks/base/core/java/android/content/ContentProvider.java
*/
message GetTypeAccessedWithoutPermission{
  // Indicator of the type of permission failure
  enum FailureType{
      UNSPECIFIED = 0;
      AM_FRAMEWORK_PERMISSION = 1;
      AM_CHECK_URI_PERMISSION = 2;
      AM_ERROR = 3;
      PROVIDER_FRAMEWORK_PERMISSION = 4;
      PROVIDER_CHECK_URI_PERMISSION = 5;
      PROVIDER_ERROR = 6;
  }
  optional FailureType location = 1;
  // Name of the caller package
  optional int32 calling_uid = 2 [(is_uid) = true];
  // Name of the provider (authority) which is being accessed
  optional string provider = 3;
  // Type of the uri returned
  optional string type = 4;
}

/** Logged when a complication is changed on a watch face. Both
  data for complication that is being placed in the complication
  slot (we call is new here) and for complication that is being
  replaced (we call is old) is reported.
*/
message WsWatchFaceComplicationSetChanged {
  // Watch face package uid
  optional int32 watch_face_package_uid = 1 [(is_uid) = true];

  // Complication component package uid for complication that is being replaced.
  // Equals to -1 if new complication is placed on previously empty slot.
  optional int32 old_complication_component_package_uid = 2 [(is_uid) = true];

  // Complication component class name for complication that is being replaced.
  // Equals to empty string if new complication is placed on previously empty slot.
  optional string old_complication_component_class_name = 3;

  // Complication component package uid for new complication.
  // Equals to -1 if complication is removed from complication slot.
  optional int32 new_complication_component_package_uid = 4 [(is_uid) = true];

  // Complication component class name for new complication.
  // Equals to empty string if complication is removed from complication slot.
  optional string new_complication_component_class_name = 5;

  // Where a complication has been changed from. When changed on the companion equals
  // to SOURCE_PHONE, otherwise if it's changed from the watch SOURCE_WATCH.
  optional android.app.wearservices.RequestSource request_source = 6;

  // Old complication type.
  optional int32 old_complication_type = 7;

  // New complication type.
  optional int32 new_complication_type = 8;
}

/** Snapshot of all active complications on the current watch face.
*   (go/wear-dd-wearservices-telemetry)
*/
message WsActiveWatchFaceComplicationSetSnapshot {
  // Complication package name.
  repeated string complication_component_package_name = 1;

  // Complication component class name.
  repeated string complication_component_class_name = 2;

  // Complication type.
  repeated int32 complication_type = 4;

  // Active watch face package uid.
  optional int32 watch_face_package_uid = 3 [(is_uid) = true];

  /* Active watch face class name. This will be
  null for Declarative WF packages, as these packages have only one WF. */
  optional string watch_face_class_name = 5;
}

message UnsafeIntentEventReported {
    enum EventType {
        UNKNOWN = 0;
        // When a component is matched with a null action.
        NULL_ACTION_MATCH = 1;
        // When a non-exported internal component is matched.
        INTERNAL_NON_EXPORTED_COMPONENT_MATCH = 2;
        // When an explicit intent does not match
        // an external component intent filter.
        EXPLICIT_INTENT_FILTER_UNMATCH = 3;
        // When a mutable pending intent for an implicit intent is retrieved
        NEW_MUTABLE_IMPLICIT_PENDING_INTENT_RETRIEVED = 4;
    }
    // Type of matching event.
    optional EventType event_type = 1;
    // The calling UID.
    optional int32 calling_uid = 2;
    // The component name of the intent.
    optional string component_name = 3;
    // The package name of the intent.
    optional string package_name = 4;
    // The action of the intent.
    optional string action = 5;
    // List of categories of the intent.
    repeated string categories = 6;
    // Data type of the intent.
    optional string data_type = 7;
    // Data scheme of the intent.
    optional string data_scheme = 8;
    // Is the unsafe intent event blocked by the system.
    optional bool is_blocked = 9;
}

/**
 * Snapshot of all favorite watch faces from the watch.
 */
message WsFavouriteWatchFaceListSnapshot {
  repeated string watch_face_component_name = 1;
}