summaryrefslogtreecommitdiff
path: root/service/proto/src/metrics.proto
blob: 225cad81fb50bf92396bb6faf11d509550230305 (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
/*
 * Copyright (C) 2016 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 com_android_server_wifi;

option java_package = "com.android.server.wifi.proto";
option java_outer_classname = "WifiMetricsProto";

// The information about the Wifi events.
message WifiLog {
  reserved 122;

  // Session information that gets logged for every Wifi connection.
  repeated ConnectionEvent connection_event = 1;

  // Number of saved networks in the user profile.
  optional int32 num_saved_networks = 2;

  // Number of open networks in the saved networks.
  optional int32 num_open_networks = 3;

  // Number of legacy personal networks.
  optional int32 num_legacy_personal_networks = 4;

  // Number of legacy enterprise networks.
  optional int32 num_legacy_enterprise_networks = 5;

  // Does the user have location setting enabled.
  optional bool is_location_enabled = 6;

  // Does the user have scanning enabled.
  optional bool is_scanning_always_enabled = 7;

  // Number of times user toggled wifi using the settings menu.
  optional int32 num_wifi_toggled_via_settings = 8;

  // Number of times user toggled wifi using the airplane menu.
  optional int32 num_wifi_toggled_via_airplane = 9;

  // Number of networks added by the user.
  optional int32 num_networks_added_by_user = 10;

  // Number of networks added by applications.
  optional int32 num_networks_added_by_apps = 11;

  // Number scans that returned empty results.
  optional int32 num_empty_scan_results = 12;

  // Number scans that returned at least one result.
  optional int32 num_non_empty_scan_results = 13;

  // Number of single scans requests.
  optional int32 num_oneshot_scans = 14;

  // Number of repeated background scans that were scheduled to the chip.
  optional int32 num_background_scans = 15;

  // Error codes that a scan can result in.
  enum ScanReturnCode {

    // Return Code is unknown.
    SCAN_UNKNOWN = 0;

    // Scan was successful.
    SCAN_SUCCESS = 1;

    // Scan was successfully started, but was interrupted.
    SCAN_FAILURE_INTERRUPTED = 2;

    //  Scan failed to start because of invalid configuration
    //  (bad channel, etc).
    SCAN_FAILURE_INVALID_CONFIGURATION = 3;

    // Could not start a scan because wifi is disabled.
    FAILURE_WIFI_DISABLED = 4;

  }

  // Mapping of error codes to the number of times that scans resulted
  // in that error.
  repeated ScanReturnEntry scan_return_entries = 16;

  message ScanReturnEntry {

    // Return code of the scan.
    optional ScanReturnCode scan_return_code = 1;

    // Number of entries that were found in the scan.
    optional int32 scan_results_count = 2;
  }

  // State of the Wifi.
  enum WifiState {

    // State is unknown.
    WIFI_UNKNOWN = 0;

    // Wifi is disabled.
    WIFI_DISABLED = 1;

    // Wifi is enabled.
    WIFI_DISCONNECTED = 2;

    // Wifi is enabled and associated with an AP.
    WIFI_ASSOCIATED = 3;
  }

  // Mapping of system state to the number of times that scans were requested in
  // that state
  repeated WifiSystemStateEntry wifi_system_state_entries = 17;

  message WifiSystemStateEntry {

    // Current WiFi state.
    optional WifiState wifi_state = 1;

    // Count of scans in state.
    optional int32 wifi_state_count = 2;

    // Is screen on.
    optional bool is_screen_on = 3;
  }

  // Mapping of Error/Success codes to the number of background scans that resulted in it
  repeated ScanReturnEntry background_scan_return_entries = 18;

  // Mapping of system state to the number of times that Background scans were requested in that
  // state
  repeated WifiSystemStateEntry background_scan_request_state = 19;

  // Total number of times the Watchdog of Last Resort triggered, resetting the wifi stack
  optional int32 num_last_resort_watchdog_triggers = 20;

  // Total number of networks over bad association threshold when watchdog triggered
  optional int32 num_last_resort_watchdog_bad_association_networks_total = 21;

  // Total number of networks over bad authentication threshold when watchdog triggered
  optional int32 num_last_resort_watchdog_bad_authentication_networks_total = 22;

  // Total number of networks over bad dhcp threshold when watchdog triggered
  optional int32 num_last_resort_watchdog_bad_dhcp_networks_total = 23;

  // Total number of networks over bad other threshold when watchdog triggered
  optional int32 num_last_resort_watchdog_bad_other_networks_total = 24;

  // Total count of networks seen when watchdog triggered
  optional int32 num_last_resort_watchdog_available_networks_total = 25;

  // Total count of triggers with atleast one bad association network
  optional int32 num_last_resort_watchdog_triggers_with_bad_association = 26;

  // Total count of triggers with atleast one bad authentication network
  optional int32 num_last_resort_watchdog_triggers_with_bad_authentication = 27;

  // Total count of triggers with atleast one bad dhcp network
  optional int32 num_last_resort_watchdog_triggers_with_bad_dhcp = 28;

  // Total count of triggers with atleast one bad other network
  optional int32 num_last_resort_watchdog_triggers_with_bad_other = 29;

  // Count of times connectivity watchdog confirmed pno is working
  optional int32 num_connectivity_watchdog_pno_good = 30;

  // Count of times connectivity watchdog found pno not working
  optional int32 num_connectivity_watchdog_pno_bad = 31;

  // Count of times connectivity watchdog confirmed background scan is working
  optional int32 num_connectivity_watchdog_background_good = 32;

  // Count of times connectivity watchdog found background scan not working
  optional int32 num_connectivity_watchdog_background_bad = 33;

  // The time duration represented by this wifi log, from start to end of capture
  optional int32 record_duration_sec = 34;

  // Counts the occurrences of each individual RSSI poll level
  repeated RssiPollCount rssi_poll_rssi_count = 35;

  // Total number of times WiFi connected immediately after a Last Resort Watchdog trigger,
  // without new networks becoming available.
  optional int32 num_last_resort_watchdog_successes = 36;

  // Total number of saved hidden networks
  optional int32 num_hidden_networks = 37;

  // Total number of saved passpoint / hotspot 2.0 networks
  optional int32 num_passpoint_networks = 38;

  // Total number of scan results
  optional int32 num_total_scan_results = 39;

  // Total number of scan results for open networks
  optional int32 num_open_network_scan_results = 40;

  // Total number of scan results for legacy personal networks
  optional int32 num_legacy_personal_network_scan_results = 41;

  // Total number of scan results for legacy enterprise networks
  optional int32 num_legacy_enterprise_network_scan_results = 42;

  // Total number of scan results for hidden networks
  optional int32 num_hidden_network_scan_results = 43;

  // Total number of scan results for hotspot 2.0 r1 networks
  optional int32 num_hotspot2_r1_network_scan_results = 44;

  // Total number of scan results for hotspot 2.0 r2 networks
  optional int32 num_hotspot2_r2_network_scan_results = 45;

  // Total number of scans handled by framework (oneshot or otherwise)
  optional int32 num_scans = 46;

  // Counts the occurrences of each alert reason.
  repeated AlertReasonCount alert_reason_count = 47;

  // Counts the occurrences of each Wifi score
  repeated WifiScoreCount wifi_score_count = 48;

  // Histogram of Soft AP Durations
  repeated SoftApDurationBucket soft_ap_duration = 49;

  // Histogram of Soft AP ReturnCode
  repeated SoftApReturnCodeCount soft_ap_return_code = 50;

  // Histogram of the delta between scan result RSSI and RSSI polls
  repeated RssiPollCount rssi_poll_delta_count = 51;

  // List of events
  repeated StaEvent sta_event_list = 52;

  // Total number of times WiFi HAL crashed.
  optional int32 num_hal_crashes = 53;

  // Total number of times WiFicond crashed.
  optional int32 num_wificond_crashes = 54;

  // Indicates the number of times an error was encountered in
  // Wifi HAL on |WifiNative.setupInterfaceForClientMode|.
  optional int32 num_setup_client_interface_failure_due_to_hal = 55;

  // Indicates the number of times an error was encountered in
  // Wificond on |WifiNative.setupInterfaceForClientMode|.
  optional int32 num_setup_client_interface_failure_due_to_wificond = 56;

  // Wi-Fi Aware metrics
  optional WifiAwareLog wifi_aware_log = 57;

  // Number of saved Passpoint providers in user profile.
  optional int32 num_passpoint_providers = 58;

  // Count of times Passpoint provider being installed.
  optional int32 num_passpoint_provider_installation = 59;

  // Count of times Passpoint provivider is installed successfully.
  optional int32 num_passpoint_provider_install_success = 60;

  // Count of times Passpoint provider is being uninstalled.
  optional int32 num_passpoint_provider_uninstallation = 61;

  // Count of times Passpoint provider is uninstalled successfully.
  optional int32 num_passpoint_provider_uninstall_success = 62;

  // Count of saved Passpoint providers device has ever connected to.
  optional int32 num_passpoint_providers_successfully_connected = 63;

  // Histogram counting instances of scans with N many ScanResults with unique ssids
  repeated NumConnectableNetworksBucket total_ssids_in_scan_histogram = 64;

  // Histogram counting instances of scans with N many ScanResults/bssids
  repeated NumConnectableNetworksBucket total_bssids_in_scan_histogram = 65;

  // Histogram counting instances of scans with N many unique open ssids
  repeated NumConnectableNetworksBucket available_open_ssids_in_scan_histogram = 66;

  // Histogram counting instances of scans with N many bssids for open networks
  repeated NumConnectableNetworksBucket available_open_bssids_in_scan_histogram = 67;

  // Histogram counting instances of scans with N many unique ssids for saved networks
  repeated NumConnectableNetworksBucket available_saved_ssids_in_scan_histogram = 68;

  // Histogram counting instances of scans with N many bssids for saved networks
  repeated NumConnectableNetworksBucket available_saved_bssids_in_scan_histogram = 69;

  // Histogram counting instances of scans with N many unique SSIDs for open or saved networks
  repeated NumConnectableNetworksBucket available_open_or_saved_ssids_in_scan_histogram = 70;

  // Histogram counting instances of scans with N many BSSIDs for open or saved networks
  repeated NumConnectableNetworksBucket available_open_or_saved_bssids_in_scan_histogram = 71;

  // Histogram counting instances of scans with N many ScanResults matching unique saved passpoint providers
  repeated NumConnectableNetworksBucket available_saved_passpoint_provider_profiles_in_scan_histogram = 72;

  // Histogram counting instances of scans with N many ScanResults BSSIDs matching a saved passpoint provider
  repeated NumConnectableNetworksBucket available_saved_passpoint_provider_bssids_in_scan_histogram = 73;

  // Counts the number of AllSingleScanLister.onResult calls with a full band scan result
  optional int32 full_band_all_single_scan_listener_results = 74;

  // Counts the number of AllSingleScanLister.onResult calls with a partial (channels) scan result
  optional int32 partial_all_single_scan_listener_results = 75;

  // Pno scan metrics
  optional PnoScanMetrics pno_scan_metrics = 76;

  // Histogram of "Connect to Network" notifications.
  // The notification Action should be unset.
  repeated ConnectToNetworkNotificationAndActionCount connect_to_network_notification_count = 77;

  // Histogram of "Connect to Network" notification user actions.
  repeated ConnectToNetworkNotificationAndActionCount connect_to_network_notification_action_count = 78;

  // The number of SSIDs blocked from recommendation by the open network
  // notification recommender
  optional int32 open_network_recommender_blocklist_size = 79;

  // Is the available network notification feature turned on
  optional bool is_wifi_networks_available_notification_on = 80;

  // Count of recommendation updates made by the open network notification
  // recommender
  optional int32 num_open_network_recommendation_updates = 81;

  // Count of connection attempts that were initiated unsuccessfully
  optional int32 num_open_network_connect_message_failed_to_send = 82;

  // Histogram counting instances of scans with N many HotSpot 2.0 R1 APs
  repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_in_scan_histogram = 83;

  // Histogram counting instances of scans with N many HotSpot 2.0 R2 APs
  repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_in_scan_histogram = 84;

  // Histogram counting instances of scans with N many unique HotSpot 2.0 R1 ESS.
  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
  // order).
  repeated NumConnectableNetworksBucket observed_hotspot_r1_ess_in_scan_histogram = 85;

  // Histogram counting instances of scans with N many unique HotSpot 2.0 R2 ESS.
  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
  // order).
  repeated NumConnectableNetworksBucket observed_hotspot_r2_ess_in_scan_histogram = 86;

  // Histogram counting number of HotSpot 2.0 R1 APs per observed ESS in a scan
  // (one value added per unique ESS - potentially multiple counts per single
  // scan!)
  repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_per_ess_in_scan_histogram = 87;

  // Histogram counting number of HotSpot 2.0 R2 APs per observed ESS in a scan
  // (one value added per unique ESS - potentially multiple counts per single
  // scan!)
  repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_per_ess_in_scan_histogram = 88;

  // SoftAP event list tracking sessions and client counts in tethered mode
  repeated SoftApConnectedClientsEvent soft_ap_connected_clients_events_tethered = 89;

  // SoftAP event list tracking sessions and client counts in local only mode
  repeated SoftApConnectedClientsEvent soft_ap_connected_clients_events_local_only = 90;

  // WPS connection metrics - removed
  reserved 91;
  reserved "wps_metrics";

  // Wifi power statistics
  optional WifiPowerStats wifi_power_stats = 92;

  // Number of connectivity single scan requests.
  optional int32 num_connectivity_oneshot_scans = 93;

  // WifiWake statistics
  optional WifiWakeStats wifi_wake_stats = 94;

  // Histogram counting instances of scans with N many 802.11mc (RTT) supporting APs
  repeated NumConnectableNetworksBucket observed_80211mc_supporting_aps_in_scan_histogram = 95;

  // Total number of times supplicant crashed.
  optional int32 num_supplicant_crashes = 96;

  // Total number of times hostapd crashed.
  optional int32 num_hostapd_crashes = 97;

  // Indicates the number of times an error was encountered in
  // supplicant on |WifiNative.setupInterfaceForClientMode|.
  optional int32 num_setup_client_interface_failure_due_to_supplicant = 98;

  // Indicates the number of times an error was encountered in
  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
  optional int32 num_setup_soft_ap_interface_failure_due_to_hal = 99;

  // Indicates the number of times an error was encountered in
  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
  optional int32 num_setup_soft_ap_interface_failure_due_to_wificond = 100;

  // Indicates the number of times an error was encountered in
  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
  optional int32 num_setup_soft_ap_interface_failure_due_to_hostapd = 101;

  // Indicates the number of times we got an interface down in client mode.
  optional int32 num_client_interface_down = 102;

  // Indicates the number of times we got an interface down in softap mode.
  optional int32 num_soft_ap_interface_down = 103;

  // Indicates the number of scan requests from external apps.
  optional int32 num_external_app_oneshot_scan_requests = 104;

  // Indicates the number of times a scan request from an external foreground app was throttled.
  optional int32 num_external_foreground_app_oneshot_scan_requests_throttled = 105;

  // Indicates the number of times a scan request from an external background app was throttled.
  optional int32 num_external_background_app_oneshot_scan_requests_throttled = 106;

  // WifiLastResortWatchdog time milliseconds delta between trigger and first connection success
  optional int64 watchdog_trigger_to_connection_success_duration_ms = 107 [default = -1];

  // The number of times wifi experienced failures after watchdog has already been triggered and is
  // waiting for a connection success
  optional int64 watchdog_total_connection_failure_count_after_trigger = 108;

  // Number of times DFS channel scans are requested in single scan requests.
  optional int32 num_oneshot_has_dfs_channel_scans = 109;

  // Wi-Fi RTT metrics
  optional WifiRttLog wifi_rtt_log = 110;

  // Flag which indicates if Connected MAC Randomization is enabled
  optional bool is_mac_randomization_on = 111 [default = false];

  // Number of radio mode changes to MCC (Multi channel concurrency).
  optional int32 num_radio_mode_change_to_mcc = 112;

  // Number of radio mode changes to SCC (Single channel concurrency).
  optional int32 num_radio_mode_change_to_scc = 113;

  // Number of radio mode changes to SBS (Single band simultaneous).
  optional int32 num_radio_mode_change_to_sbs = 114;

  // Number of radio mode changes to DBS (Dual band simultaneous).
  optional int32 num_radio_mode_change_to_dbs = 115;

  // Number of times the firmware picked a SoftAp channel not satisfying user band preference.
  optional int32 num_soft_ap_user_band_preference_unsatisfied = 116;

  // Identifier for experimental scoring parameter settings.
  optional string score_experiment_id = 117;

  // Data on wifi radio usage
  optional WifiRadioUsage wifi_radio_usage = 118;

  // Stores settings values used for metrics testing.
  optional ExperimentValues experiment_values = 119;

  // List of WifiIsUnusableEvents which get logged when we notice that WiFi is unusable.
  // Collected only when WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED Settings is enabled.
  repeated WifiIsUnusableEvent wifi_is_unusable_event_list = 120;

  // Counts the occurrences of each link speed (Mbps) level
  // with rssi (dBm) and rssi^2 sums (dBm^2)
  repeated LinkSpeedCount link_speed_counts = 121;

  // Hardware revision (EVT, DVT, PVT etc.)
  optional string hardware_revision = 124;

  // Total wifi link layer usage data over the logging duration in ms.
  optional WifiLinkLayerUsageStats wifi_link_layer_usage_stats = 125;

  // Multiple lists of timestamped link layer stats with labels to represent whether wifi is usable
  repeated WifiUsabilityStats wifi_usability_stats_list = 126;

  // Counts the occurrences of each Wifi usability score provided by external app
  repeated WifiUsabilityScoreCount wifi_usability_score_count = 127;

  // List of PNO scan stats, one element for each mobility state
  repeated DeviceMobilityStatePnoScanStats mobility_state_pno_stats_list = 128;

  // Wifi p2p statistics
  optional WifiP2pStats wifi_p2p_stats = 129;

  // Easy Connect (DPP) metrics
  optional WifiDppLog wifi_dpp_log = 130;

  // Number of Enhanced Open (OWE) networks in the saved networks.
  optional int32 num_enhanced_open_networks = 131;

  // Number of WPA3-Personal networks.
  optional int32 num_wpa3_personal_networks = 132;

  // Number of WPA3-Enterprise networks.
  optional int32 num_wpa3_enterprise_networks = 133;

  // Total number of scan results for Enhanced open networks
  optional int32 num_enhanced_open_network_scan_results = 134;

  // Total number of scan results for WPA3-Personal networks
  optional int32 num_wpa3_personal_network_scan_results = 135;

  // Total number of scan results for WPA3-Enterprise networks
  optional int32 num_wpa3_enterprise_network_scan_results = 136;

  // WifiConfigStore read/write metrics.
  optional WifiConfigStoreIO wifi_config_store_io = 137;

  // Total number of saved networks with mac randomization enabled.
  optional int32 num_saved_networks_with_mac_randomization = 138;

  // Link Probe metrics
  optional LinkProbeStats link_probe_stats = 139;

  // List of NetworkSelectionExperimentDecisions stats for each experiment
  repeated NetworkSelectionExperimentDecisions network_selection_experiment_decisions_list = 140;

  // Network Request API surface metrics.
  optional WifiNetworkRequestApiLog wifi_network_request_api_log = 141;

  // Network Suggestion API surface metrics.
  optional WifiNetworkSuggestionApiLog wifi_network_suggestion_api_log = 142;

  // WifiLock statistics
  optional WifiLockStats wifi_lock_stats = 143;

  // Stats on number of times Wi-Fi is turned on/off though the WifiManager#setWifiEnabled API
  optional WifiToggleStats wifi_toggle_stats = 144;

  // Number of times WifiManager#addOrUpdateNetwork is called.
  optional int32 num_add_or_update_network_calls = 145;

  // Number of times WifiManager#enableNetwork is called.
  optional int32 num_enable_network_calls = 146;

  // Passpoint provison metrics
  optional PasspointProvisionStats passpoint_provision_stats = 147;

  // Histogram of the EAP method type of all installed Passpoint profiles for R1
  repeated PasspointProfileTypeCount installed_passpoint_profile_type_for_r1 = 123;

  // Histogram of the EAP method type of all installed Passpoint profiles for R2
  repeated PasspointProfileTypeCount installed_passpoint_profile_type_for_r2 = 148;

  // Histogram of Tx link speed at 2G
  repeated Int32Count tx_link_speed_count_2g = 149;

  // Histogram of Tx link speed at 5G low band
  repeated Int32Count tx_link_speed_count_5g_low = 150;

  // Histogram of Tx link speed at 5G middle band
  repeated Int32Count tx_link_speed_count_5g_mid = 151;

  // Histogram of Tx link speed at 5G high band
  repeated Int32Count tx_link_speed_count_5g_high = 152;

  // Histogram of Rx link speed at 2G
  repeated Int32Count rx_link_speed_count_2g = 153;

  // Histogram of Rx link speed at 5G low band
  repeated Int32Count rx_link_speed_count_5g_low = 154;

  // Histogram of Rx link speed at 5G middle band
  repeated Int32Count rx_link_speed_count_5g_mid = 155;

  // Histogram of Rx link speed at 5G high band
  repeated Int32Count rx_link_speed_count_5g_high = 156;

  // Count of IP renewal failures.
  optional int32 num_ip_renewal_failure = 157;

  // Metrics collected by health monitor
  optional HealthMonitorMetrics health_monitor_metrics = 158;

  // Metrics related to the WifiBlocklistMonitor
  optional BssidBlocklistStats bssid_blocklist_stats = 159;

  // Connection duration under various health conditions
  optional ConnectionDurationStats connection_duration_stats = 160;

  // Number of WAPI-Personal saved networks.
  optional int32 num_wapi_personal_networks = 161;

  // Number of WAPI-Enterprise saved networks.
  optional int32 num_wapi_enterprise_networks = 162;

  // Total number of scan results for WAPI-Personal networks
  optional int32 num_wapi_personal_network_scan_results = 163;

  // Total number of scan results for WAPI-Enterprise networks
  optional int32 num_wapi_enterprise_network_scan_results = 164;

  // Is the external WiFi connected network scorer from OEM extension module turned on
  optional bool is_external_wifi_scorer_on = 165 [default = false];

  // Metrics related to Wi-Fi off
  optional WifiOffMetrics wifi_off_metrics = 166;

  // Total number of scan results for MBO supported networks
  optional int32 num_mbo_supported_network_scan_results = 167;

  // Total number of scan results for MBO cellular data aware networks
  optional int32 num_mbo_cellular_data_aware_network_scan_results = 168;

  // Total number of scan results for OCE supported networks
  optional int32 num_oce_supported_network_scan_results = 169;

  // Total number of scan results for FILS supported networks
  optional int32 num_fils_supported_network_scan_results = 170;

  // Total number of bssids filtered from network selection due to mbo association
  // disallowed indication
  optional int32 num_bssid_filtered_due_to_mbo_assoc_disallow_ind = 171;

  // Total number of connection to network supporting MBO
  optional int32 num_connect_to_network_supporting_mbo = 172;

  // Total number of connection to network supporting OCE
  optional int32 num_connect_to_network_supporting_oce = 173;

  // Total number of scans triggered due to steering request from AP
  optional int32 num_force_scan_due_to_steering_request = 174;

  // Total number of cellular switch requests from MBO supported AP
  optional int32 num_mbo_cellular_switch_request = 175;

  // Total number of connect request to AP adding FILS AKM
  optional int32 num_connect_request_with_fils_akm = 176;

  // Total number of successful L2 connection through FILS authentication
  optional int32 num_l2_connection_through_fils_authentication = 177;

  // Metrics related to limitation in soft ap config
  optional SoftApConfigLimitationMetrics soft_ap_config_limitation_metrics = 178;

  // WiFi channel utilization histogram of various RF bands
  optional ChannelUtilizationHistogram channel_utilization_histogram = 179;

  // WiFi Tx and Rx throughput histogram at various RF bands
  optional ThroughputMbpsHistogram throughput_mbps_histogram = 180;

  // Total number of steering requests which include MBO assoc retry delay
  optional int32 num_steering_request_including_mbo_assoc_retry_delay = 181;

  // Total number of scan results from 11ax network
  optional int32 num_11ax_network_scan_results = 182;

  // Total number of scan results from 6GHz band
  optional int32 num_6g_network_scan_results = 183;

  // Initial partial scan stats
  optional InitPartialScanStats init_partial_scan_stats = 184;

  // Total number of scan results for hotspot 2.0 r3 networks
  optional int32 num_hotspot2_r3_network_scan_results = 185;

  // Histogram counting instances of scans with N many HotSpot 2.0 R3 APs
  repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_in_scan_histogram = 186;

  // Histogram counting number of HotSpot 2.0 R3 APs per observed ESS in a scan
  // (one value added per unique ESS - potentially multiple counts per single
  // scan!)
  repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_per_ess_in_scan_histogram = 187;

  // Histogram counting instances of scans with N many unique HotSpot 2.0 R3 ESS.
  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
  // order).
  repeated NumConnectableNetworksBucket observed_hotspot_r3_ess_in_scan_histogram = 188;

  // Total number of Passpoint providers with no Root CA in their profile.
  optional int32 num_passpoint_provider_with_no_root_ca = 189;

  // Total number of Passpoint providers with self-signed root CA in their profile.
  optional int32 num_passpoint_provider_with_self_signed_root_ca = 190;

  // Total number of Passpoint providers with subscription expiration date in their profile.
  optional int32 num_passpoint_provider_with_subscription_expiration = 191;

  // List of user initiated actions
  repeated UserActionEvent user_action_events = 192;

  // Does the user have wifi verbose logging enabled.
  optional bool is_verbose_logging_enabled = 193;

  // Does the user have enhanced MAC randomization forced to on.
  optional bool is_enhanced_mac_randomization_force_enabled = 194;

  // Metered stats for saved networks.
  optional MeteredNetworkStats metered_network_stats_saved = 195;

  // Metered stats for suggestion networks.
  optional MeteredNetworkStats metered_network_stats_suggestion = 196;

  // Does the user have wifi wake enabled.
  optional bool is_wifi_wake_enabled = 197;

  // User reaction to the carrier or suggestion app approval UI.
  optional UserReactionToApprovalUiEvent user_reaction_to_approval_ui_event = 198;

  // Number of connection with different BSSID between framework and firmware selection.
  optional int32 num_bssid_different_selection_between_framework_and_firmware = 199;

  // Metrics about carrier wifi network.
  optional CarrierWifiMetrics carrier_wifi_metrics = 200;

  // Long version code of wifi mainline module, 0 means not available.
  optional int64 mainline_module_version = 201;

  // Histogram of Tx link speed at 6G low band
  repeated Int32Count tx_link_speed_count_6g_low = 202;

  // Histogram of Tx link speed at 6G middle band
  repeated Int32Count tx_link_speed_count_6g_mid = 203;

  // Histogram of Tx link speed at 6G high band
  repeated Int32Count tx_link_speed_count_6g_high = 204;

  // Histogram of Rx link speed at 6G low band
  repeated Int32Count rx_link_speed_count_6g_low = 205;

  // Histogram of Rx link speed at 6G middle band
  repeated Int32Count rx_link_speed_count_6g_mid = 206;

  // Histogram of Rx link speed at 6G high band
  repeated Int32Count rx_link_speed_count_6g_high = 207;

  // Metrics about the first connection after boot.
  optional FirstConnectAfterBootStats first_connect_after_boot_stats = 208;

  // Metrics for Wifi to Wifi switches.
  optional WifiToWifiSwitchStats wifi_to_wifi_switch_stats = 209;

  // Bandwidth estimator stats.
  optional BandwidthEstimatorStats bandwidth_estimator_stats = 210;

  // Total number of scan results from 6GHz PSC band
  optional int32 num_6g_psc_network_scan_results = 211;

  // Total number of Passpoint connections with a venue URL
  optional int32 total_number_of_passpoint_connections_with_venue_url = 212;

  // Total number of Passpoint connections with a T&C URL
  optional int32 total_number_of_passpoint_connections_with_terms_and_conditions_url = 213;

  // Total number of user accepted and T&C process completed successfully
  optional int32 total_number_of_passpoint_acceptance_of_terms_and_conditions = 214;

  // Total number of Passpoint profiles with decorated identity prefix
  optional int32 total_number_of_passpoint_profiles_with_decorated_identity = 215;

  // Scope of Passpoint deauth-imminent notification: ESS or BSS
  repeated Int32Count passpoint_deauth_imminent_scope = 216;

  // Total number of steering requests from AP
  optional int32 num_steering_request = 217;

  // Histogram corresponding to the number of times recent connection failure status are reported
  // per WifiConfiguration.RecentFailureReason
  repeated Int32Count recent_failure_association_status = 218;

  // Histogram of country codes observed from scan results.
  // Bucket WifiMetrics.COUNTRY_CODE_CONFLICT_WIFI_SCAN for the code conflict within scan results.
  // Bucket WifiMetrics.COUNTRY_CODE_CONFLICT_WIFI_SCAN_TELEPHONY for the code conflict between wifi
  // and telephony.
  // Bucket value is capped to WifiMetrics.MAX_COUNTRY_CODE_COUNT.
  repeated Int32Count country_code_scan_histogram = 219;

  // Each WifiUsabilityStatsTraining instance contains a list of WifiUsabilityStatsEntry objects,
  // representing a time series of WiFi usability statistics recorded within a specific data
  // capture period. It also includes information about the type of data capture and the duration
  // of the capture period.
  repeated WifiUsabilityStatsTraining wifi_usability_stats_training = 220;
}

// Information that gets logged for every WiFi connection.
message RouterFingerPrint {

  enum RoamType {

    // Type is unknown.
    ROAM_TYPE_UNKNOWN = 0;

    // No roaming - usually happens on a single band (2.4 GHz) router.
    ROAM_TYPE_NONE = 1;

    // Enterprise router.
    ROAM_TYPE_ENTERPRISE = 2;

    // DBDC => Dual Band Dual Concurrent essentially a router that
    // supports both 2.4 GHz and 5 GHz bands.
    ROAM_TYPE_DBDC = 3;
  }

  enum Auth {

    // Auth is unknown.
    AUTH_UNKNOWN = 0;

    // No authentication.
    AUTH_OPEN = 1;

    // If the router uses a personal authentication.
    AUTH_PERSONAL = 2;

    // If the router is setup for enterprise authentication.
    AUTH_ENTERPRISE = 3;
  }

  enum RouterTechnology {

    // Router is unknown.
    ROUTER_TECH_UNKNOWN = 0;

    // Router Channel A.
    ROUTER_TECH_A = 1;

    // Router Channel B.
    ROUTER_TECH_B = 2;

    // Router Channel G.
    ROUTER_TECH_G = 3;

    // Router Channel N.
    ROUTER_TECH_N = 4;

    // Router Channel AC.
    ROUTER_TECH_AC = 5;

    // When the channel is not one of the above.
    ROUTER_TECH_OTHER = 6;

    // Router Channel AX.
    ROUTER_TECH_AX = 7;
  }

  enum EapMethod {

    // No EAP method used
    TYPE_EAP_UNKNOWN = 0;

    // EAP with Transport Layer Security
    TYPE_EAP_TLS = 1;

    // EAP with Tunneled Transport Layer Security
    TYPE_EAP_TTLS = 2;

    // EAP with Subscriber Identity Module [RFC-4186]
    TYPE_EAP_SIM = 3;

    // EAP with Authentication and Key Agreement [RFC-4187]
    TYPE_EAP_AKA = 4;

    // EAP with Authentication and Key Agreement Prime [RFC-5448]
    TYPE_EAP_AKA_PRIME = 5;

    // Protected EAP
    TYPE_EAP_PEAP = 6;

    // EAP for Hotspot 2.0 r2 OSEN
    TYPE_EAP_UNAUTH_TLS = 7;

    // EAP with Password
    TYPE_EAP_PWD = 8;

    // EAP with WAPI certifcate
    TYPE_EAP_WAPI_CERT = 9;
  }

  enum AuthPhase2Method {

    // No phase2 method
    TYPE_PHASE2_NONE = 0;

    // Password Authentication Protocol
    TYPE_PHASE2_PAP = 1;

    // Microsoft Challenge Handshake Authentication Protocol
    TYPE_PHASE2_MSCHAP = 2;

    // Microsoft Challenge Handshake Authentication Protocol v2
    TYPE_PHASE2_MSCHAPV2 = 3;

    // Generic Token Card
    TYPE_PHASE2_GTC = 4;

    // EAP-Subscriber Identity Module [RFC-4186]
    TYPE_PHASE2_SIM = 5;

    // EAP-Authentication and Key Agreement [RFC-4187]
    TYPE_PHASE2_AKA = 6;

    // EAP-Authentication and Key Agreement Prime [RFC-5448]
    TYPE_PHASE2_AKA_PRIME = 7;
  }

  enum OcspType {
    // Do not use OCSP stapling
    TYPE_OCSP_NONE = 0;

    // Try to use OCSP stapling, but not require response
    TYPE_OCSP_REQUEST_CERT_STATUS = 1;

    // Require valid OCSP stapling response
    TYPE_OCSP_REQUIRE_CERT_STATUS = 2;

    // Require valid OCSP stapling response for all not-trusted certificates
    // in the server certificate chain
    TYPE_OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3;
  }

  optional RoamType roam_type = 1;

  // Channel on which the connection takes place.
  optional int32 channel_info = 2;

  // DTIM setting of the router.
  optional int32 dtim = 3;

  // Authentication scheme of the router.
  optional Auth authentication = 4;

  // If the router is hidden.
  optional bool hidden = 5;

  // Channel information.
  optional RouterTechnology router_technology = 6;

  // whether ipv6 is supported.
  optional bool supports_ipv6 = 7;

  // If the router is a Passpoint / Hotspot 2.0 network
  optional bool passpoint = 8;

  // EAP method used by the enterprise network
  optional EapMethod eap_method = 9;

  // Phase 2 authentication method after setting up a secure channel
  optional AuthPhase2Method auth_phase2_method = 10;

  // Online certificate status protocol stapling type
  optional OcspType ocsp_type = 11;

  // PMK caching enablement
  optional bool pmk_cache_enabled = 12;

  // Max Tx link speed (in Mbps) supported by current network (STA and AP)
  optional int32 max_supported_tx_link_speed_mbps = 13;

  // Max Rx link speed (in Mbps) supported by current network (STA and AP)
  optional int32 max_supported_rx_link_speed_mbps = 14;

  // If the Passpoint connection is provided by the Home provider or Roaming/visited network
  optional bool is_passpoint_home_provider = 15;
}

enum ClientRole {
  // default/Invalid role
  ROLE_UNKNOWN = 0;

  // STA created for scans only.
  ROLE_CLIENT_SCAN_ONLY = 1;

  // secondary STA used for make before break.
  ROLE_CLIENT_SECONDARY_TRANSIENT = 2;

  // secondary STA created for local connection (no internet connectivity).
  ROLE_CLIENT_LOCAL_ONLY = 3;

  // primary STA.
  ROLE_CLIENT_PRIMARY = 4;

  // Long lived secondary STA used for restricted use cases
  ROLE_CLIENT_SECONDARY_LONG_LIVED = 5;
}

message ConnectionEvent {

  // Roam Type.
  enum RoamType {

    // Type is unknown.
    ROAM_UNKNOWN = 0;

    // No roaming.
    ROAM_NONE = 1;

    // DBDC roaming.
    ROAM_DBDC = 2;

    // Enterprise roaming.
    ROAM_ENTERPRISE = 3;

    // User selected roaming.
    ROAM_USER_SELECTED = 4;

    // Unrelated.
    ROAM_UNRELATED = 5;
  }

  // Connectivity Level Failure.
  enum ConnectivityLevelFailure {

    // Failure is unknown.
    HLF_UNKNOWN = 0;

    // No failure.
    HLF_NONE = 1;

    // DHCP failure.
    HLF_DHCP = 2;

    // No internet connection.
    HLF_NO_INTERNET = 3;

    // No internet connection.
    HLF_UNWANTED = 4;
  }

  // Level 2 failure reason.
  enum Level2FailureReason {

    // Unknown default
    FAILURE_REASON_UNKNOWN = 0;

    // The reason code if there is no error during authentication. It could
    // also imply that there no authentication in progress.
    AUTH_FAILURE_NONE = 1;

    // The reason code if there was a timeout authenticating.
    AUTH_FAILURE_TIMEOUT = 2;

    // The reason code if there was a wrong password while authenticating.
    AUTH_FAILURE_WRONG_PSWD = 3;

    // The reason code if there was EAP failure while authenticating.
    AUTH_FAILURE_EAP_FAILURE = 4;

    // The reason code if the AP can no longer accept new clients.
    ASSOCIATION_REJECTION_AP_UNABLE_TO_HANDLE_NEW_STA = 5;

    // The reason code if AP disconnects STA during the connecting state.
    DISCONNECTION_NON_LOCAL = 6;

    // The reason code if a user rejects this connection.
    AUTH_FAILURE_REJECTED_BY_USER = 7;

    // The reason code if an insecure Enterprise connection requires user's approval
    DISCONNECTED_USER_APPROVAL_NEEDED = 8;
  }

  // Entity that recommended connecting to this network.
  enum ConnectionNominator {
    // Unknown nominator
    NOMINATOR_UNKNOWN = 0;

    // User selected network manually
    NOMINATOR_MANUAL = 1;

    // Saved network
    NOMINATOR_SAVED = 2;

    // Suggestion API
    NOMINATOR_SUGGESTION = 3;

    // Passpoint
    NOMINATOR_PASSPOINT = 4;

    // Carrier suggestion
    NOMINATOR_CARRIER = 5;

    // External scorer
    NOMINATOR_EXTERNAL_SCORED = 6;

    // Network Specifier
    NOMINATOR_SPECIFIER = 7;

    // User connected choice override
    NOMINATOR_SAVED_USER_CONNECT_CHOICE = 8;

    // Open Network Available Pop-up
    NOMINATOR_OPEN_NETWORK_AVAILABLE = 9;
  }

  enum NetworkType {
    // Unknown network type
    TYPE_UNKNOWN = 0;

    // WPA2 network
    TYPE_WPA2 = 1;

    // WPA3 network
    TYPE_WPA3 = 2;

    // Passpoint network
    TYPE_PASSPOINT = 3;

    // EAP network, excluding passpoint
    TYPE_EAP = 4;

    // OWE network
    TYPE_OWE = 5;

    // Open network
    TYPE_OPEN = 6;

    // WAPI network
    TYPE_WAPI = 7;
  }

  enum NetworkCreator {
    // This network is created by an unknown app.
    CREATOR_UNKNOWN = 0;

    // This network is created by the user.
    CREATOR_USER = 1;

    // This network is created by a carrier app.
    CREATOR_CARRIER = 2;
  }

  // Start time of the connection, in milliseconds since Unix epoch (1970-01-01).
  optional int64 start_time_millis = 1 [deprecated=true]; // [(datapol.semantic_type) = ST_TIMESTAMP];

  // Start time of the connection, in milliseconds since device boot
  optional int64 start_time_since_boot_millis = 28 [default = 0];

  // Duration to connect.
  optional int32 duration_taken_to_connect_millis = 2;

  // Router information.
  optional RouterFingerPrint router_fingerprint = 3;

  // RSSI at the start of the connection.
  optional int32 signal_strength = 4;

  // Roam Type.
  optional RoamType roam_type = 5;

  // Result of the connection.
  optional int32 connection_result = 6;

  // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant).
  optional int32 level_2_failure_code = 7;

  // Failures that happen at the connectivity layer.
  optional ConnectivityLevelFailure connectivity_level_failure_code = 8;

  // Has bug report been taken.
  optional bool automatic_bug_report_taken = 9;

  // Connection is using locally generated random MAC address.
  optional bool use_randomized_mac = 10 [default = false];

  // Who chose to connect.
  optional ConnectionNominator connection_nominator = 11;

  // The currently running network selector when this connection event occurred.
  optional int32 network_selector_experiment_id = 12;

  // Breakdown of level_2_failure_code with more detailed reason.
  optional Level2FailureReason level_2_failure_reason = 13
          [default = FAILURE_REASON_UNKNOWN];

  // Connection is using an aggressively generated random MAC address.
  optional bool use_aggressive_mac = 14;

  // Number of BSSIDs for this network that were excluded from network selection.
  optional int32 num_bssid_in_blocklist = 15;

  // The type of network for this connection.
  optional NetworkType network_type = 16;

  // UID of the app that created this network.
  optional NetworkCreator network_creator = 17;

  // Whether the screen is on when the connection event starts
  optional bool screen_on = 18;

  // Number of consecutive connection failures with the same SSID at high RSSI
  // before current connection event. Any connection failure at low RSSI in the
  // middle won't break the streak count. The count is cleared after
  // a network disconnection event.
  optional int32 num_consecutive_connection_failure = 19 [default = -1];

  // Indicates if the profile used for the connection was provisioned by Passpoint OSU server
  optional bool is_osu_provisioned = 20;

  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
  // ConnectionEvent belongs to when multiple interfaces are active concurrently.
  optional string interface_name = 27;

  // The role of the wireless interface at the start of the connection.
  // Gives more information on what purpose this interface is used for.
  optional ClientRole interface_role = 29;

  // Indicates if the profile used for the connection is carrier merged.
  optional bool is_carrier_merged = 30;

  // Indicates if this was the first connection event after boot
  optional bool is_first_connection_after_boot = 31;
}

// Number of occurrences of a specific RSSI poll rssi value
message RssiPollCount {
  // RSSI
  optional int32 rssi = 1;

  // Number of RSSI polls with 'rssi'
  optional int32 count = 2;

  // Beacon frequency of the channel in MHz
  optional int32 frequency = 3;
}

// Number of occurrences of a specific alert reason value
message AlertReasonCount {
  // Alert reason
  optional int32 reason = 1;

  // Number of alerts with |reason|.
  optional int32 count = 2;
}

// Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport
message WifiScoreCount {
  // Wifi Score
  optional int32 score = 1;

  // Number of Wifi score reports with this score
  optional int32 count = 2;
}

// Counts the number of instances of a specific Wifi Usability Score
message WifiUsabilityScoreCount {
  // Wifi Usability Score
  optional int32 score = 1;

  // Number of Wifi score reports with this score
  optional int32 count = 2;
}

// Number of occurrences of a specific link speed (Mbps)
// and sum of rssi (dBm) and rssi^2 (dBm^2)
message LinkSpeedCount {
  // Link speed (Mbps)
  optional int32 link_speed_mbps = 1;

  // Number of RSSI polls with link_speed
  optional int32 count = 2;

  // Sum of absolute values of rssi values (dBm)
  optional int32 rssi_sum_dbm = 3;

  // Sum of squares of rssi values (dBm^2)
  optional int64 rssi_sum_of_squares_dbm_sq = 4;
}


// Number of occurrences of Soft AP session durations
message SoftApDurationBucket {
  // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec)
  // The (inclusive) lower bound of Soft AP session duration represented by this bucket
  optional int32 duration_sec = 1;

  // The size of this bucket
  optional int32 bucket_size_sec = 2;

  // Number of soft AP session durations that fit into this bucket
  optional int32 count = 3;
}

// Number of occurrences of a soft AP session return code
message SoftApReturnCodeCount {

  enum SoftApStartResult {

    // SoftApManager return code unknown
    SOFT_AP_RETURN_CODE_UNKNOWN = 0;

    // SoftAp started successfully
    SOFT_AP_STARTED_SUCCESSFULLY = 1;

    // Catch all for failures with no specific failure reason
    SOFT_AP_FAILED_GENERAL_ERROR = 2;

    // SoftAp failed to start due to NO_CHANNEL error
    SOFT_AP_FAILED_NO_CHANNEL = 3;

    // SoftAp failed to start due to unsupported configuration error
    SOFT_AP_FAILED_UNSUPPORTED_CONFIGURATION = 4;
  }

  // Historical, no longer used for writing as of 01/2017.
  optional int32 return_code = 1 [deprecated = true];

  // Occurrences of this soft AP return code
  optional int32 count = 2;

  // Result of attempt to start SoftAp
  optional SoftApStartResult start_result = 3;
}

message StaEvent {
  message ConfigInfo {
    // The set of key management protocols supported by this configuration.
    optional uint32 allowed_key_management = 1 [default = 0];

    // The set of security protocols supported by this configuration.
    optional uint32 allowed_protocols = 2 [default = 0];

    // The set of authentication protocols supported by this configuration.
    optional uint32 allowed_auth_algorithms = 3 [default = 0];

    // The set of pairwise ciphers for WPA supported by this configuration.
    optional uint32 allowed_pairwise_ciphers = 4 [default = 0];

    // The set of group ciphers supported by this configuration.
    optional uint32 allowed_group_ciphers = 5;

    // Is this a 'hidden network'
    optional bool hidden_ssid = 6;

    // Is this a Hotspot 2.0 / passpoint network
    optional bool is_passpoint = 7;

    // Is this an 'ephemeral' network (Not in saved network list, recommended externally)
    optional bool is_ephemeral = 8;

    // Has a successful connection ever been established using this WifiConfiguration
    optional bool has_ever_connected = 9;

    // RSSI of the scan result candidate associated with this WifiConfiguration
    optional int32 scan_rssi = 10 [default = -127];

    // Frequency of the scan result candidate associated with this WifiConfiguration
    optional int32 scan_freq = 11 [default = -1];
  }

  enum EventType {
    // Default/Invalid event
    TYPE_UNKNOWN = 0;

    // Supplicant Association Rejection event. Code contains the 802.11
    TYPE_ASSOCIATION_REJECTION_EVENT = 1;

    // Supplicant L2 event,
    TYPE_AUTHENTICATION_FAILURE_EVENT = 2;

    // Supplicant L2 event
    TYPE_NETWORK_CONNECTION_EVENT = 3;

    // Supplicant L2 event
    TYPE_NETWORK_DISCONNECTION_EVENT = 4;

    // Supplicant L2 event
    TYPE_SUPPLICANT_STATE_CHANGE_EVENT = 5;

    // Supplicant L2 event
    TYPE_CMD_ASSOCIATED_BSSID = 6;

    // IP Manager successfully completed IP Provisioning
    TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL = 7;

    // IP Manager failed to complete IP Provisioning
    TYPE_CMD_IP_CONFIGURATION_LOST = 8;

    // IP Manager lost reachability to network neighbors
    TYPE_CMD_IP_REACHABILITY_LOST = 9;

    // Indicator that Supplicant is targeting a BSSID for roam/connection
    TYPE_CMD_TARGET_BSSID = 10;

    // Wifi framework is initiating a connection attempt
    TYPE_CMD_START_CONNECT = 11;

    // Wifi framework is initiating a roaming connection attempt
    TYPE_CMD_START_ROAM = 12;

    // SystemAPI connect() command, Settings App
    TYPE_CONNECT_NETWORK = 13;

    // Network Agent has validated the internet connection (Captive Portal Check success, or user
    // validation)
    TYPE_NETWORK_AGENT_VALID_NETWORK = 14;

    // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect
    // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true
    TYPE_FRAMEWORK_DISCONNECT = 15;

    // The NetworkAgent score for wifi has changed in a way that may impact
    // connectivity
    TYPE_SCORE_BREACH = 16;

    // Framework changed Sta interface MAC address
    TYPE_MAC_CHANGE = 17;

    // Wifi is turned on
    TYPE_WIFI_ENABLED = 18;

    // Wifi is turned off
    TYPE_WIFI_DISABLED = 19;

    // The NetworkAgent Wifi usability score has changed in a way that may
    // impact connectivity
    TYPE_WIFI_USABILITY_SCORE_BREACH = 20;

    // Link probe was performed
    TYPE_LINK_PROBE = 21;
  }

  enum FrameworkDisconnectReason {
    // default/none/unknown value
    DISCONNECT_UNKNOWN = 0;

    // API DISCONNECT
    DISCONNECT_API = 1;

    // Some framework internal reason (generic)
    DISCONNECT_GENERIC = 2;

    // Network Agent network validation failed, user signaled network unwanted
    DISCONNECT_UNWANTED = 3;

    // Roaming timed out
    DISCONNECT_ROAM_WATCHDOG_TIMER = 4;

    // P2P service requested wifi disconnect
    DISCONNECT_P2P_DISCONNECT_WIFI_REQUEST = 5;

    // SIM was removed while using a SIM config
    DISCONNECT_RESET_SIM_NETWORKS = 6;

    // The network being evaluated in Make-Before-Break was disconnected due to no internet.
    DISCONNECT_MBB_NO_INTERNET = 7;

    // The network has been removed from the database.
    DISCONNECT_NETWORK_REMOVED = 8;

    // The network has been marked as metered.
    DISCONNECT_NETWORK_METERED = 9;

    // The network has been disabled temporarily.
    DISCONNECT_NETWORK_TEMPORARY_DISABLED = 10;

    // The network has been disabled permanently.
    DISCONNECT_NETWORK_PERMANENT_DISABLED = 11;

    // Carrier offload for this network has been disabled.
    DISCONNECT_CARRIER_OFFLOAD_DISABLED = 12;

    // Disconnected due to an issue with passpoint terms and conditions URL.
    DISCONNECT_PASSPOINT_TAC = 13;

    // VCN policy is requesting to tear down the network.
    DISCONNECT_VCN_REQUEST = 14;

    // Connected to a network that's not found in the database.
    DISCONNECT_UNKNOWN_NETWORK = 15;

    // The network has been marked as untrusted.
    DISCONNECT_NETWORK_UNTRUSTED = 16;

    // Wi-Fi 7 support for this network has been enabled or disabled.
    DISCONNECT_NETWORK_WIFI7_TOGGLED = 17;

    // IP configuration is lost. Triggered by connectivity
    DISCONNECT_IP_CONFIGURATION_LOST = 18;

    // IP reachability is lost. Triggered by connectivity
    DISCONNECT_IP_REACHABILITY_LOST = 19;

    // No credentials
    DISCONNECT_NO_CREDENTIALS = 20;
  }

  // Authentication Failure reasons as reported through the API.
  enum AuthFailureReason {
    // Unknown default
    AUTH_FAILURE_UNKNOWN = 0;

    // The reason code if there is no error during authentication. It could also imply that there no
    // authentication in progress,
    AUTH_FAILURE_NONE = 1;

    // The reason code if there was a timeout authenticating.
    AUTH_FAILURE_TIMEOUT = 2;

    // The reason code if there was a wrong password while authenticating.
    AUTH_FAILURE_WRONG_PSWD = 3;

    // The reason code if there was EAP failure while authenticating.
    AUTH_FAILURE_EAP_FAILURE = 4;
  }

  // What event was this
  optional EventType type = 1;

  // 80211 death reason code, relevant to NETWORK_DISCONNECTION_EVENTs
  optional int32 reason = 2 [default = -1];

  // 80211 Association Status code, relevant to ASSOCIATION_REJECTION_EVENTs
  optional int32 status = 3 [default = -1];

  // Designates whether a NETWORK_DISCONNECT_EVENT was by the STA or AP
  optional bool local_gen = 4 [default = false];

  // Network information from the WifiConfiguration of a framework initiated connection attempt
  optional ConfigInfo config_info = 5;

  // RSSI from the last rssi poll (Only valid for active connections)
  optional int32 last_rssi = 6 [default = -127];

  // Link speed from the last rssi poll (Only valid for active connections)
  optional int32 last_link_speed = 7 [default = -1];

  // Frequency from the last rssi poll (Only valid for active connections)
  optional int32 last_freq = 8 [default = -1];

  // Enum used to define bit positions in the supplicant_state_change_bitmask
  // See {@code frameworks/base/wifi/java/android/net/wifi/SupplicantState.java} for documentation
  enum SupplicantState {
    STATE_DISCONNECTED = 0;

    STATE_INTERFACE_DISABLED = 1;

    STATE_INACTIVE = 2;

    STATE_SCANNING = 3;

    STATE_AUTHENTICATING = 4;

    STATE_ASSOCIATING = 5;

    STATE_ASSOCIATED = 6;

    STATE_FOUR_WAY_HANDSHAKE = 7;

    STATE_GROUP_HANDSHAKE = 8;

    STATE_COMPLETED = 9;

    STATE_DORMANT = 10;

    STATE_UNINITIALIZED = 11;

    STATE_INVALID = 12;
  }

  // Bit mask of all supplicant state changes that occurred since the last event
  optional uint32 supplicant_state_changes_bitmask = 9 [default = 0];

  // The number of milliseconds that have elapsed since the device booted
  optional int64 start_time_millis = 10 [default = 0];

  optional FrameworkDisconnectReason framework_disconnect_reason = 11 [default = DISCONNECT_UNKNOWN];

  // Flag which indicates if an association rejection event occurred due to a timeout
  optional bool association_timed_out = 12 [default = false];

  // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code)
  optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN];

  // NetworkAgent score of connected wifi
  optional int32 last_score = 14 [default = -1];

  // NetworkAgent Wifi usability score of connected wifi
  optional int32 last_wifi_usability_score = 15 [default = -1];

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 last_prediction_horizon_sec = 16 [default = -1];

  // Only valid if event type == TYPE_LINK_PROBE.
  // true if link probe succeeded, false otherwise.
  optional bool link_probe_was_success = 17;

  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == true.
  // Elapsed time, in milliseconds, of a successful link probe.
  optional int32 link_probe_success_elapsed_time_ms = 18;

  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == false.
  // Failure reason for an unsuccessful link probe.
  optional LinkProbeStats.LinkProbeFailureReason link_probe_failure_reason = 19;

  // Number of bytes transmitted across mobile networks since device boot.
  optional int64 mobile_tx_bytes = 20 [default = -1];

  // // Number of bytes received across mobile networks since device boot.
  optional int64 mobile_rx_bytes = 21 [default = -1];

  // Number of bytes transmitted since device boot.
  optional int64 total_tx_bytes = 22 [default = -1];

  // Number of bytes received since device boot.
  optional int64 total_rx_bytes = 23 [default = -1];

  // Whether screen is on when the event happens
  optional bool screen_on = 24;

  // Whether cellular data network is available
  optional bool is_cellular_data_available = 25;

  // Whether Adaptive Connectivity is enabled
  optional bool is_adaptive_connectivity_enabled = 26;

  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
  // StaEvent belongs to when multiple interfaces are active concurrently.
  optional string interface_name = 27;

  // The role of the wireless interface
  // Gives more information on what purpose this interface is used for.
  optional ClientRole interface_role = 28;
}

// Wi-Fi Aware metrics
message WifiAwareLog {
  // total number of unique apps that used Aware (measured on attach)
  optional int32 num_apps = 1;

  // total number of unique apps that used an identity callback when attaching
  optional int32 num_apps_using_identity_callback = 2;

  // maximum number of attaches for an app
  optional int32 max_concurrent_attach_sessions_in_app = 3;

  // histogram of attach request results
  repeated NanStatusHistogramBucket histogram_attach_session_status = 4;

  // maximum number of concurrent publish sessions in a single app
  optional int32 max_concurrent_publish_in_app = 5;

  // maximum number of concurrent subscribe sessions in a single app
  optional int32 max_concurrent_subscribe_in_app = 6;

  // maximum number of concurrent discovery (publish+subscribe) sessions in a single app
  optional int32 max_concurrent_discovery_sessions_in_app = 7;

  // maximum number of concurrent publish sessions in the system
  optional int32 max_concurrent_publish_in_system = 8;

  // maximum number of concurrent subscribe sessions in the system
  optional int32 max_concurrent_subscribe_in_system = 9;

  // maximum number of concurrent discovery (publish+subscribe) sessions in the system
  optional int32 max_concurrent_discovery_sessions_in_system = 10;

  // histogram of publish request results
  repeated NanStatusHistogramBucket histogram_publish_status = 11;

  // histogram of subscribe request results
  repeated NanStatusHistogramBucket histogram_subscribe_status = 12;

  // number of unique apps which experienced a discovery session creation failure due to lack of
  // resources
  optional int32 num_apps_with_discovery_session_failure_out_of_resources = 13;

  // histogram of create ndp request results
  repeated NanStatusHistogramBucket histogram_request_ndp_status = 14;

  // histogram of create ndp out-of-band (OOB) request results
  repeated NanStatusHistogramBucket histogram_request_ndp_oob_status = 15;

  // maximum number of concurrent active data-interfaces (NDI) in a single app
  optional int32 max_concurrent_ndi_in_app = 19;

  // maximum number of concurrent active data-interfaces (NDI) in the system
  optional int32 max_concurrent_ndi_in_system = 20;

  // maximum number of concurrent data-paths (NDP) in a single app
  optional int32 max_concurrent_ndp_in_app = 21;

  // maximum number of concurrent data-paths (NDP) in the system
  optional int32 max_concurrent_ndp_in_system = 22;

  // maximum number of concurrent secure data-paths (NDP) in a single app
  optional int32 max_concurrent_secure_ndp_in_app = 23;

  // maximum number of concurrent secure data-paths (NDP) in the system
  optional int32 max_concurrent_secure_ndp_in_system = 24;

  // maximum number of concurrent data-paths (NDP) per data-interface (NDI)
  optional int32 max_concurrent_ndp_per_ndi = 25;

  // histogram of durations of Aware being available
  repeated HistogramBucket histogram_aware_available_duration_ms = 26;

  // histogram of durations of Aware being enabled
  repeated HistogramBucket histogram_aware_enabled_duration_ms = 27;

  // histogram of duration (in ms) of attach sessions
  repeated HistogramBucket histogram_attach_duration_ms = 28;

  // histogram of duration (in ms) of publish sessions
  repeated HistogramBucket histogram_publish_session_duration_ms = 29;

  // histogram of duration (in ms) of subscribe sessions
  repeated HistogramBucket histogram_subscribe_session_duration_ms = 30;

  // histogram of duration (in ms) of data-paths (NDP)
  repeated HistogramBucket histogram_ndp_session_duration_ms = 31;

  // histogram of usage (in MB) of data-paths (NDP)
  repeated HistogramBucket histogram_ndp_session_data_usage_mb = 32;

  // histogram of usage (in MB) of data-path creation time (in ms) measured as request -> confirm
  repeated HistogramBucket histogram_ndp_creation_time_ms = 33;

  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: minimum
  optional int64 ndp_creation_time_ms_min = 34;

  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: maximum
  optional int64 ndp_creation_time_ms_max = 35;

  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum
  optional int64 ndp_creation_time_ms_sum = 36;

  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum of sq
  optional int64 ndp_creation_time_ms_sum_of_sq = 37;

  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: number of
  // samples
  optional int64 ndp_creation_time_ms_num_samples = 38;

  // total time within the logging window that aware was available
  optional int64 available_time_ms = 39;

  // total time within the logging window that aware was enabled
  optional int64 enabled_time_ms = 40;

  // maximum number of concurrent publish sessions enabling ranging in a single app
  optional int32 max_concurrent_publish_with_ranging_in_app = 41;

  // maximum number of concurrent subscribe sessions specifying a geofence in a single app
  optional int32 max_concurrent_subscribe_with_ranging_in_app = 42;

  // maximum number of concurrent publish sessions enabling ranging in the system
  optional int32 max_concurrent_publish_with_ranging_in_system = 43;

  // maximum number of concurrent subscribe sessions specifying a geofence in the system
  optional int32 max_concurrent_subscribe_with_ranging_in_system = 44;

  // histogram of subscribe session geofence minimum (only when specified)
  repeated HistogramBucket histogram_subscribe_geofence_min = 45;

  // histogram of subscribe session geofence maximum (only when specified)
  repeated HistogramBucket histogram_subscribe_geofence_max = 46;

  // total number of subscribe sessions which enabled ranging
  optional int32 num_subscribes_with_ranging = 47;

  // total number of matches (service discovery indication) with ranging provided
  optional int32 num_matches_with_ranging = 48;

  // total number of matches (service discovery indication) for service discovery with ranging
  // enabled which did not trigger ranging
  optional int32 num_matches_without_ranging_for_ranging_enabled_subscribes = 49;

  // Total number of different types of NDP requests
  repeated NdpRequestTypeHistogramBucket histogram_ndp_request_type = 50;

  // Histogram bucket for Wi-Fi Aware logs. Range is [start, end)
  message HistogramBucket {
    // lower range of the bucket (inclusive)
    optional int64 start = 1;

    // upper range of the bucket (exclusive)
    optional int64 end = 2;

    // number of samples in the bucket
    optional int32 count = 3;
  }

  // Status of various NAN operations
  enum NanStatusTypeEnum {
    // constant to be used by proto
    UNKNOWN = 0;

    // NAN operation succeeded
    SUCCESS = 1;

    // NAN Discovery Engine/Host driver failures
    INTERNAL_FAILURE = 2;

    // NAN OTA failures
    PROTOCOL_FAILURE = 3;

    // The publish/subscribe discovery session id is invalid
    INVALID_SESSION_ID = 4;

    // Out of resources to fufill request
    NO_RESOURCES_AVAILABLE = 5;

    // Invalid arguments passed
    INVALID_ARGS = 6;

    // Invalid peer id
    INVALID_PEER_ID = 7;

    // Invalid NAN data-path (ndp) id
    INVALID_NDP_ID = 8;

    // Attempting to enable NAN when not available, e.g. wifi is disabled
    NAN_NOT_ALLOWED = 9;

    // Over the air ACK not received
    NO_OTA_ACK = 10;

    // Attempting to enable NAN when already enabled
    ALREADY_ENABLED = 11;

    // Can't queue tx followup message foor transmission
    FOLLOWUP_TX_QUEUE_FULL = 12;

    // Unsupported concurrency of NAN and another feature - NAN disabled
    UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 13;

    // Unknown NanStatusType
    UNKNOWN_HAL_STATUS = 14;
  }

  // Histogram bucket for Wi-Fi Aware (NAN) status.
  message NanStatusHistogramBucket {
    // status type defining the bucket
    optional NanStatusTypeEnum nan_status_type = 1;

    // number of samples in the bucket
    optional int32 count = 2;
  }

  enum NdpRequestTypeEnum {
    // Unknown Type
    NETWORK_SPECIFIER_TYPE_UNKNOWN = 0;

    // TYPE: in band, specific peer: role, client_id, session_id, peer_id, pmk/passphrase optional
    NETWORK_SPECIFIER_TYPE_IB = 1;

    // TYPE: in band, any peer: role, client_id, session_id, pmk/passphrase optional
    NETWORK_SPECIFIER_TYPE_IB_ANY_PEER = 2;

    //TYPE: out-of-band: role, client_id, peer_mac, pmk/passphrase optional
    NETWORK_SPECIFIER_TYPE_OOB = 3;

    //TYPE: out-of-band, any peer: role, client_id, pmk/passphrase optional
    NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER = 4;

  }

  message NdpRequestTypeHistogramBucket {
    // request type defining the bucket
    optional NdpRequestTypeEnum ndp_request_type = 1;
    // number of samples in the bucket
    optional int32 count = 2;

  }
}

// Data point used to build 'Number of Connectable Network' histograms
message NumConnectableNetworksBucket {
  // Number of connectable networks seen in a scan result
  optional int32 num_connectable_networks = 1 [default = 0];

  // Number of scan results with num_connectable_networks
  optional int32 count = 2 [default = 0];
}

// Pno scan metrics
// Here "Pno Scan" refers to the session of offloaded scans, these metrics count the result of a
// single session, and not the individual scans within that session.
message PnoScanMetrics {
  // Total number of attempts to offload pno scans
  optional int32 num_pno_scan_attempts = 1;

  // Total number of pno scans failed
  optional int32 num_pno_scan_failed = 2;

  // Number of pno scans started successfully over offload
  optional int32 num_pno_scan_started_over_offload = 3;

  // Number of pno scans failed over offload
  optional int32 num_pno_scan_failed_over_offload = 4;

  // Total number of pno scans that found any network
  optional int32 num_pno_found_network_events = 5;
}

// Number of occurrences for a particular "Connect to Network" Notification or
// notification Action.
message ConnectToNetworkNotificationAndActionCount {

  // "Connect to Network" notifications
  enum Notification {

    // Default
    NOTIFICATION_UNKNOWN = 0;

    // Initial notification with a recommended network.
    NOTIFICATION_RECOMMEND_NETWORK = 1;

    // Notification when connecting to the recommended network.
    NOTIFICATION_CONNECTING_TO_NETWORK = 2;

    // Notification when successfully connected to the network.
    NOTIFICATION_CONNECTED_TO_NETWORK = 3;

    // Notification when failed to connect to network.
    NOTIFICATION_FAILED_TO_CONNECT = 4;
  }

  // "Connect to Network" notification actions
  enum Action {

    // Default
    ACTION_UNKNOWN = 0;

    // User dismissed the "Connect to Network" notification.
    ACTION_USER_DISMISSED_NOTIFICATION = 1;

    // User tapped action button to connect to recommended network.
    ACTION_CONNECT_TO_NETWORK = 2;

    // User tapped action button to open Wi-Fi Settings.
    ACTION_PICK_WIFI_NETWORK = 3;

    // User tapped "Failed to connect" notification to open Wi-Fi Settings.
    ACTION_PICK_WIFI_NETWORK_AFTER_CONNECT_FAILURE = 4;
  }

  // Recommenders of the "Connect to Network" notification
  enum Recommender {

    // Default.
    RECOMMENDER_UNKNOWN = 0;

    // Open Network Available recommender.
    RECOMMENDER_OPEN = 1;
  }

  // Notification Type.
  optional Notification notification = 1;

  // Action Type.
  optional Action action = 2;

  // Recommender Type.
  optional Recommender recommender = 3;

  // Occurrences of this action.
  optional int32 count = 4;
}

// SoftAP event tracking sessions and client counts
message SoftApConnectedClientsEvent {

  // Soft AP event Types
  enum SoftApEventType {

    // Soft AP in single AP mode is Up and ready for use.
    // The sequence of the events in single AP mode:
    // SOFT_AP_UP -> ... (ex:NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
    SOFT_AP_UP = 0;

    // Soft AP in single/dual AP mode is Down.
    SOFT_AP_DOWN = 1;

    // Number of connected soft AP clients has changed.
    NUM_CLIENTS_CHANGED = 2;

    // Soft AP in dual AP mode is Up and ready for use.
    // There are two DUAL_AP_BOTH_INSTANCES_UP events in dual AP mode for
    // storing each instance information.
    // The sequence of the events in dual AP mode:
    // DUAL_AP_BOTH_INSTANCES_UP -> DUAL_AP_BOTH_INSTANCES_UP
    // ... (ex: DUAL_AP_ONE_INSTANCE_DOWN or NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
    DUAL_AP_BOTH_INSTANCES_UP = 3;

    // One of the dual AP instance is Down.
    DUAL_AP_ONE_INSTANCE_DOWN = 4;
  }

  // Soft AP channel bandwidth types
  enum ChannelBandwidth {

    BANDWIDTH_INVALID = 0;

    BANDWIDTH_20_NOHT = 1;

    BANDWIDTH_20 = 2;

    BANDWIDTH_40 = 3;

    BANDWIDTH_80 = 4;

    BANDWIDTH_80P80 = 5;

    BANDWIDTH_160 = 6;
  }

  // The operational mode  of the Soft AP.
  enum Generation {

    WIFI_STANDARD_UNKNOWN = 0;

    WIFI_STANDARD_LEGACY = 1;

    WIFI_STANDARD_11N = 4;

    WIFI_STANDARD_11AC = 5;

    WIFI_STANDARD_11AX = 6;
  }

  // Type of event being recorded
  optional SoftApEventType event_type = 1;

  // Time passed since last boot in milliseconds
  optional int64 time_stamp_millis = 2;

  // Number of connected clients if event_type is NUM_CLIENTS_CHANGED, otherwise zero.
  optional int32 num_connected_clients = 3;

  // Channel frequency used for Soft AP
  optional int32 channel_frequency = 4;

  // Channel bandwidth used for Soft AP
  optional ChannelBandwidth channel_bandwidth = 5;

  // Maximum number of client setting in SoftApConfiguration
  optional int32 max_num_clients_setting_in_softap_configuration = 6;

  // Maximum number of client setting in SoftApCapability
  optional int32 max_num_clients_setting_in_softap_capability = 7;

  // Auto shutdown timeout setting in SoftApConfiguration
  optional int64 shutdown_timeout_setting_in_softap_configuration = 8;

  // Framework default auto shutdown timeout setting
  optional int64 default_shutdown_timeout_setting = 9;

  // Indicates if user enabled the client_control
  optional bool client_control_is_enabled = 10;

  // The operational mode of the AP
  optional Generation generation = 11;

  // Number of connected clients on current frequency if event_type is NUM_CLIENTS_CHANGED,
  // otherwise zero. On dual AP, it may be different from num_connected_clients
  // because there are two instances and num_connected_clients is used to record
  // total number of the clients. But num_connected_clients_on_current_frequency
  // is used to record the number of the clients on specific instance. (depends
  // on channel_frequency)
  optional int32 num_connected_clients_on_current_frequency = 12;
}

// Power stats for Wifi
message WifiPowerStats {

  // Duration of log (ms)
  optional int64 logging_duration_ms = 1;

  // Energy consumed by wifi (mAh)
  optional double energy_consumed_mah = 2;

  // Amount of time wifi is in idle (ms)
  optional int64 idle_time_ms = 3;

  // Amount of time wifi is in rx (ms)
  optional int64 rx_time_ms = 4;

  // Amount of time wifi is in tx (ms)
  optional int64 tx_time_ms = 5;

  // Amount of time kernel is active because of wifi data (ms)
  optional int64 wifi_kernel_active_time_ms = 6;

  // Number of packets sent (tx)
  optional int64 num_packets_tx = 7;

  // Number of bytes sent (tx)
  optional int64 num_bytes_tx = 8;

  // Number of packets received (rx)
  optional int64 num_packets_rx = 9;

  // Number of bytes sent (rx)
  optional int64 num_bytes_rx = 10;

  // Amount of time wifi is in sleep (ms)
  optional int64 sleep_time_ms = 11;

  // Amount of time wifi is scanning (ms)
  optional int64 scan_time_ms = 12;

  // Actual monitored rail energy consumed by wifi (mAh)
  optional double monitored_rail_energy_consumed_mah = 13;
}

// Metrics for Wifi Wake
message WifiWakeStats {
  // An individual session for Wifi Wake
  message Session {
    // A Wifi Wake lifecycle event
    message Event {
      // Elapsed time in milliseconds since start of session.
      optional int64 elapsed_time_millis = 1;

      // Number of scans that have occurred since start of session.
      optional int32 elapsed_scans = 2;
    }

    // Start time of session in milliseconds.
    optional int64 start_time_millis = 1;

    // The number of networks the lock was provided with at start.
    optional int32 locked_networks_at_start = 2;

    // The number of networks in the lock at the time of the initialize event. Only valid if
    // initialize_event is recorded.
    optional int32 locked_networks_at_initialize = 6;

    // Event for fully initializing the WakeupLock (i.e. WakeupLock is "locked").
    optional Event initialize_event = 7;

    // Event for unlocking the WakeupLock. Does not occur if lock was initialized with 0 networks.
    optional Event unlock_event = 3;

    // Event for triggering wakeup.
    optional Event wakeup_event = 4;

    // Event for WifiWake reset event. This event marks the end of a session.
    optional Event reset_event = 5;
  }

  // Total number of sessions for Wifi Wake.
  optional int32 num_sessions = 1;

  // Session information for every Wifi Wake session (up to a maximum of 10).
  repeated Session sessions = 2;

  // Number of ignored calls to start (due to WakeupController already being active).
  optional int32 num_ignored_starts = 3;

  // Number of Wifi Wake sessions that have recorded wakeup events.
  optional int32 num_wakeups = 4;
}

// Metrics for Wi-Fi RTT
message WifiRttLog {
  // Number of RTT request API calls
  optional int32 num_requests = 1;

  // Histogram of RTT operation overall status
  repeated RttOverallStatusHistogramBucket histogram_overall_status = 2;

  // RTT to Access Points metrics
  optional RttToPeerLog rtt_to_ap = 3;

  // RTT to Wi-Fi Aware peers metrics
  optional RttToPeerLog rtt_to_aware = 4;

  // Histogram of how long a measurement with only AP take.
  repeated HistogramBucket histogram_measurement_duration_ap_only = 5;

  // Histogram of how long a measurement with aware peer included take.
  repeated HistogramBucket histogram_measurement_duration_with_aware = 6;

  // Metrics for a RTT to Peer (peer = AP or Wi-Fi Aware)
  message RttToPeerLog {
    // Total number of API calls
    optional int32 num_requests = 1;

    // Total number of individual requests
    optional int32 num_individual_requests = 2;

    // Total number of apps which requested RTT
    optional int32 num_apps = 3;

    // Histogram of total number of RTT requests by an app (WifiRttManager#startRanging)
    repeated HistogramBucket histogram_num_requests_per_app = 4;

    // Histogram of number of peers in a single RTT request (RangingRequest entries)
    repeated HistogramBucket histogram_num_peers_per_request = 5;

    // Histogram of status of individual RTT operations (RangingResult entries)
    repeated RttIndividualStatusHistogramBucket histogram_individual_status = 6;

    // Histogram of measured distances (RangingResult entries)
    repeated HistogramBucket histogram_distance = 7;

    // Histogram of interval of RTT requests by an app (WifiRttManager#startRanging)
    repeated HistogramBucket histogram_request_interval_ms = 8;
  }

  // Histogram bucket for Wi-Fi RTT logs. Range is [start, end)
  message HistogramBucket {
    // lower range of the bucket (inclusive)
    optional int64 start = 1;

    // upper range of the bucket (exclusive)
    optional int64 end = 2;

    // number of samples in the bucket
    optional int32 count = 3;
  }

  // Status codes for overall RTT operation
  enum RttOverallStatusTypeEnum {
    // constant to be used by proto
    OVERALL_UNKNOWN = 0;

    // RTT operation succeeded (individual results may still fail)
    OVERALL_SUCCESS = 1;

    // RTT operation failed (unspecified reason)
    OVERALL_FAIL = 2;

    // RTT operation failed since RTT was not available (e.g. Airplane mode)
    OVERALL_RTT_NOT_AVAILABLE = 3;

    // RTT operation timed-out: didn't receive response from HAL in expected time
    OVERALL_TIMEOUT = 4;

    // RTT operation aborted since the app is spamming the service
    OVERALL_THROTTLE = 5;

    // RTT request to HAL received immediate failure
    OVERALL_HAL_FAILURE = 6;

    // RTT to Wi-Fi Aware peer using PeerHandle failed to get a MAC address translation
    OVERALL_AWARE_TRANSLATION_FAILURE = 7;

    // RTT operation failed due to missing Location permission (post execution)
    OVERALL_LOCATION_PERMISSION_MISSING = 8;
  }

  // Status codes for individual RTT operation
  enum RttIndividualStatusTypeEnum {
    // constant to be used by proto
    UNKNOWN = 0;

    // RTT operation succeeded
    SUCCESS = 1;

    // RTT failure: generic reason (no further information)
    FAILURE = 2;

    // Target STA does not respond to request
    FAIL_NO_RSP = 3;

    // Request rejected. Applies to 2-sided RTT only
    FAIL_REJECTED = 4;

    // Operation not scheduled
    FAIL_NOT_SCHEDULED_YET = 5;

    // Timing measurement times out
    FAIL_TM_TIMEOUT = 6;

    // Target on different channel, cannot range
    FAIL_AP_ON_DIFF_CHANNEL = 7;

    // Ranging not supported
    FAIL_NO_CAPABILITY = 8;

    // Request aborted for unknown reason
    ABORTED = 9;

    // Invalid T1-T4 timestamp
    FAIL_INVALID_TS = 10;

    // 11mc protocol failed
    FAIL_PROTOCOL = 11;

    // Request could not be scheduled
    FAIL_SCHEDULE = 12;

    // Responder cannot collaborate at time of request
    FAIL_BUSY_TRY_LATER = 13;

    // Bad request args
    INVALID_REQ = 14;

    // WiFi not enabled
    NO_WIFI = 15;

    // Responder overrides param info, cannot range with new params
    FAIL_FTM_PARAM_OVERRIDE = 16;

    // HAL did not provide a result to a framework request
    MISSING_RESULT = 17;
  }

  // Histogram bucket for Wi-Fi RTT overall operation status
  message RttOverallStatusHistogramBucket {
    // status type defining the bucket
    optional RttOverallStatusTypeEnum status_type = 1;

    // number of samples in the bucket
    optional int32 count = 2;
  }

  // Histogram bucket for Wi-Fi RTT individual operation status
  message RttIndividualStatusHistogramBucket {
    // status type defining the bucket
    optional RttIndividualStatusTypeEnum status_type = 1;

    // number of samples in the bucket
    optional int32 count = 2;
  }
}

// Usage data for the wifi radio while device is running on battery.
message WifiRadioUsage {
  // Duration of log (ms)
  optional int64 logging_duration_ms = 1;

  // Total time for which the radio is awake due to scan.
  optional int64 scan_time_ms = 2;
}

message ExperimentValues {
  reserved 1;
  reserved "wifi_is_unusable_logging_enabled";

  // Minimum number of txBad to trigger a data stall
  optional int32 wifi_data_stall_min_tx_bad = 2;

  // Minimum number of txSuccess to trigger a data stall
  // when rxSuccess is 0
  optional int32 wifi_data_stall_min_tx_success_without_rx = 3;

  // Indicates if we are logging LinkSpeedCount in metrics
  optional bool link_speed_counts_logging_enabled = 4;

  // Duration for evaluating Wifi condition to trigger a data stall
  // measured in milliseconds
  optional int32 data_stall_duration_ms = 5;

  // Threshold of Tx throughput below which to trigger a data stall
  // measured in Kbps
  optional int32 data_stall_tx_tput_thr_kbps = 6;

  // Threshold of Rx throughput below which to trigger a data stall
  // measured in Kbps
  optional int32 data_stall_rx_tput_thr_kbps = 7;

  // Threshold of Tx packet error rate above which to trigger a data stall
  // in percentage
  optional int32 data_stall_tx_per_thr = 8;

  // Threshold of CCA level above which to trigger a data stall in percentage
  optional int32 data_stall_cca_level_thr = 9;

  // Health monitor RSSI poll valid time in ms
  optional int32 health_monitor_rssi_poll_valid_time_ms = 10;
}

message BssidBlocklistStats {
  // Distributions of number of blocked BSSIDs filtered out from network selection.
  repeated Int32Count network_selection_filtered_bssid_count = 1;

  // If this is enabled, then network connections in high movement state will be skipped unless
  // we find a candidate BSSID with similar RSSI in 2 scans sufficiently far apart.
  optional bool high_movement_multiple_scans_feature_enabled = 2;

  // Number of times connection is skipped in the high movement state
  // only relevant if high_movement_multiple_scans_feature_enabled=true
  optional int32 num_high_movement_connection_skipped = 3;

  // Number of times connection is initiated in the high movement state
  // only relevant if high_movement_multiple_scans_feature_enabled=true
  optional int32 num_high_movement_connection_started = 4;

  // Histogram corresponding to the number of times BSSIDs are blocked per
  // WifiBlocklistMonitor.FailureReason.
  repeated Int32Count bssid_blocklist_per_reason_count = 5;

  // Histogram corresponding to the number of times WifiConfigurations are blocked per
  // WifiConfiguration.NetworkSelectionStatus.NetworkSelectionDisableReason.
  repeated Int32Count wifi_config_blocklist_per_reason_count = 6;
}

message WifiIsUnusableEvent {
  enum TriggerType {
    // Default/Invalid event
    TYPE_UNKNOWN = 0;

    // There is a data stall from tx failures
    TYPE_DATA_STALL_BAD_TX = 1;

    // There is a data stall from rx failures
    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;

    // There is a data stall from both tx and rx failures
    TYPE_DATA_STALL_BOTH = 3;

    // Firmware generated an alert
    TYPE_FIRMWARE_ALERT = 4;

    // IP Manager lost reachability to network neighbors
    TYPE_IP_REACHABILITY_LOST = 5;
  }

  // What event triggered WifiIsUnusableEvent.
  optional TriggerType type = 1;

  // The timestamp at which this event occurred.
  // Measured in milliseconds that have elapsed since the device booted.
  optional int64 start_time_millis = 2;

  // NetworkAgent score of connected wifi.
  // Defaults to -1 if the score was never set.
  optional int32 last_score = 3 [default = -1];

  // Delta of successfully transmitted (ACKed) unicast data packets
  // between the last two WifiLinkLayerStats.
  optional int64 tx_success_delta = 4;

  // Delta of transmitted unicast data retry packets
  // between the last two WifiLinkLayerStats.
  optional int64 tx_retries_delta = 5;

  // Delta of lost (not ACKed) transmitted unicast data packets
  // between the last two WifiLinkLayerStats.
  optional int64 tx_bad_delta = 6;

  // Delta of received unicast data packets
  // between the last two WifiLinkLayerStats.
  optional int64 rx_success_delta = 7;

  // Time in millisecond between the last two WifiLinkLayerStats.
  optional int64 packet_update_time_delta = 8;

  // The timestamp at which the last WifiLinkLayerStats was updated.
  // Measured in milliseconds that have elapsed since the device booted.
  optional int64 last_link_layer_stats_update_time = 9;

  // Firmware alert code. Only valid when the event was triggered by a firmware alert, otherwise -1.
  optional int32 firmware_alert_code = 10 [default = -1];

  // NetworkAgent wifi usability score of connected wifi.
  // Defaults to -1 if the score was never set.
  optional int32 last_wifi_usability_score = 11 [default = -1];

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 last_prediction_horizon_sec = 12 [default = -1];

  // Whether screen status is on when WifiIsUnusableEvent happens.
  optional bool screen_on = 13 [default = false];

  // Number of bytes transmitted across mobile networks since device boot.
  optional int64 mobile_tx_bytes = 14 [default = -1];

  // // Number of bytes received across mobile networks since device boot.
  optional int64 mobile_rx_bytes = 15 [default = -1];

  // Number of bytes transmitted since device boot.
  optional int64 total_tx_bytes = 16 [default = -1];

  // Number of bytes received since device boot.
  optional int64 total_rx_bytes = 17 [default = -1];
}

message PasspointProfileTypeCount {
  enum EapMethod {
    // Unknown Type
    TYPE_UNKNOWN = 0;

    // EAP_TLS (13)
    TYPE_EAP_TLS = 1;

    // EAP_TTLS (21)
    TYPE_EAP_TTLS = 2;

    // EAP_SIM (18)
    TYPE_EAP_SIM = 3;

    // EAP_AKA (23)
    TYPE_EAP_AKA = 4;

    // EAP_AKA_PRIME (50)
    TYPE_EAP_AKA_PRIME = 5;
  }

  // Eap method type set in Passpoint profile
  optional EapMethod eap_method_type = 1;

  // Num of installed Passpoint profile with same eap method
  optional int32 count = 2;
}

message WifiLinkLayerUsageStats {
  // Total logging duration in ms.
  optional int64 logging_duration_ms = 1;

  // Total time the wifi radio is on in ms over the logging duration.
  optional int64 radio_on_time_ms = 2;

  // Total time the wifi radio is doing tx in ms over the logging duration.
  optional int64 radio_tx_time_ms = 3;

  // Total time the wifi radio is doing rx in ms over the logging duration.
  optional int64 radio_rx_time_ms = 4;

  // Total time the wifi radio is scanning in ms over the logging duration.
  optional int64 radio_scan_time_ms = 5;

  // Total time the wifi radio spent doing nan scans in ms over the logging duration.
  optional int64 radio_nan_scan_time_ms = 6;

  // Total time the wifi radio spent doing background scans in ms over the logging duration.
  optional int64 radio_background_scan_time_ms = 7;

  // Total time the wifi radio spent doing roam scans in ms over the logging duration.
  optional int64 radio_roam_scan_time_ms = 8;

  // Total time the wifi radio spent doing pno scans in ms over the logging duration.
  optional int64 radio_pno_scan_time_ms = 9;

  // Total time the wifi radio spent doing hotspot 2.0 scans and GAS exchange
  // in ms over the logging duration.
  optional int64 radio_hs20_scan_time_ms = 10;

  // Radio stats from all the radios
  repeated RadioStats radio_stats = 11;
}

// WifiUsabilityStatsEntry will only be uploaded when its timestamp is within the data capture
// period
message WifiUsabilityStatsEntry {
  // Status codes for link probe status
  enum LinkProbeStatus {
    // Link probe status is unknown
    PROBE_STATUS_UNKNOWN = 0;

    // Link probe is not triggered
    PROBE_STATUS_NO_PROBE = 1;

    // Link probe is triggered and the result is success
    PROBE_STATUS_SUCCESS = 2;

    // Link probe is triggered and the result is failure
    PROBE_STATUS_FAILURE = 3;
  }

  // Codes for cellular data network type
  enum CellularDataNetworkType {
    // Unknown network
    NETWORK_TYPE_UNKNOWN = 0;

    // GSM network
    NETWORK_TYPE_GSM = 1;

    // CDMA network
    NETWORK_TYPE_CDMA = 2;

    // CDMA EVDO network
    NETWORK_TYPE_EVDO_0 = 3;

    // WCDMA network
    NETWORK_TYPE_UMTS = 4;

    // TDSCDMA network
    NETWORK_TYPE_TD_SCDMA = 5;

    // LTE network
    NETWORK_TYPE_LTE = 6;

    // NR network
    NETWORK_TYPE_NR = 7;
  }

  enum CaptureEventType {
    // Unknown event
    CAPTURE_EVENT_TYPE_UNKNOWN = 0;

    // This is a synchronous event
    CAPTURE_EVENT_TYPE_SYNCHRONOUS = 1;

    // RSSI polling turned on
    CAPTURE_EVENT_TYPE_RSSI_POLLING_ENABLED = 2;

    // RSSI polling turned off
    CAPTURE_EVENT_TYPE_RSSI_POLLING_DISABLED = 3;

    // Data sample came from CMD_ONESHOT_RSSI_POLL
    CAPTURE_EVENT_TYPE_ONESHOT_RSSI_POLL = 4;

    // IP reachability lost
    CAPTURE_EVENT_TYPE_IP_REACHABILITY_LOST = 5;

    // IP reachability failure
    CAPTURE_EVENT_TYPE_IP_REACHABILITY_FAILURE = 6;

    // Firmware alert
    CAPTURE_EVENT_TYPE_FIRMWARE_ALERT = 7;
  }

  // Absolute milliseconds from device boot when these stats were sampled
  optional int64 time_stamp_ms = 1;

  // The RSSI at the sample time
  optional int32 rssi = 2;

  // Link speed at the sample time in Mbps
  optional int32 link_speed_mbps = 3;

  // The total number of tx success counted from the last radio chip reset
  optional int64 total_tx_success = 4;

  // The total number of MPDU data packet retries counted from the last radio chip reset
  optional int64 total_tx_retries = 5;

  // The total number of tx bad counted from the last radio chip reset
  optional int64 total_tx_bad = 6;

  // The total number of rx success counted from the last radio chip reset
  optional int64 total_rx_success = 7;

  // The total time the wifi radio is on in ms counted from the last radio chip reset
  optional int64 total_radio_on_time_ms = 8;

  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
  optional int64 total_radio_tx_time_ms = 9;

  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
  optional int64 total_radio_rx_time_ms = 10;

  // The total time spent on all types of scans in ms counted from the last radio chip reset
  optional int64 total_scan_time_ms = 11;

  // The total time spent on nan scans in ms counted from the last radio chip reset
  optional int64 total_nan_scan_time_ms = 12;

  // The total time spent on background scans in ms counted from the last radio chip reset
  optional int64 total_background_scan_time_ms = 13;

  // The total time spent on roam scans in ms counted from the last radio chip reset
  optional int64 total_roam_scan_time_ms = 14;

  // The total time spent on pno scans in ms counted from the last radio chip reset
  optional int64 total_pno_scan_time_ms = 15;

  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
  // chip reset
  optional int64 total_hotspot_2_scan_time_ms = 16;

  // Internal framework Wifi score
  optional int32 wifi_score = 17;

  // Wifi usability score provided by external system app
  optional int32 wifi_usability_score = 18;

  // Sequence number from external system app to framework
  optional int32 seq_num_to_framework = 19;

  // The total time CCA is on busy status on the current frequency in ms
  // counted from the last radio chip reset
  optional int64 total_cca_busy_freq_time_ms = 20;

  // The total radio on time of the current frequency from the last radio
  // chip reset
  optional int64 total_radio_on_freq_time_ms = 21;

  // The total number of beacons received from the last radio chip reset
  optional int64 total_beacon_rx = 22;

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 prediction_horizon_sec = 23;

  // The link probe status since last stats update
  optional LinkProbeStatus probe_status_since_last_update = 24;

  // The elapsed time of the most recent link probe since last stats update;
  optional int32 probe_elapsed_time_since_last_update_ms = 25;

  // The MCS rate of the most recent link probe since last stats update
  optional int32 probe_mcs_rate_since_last_update = 26;

  // Rx link speed at the sample time in Mbps
  optional int32 rx_link_speed_mbps = 27;

  // Sequence number generated by framework
  optional int32 seq_num_inside_framework = 28;

  // Whether current entry is for the same BSSID on the same frequency compared
  // to last entry
  optional bool is_same_bssid_and_freq = 29;

  // Cellular data network type currently in use on the device for data transmission
  optional CellularDataNetworkType cellular_data_network_type = 30;

  // Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
  // CDMA: Rssi, EVDO: Rssi, GSM: Rssi
  optional int32 cellular_signal_strength_dbm = 31;

  // Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
  // CDMA: Ecio, EVDO: SNR, GSM: invalid */
  optional int32 cellular_signal_strength_db = 32;

  // Whether the primary registered cell of current entry is same as that of previous entry
  optional bool is_same_registered_cell = 33;

  // The device mobility state
  optional DeviceMobilityStatePnoScanStats.DeviceMobilityState
          device_mobility_state = 34;

  // Duty cycle of the connection.
  // if this connection is being served using time slicing on a radio with one or more interfaces
  // (i.e MCC), then this field contains the duty cycle assigned to this interface in percent.
  // If no concurrency or not using time slicing during concurrency (i.e SCC or DBS), set to 100.
  optional int32 time_slice_duty_cycle_in_percent = 35;

  // WME data packet contention time statistics for all four categories: BE, BK, VI, VO
  repeated ContentionTimeStats contention_time_stats = 36;

  // The channel utilization ratio (value) in the range of
  // [BssLoad.MIN_CHANNEL_UTILIZATION, BssLoad.MAX_CHANNEL_UTILIZATION], where MIN_CHANNEL_UTILIZATION
  // corresponds to ratio 0%, MAX_CHANNEL_UTILIZATION corresponds to ratio 100%,
  // see {@link com.android.server.wifi.util.InformationElementUtil}
  optional int32 channel_utilization_ratio = 37;

  // Indicate whether current link layer throughput is sufficient, see {@link WifiDataStall#isThroughputSufficient()}.
  optional bool is_throughput_sufficient = 38;

  // Indicate whether Wi-Fi scoring is enabled by the user, see {@link WifiManager#setWifiScoringEnabled(boolean)}.
  optional bool is_wifi_scoring_enabled = 39;

  // Indicate whether Cellular data is available, see {@link WifiDataStall#isCellularDataAvailable()}.
  optional bool is_cellular_data_available = 40;

  // Rate statistics, including number of successful packets, retries, etc.,
  // indexed by preamble, bandwidth, number of spatial streams, MCS.
  repeated RateStats rate_stats = 41;

  // Number of stations associated with current AP.
  optional int32 sta_count = 42;

  // Channel utilization at current AP in the range of [0, 255].
  optional int32 channel_utilization = 43;

  // Link layer radio stats for all the radios
  repeated RadioStats radio_stats = 44;

  // Number of WiFi links.
  optional int32 wifi_link_count = 45;

  // Link layer radio stats for all WiFi links
  repeated LinkStats link_stats = 46;

  // The MLO mode
  // See details in @WifiManager.MloMode
  optional int32 mlo_mode = 47;

  // The number of tx bytes transmitted on current interface
  optional int64 tx_transmitted_bytes = 48;

  // The number of rx bytes transmitted on current interface
  optional int64 rx_transmitted_bytes = 49;

  // The total number of LABEL_BAD event happens
  optional int32 label_bad_event_count = 50;

  // Current WiFi state in framework
  optional int32 wifi_framework_state = 51;

  // Downstream throughput estimation provided by Network Capabilities
  optional int32 is_network_capabilities_downstream_sufficient = 52;

  // Upstream throughput estimation provided by Network Capabilities
  optional int32 is_network_capabilities_upstream_sufficient = 53;

  // Downstream throughput estimation used in Network Selection
  optional int32 is_throughput_predictor_downstream_sufficient = 54;

  // Upstream throughput estimation provided by Network Capabilities
  optional int32 is_throughput_predictor_upstream_sufficient = 55;

  // If bluetooth is connected
  optional bool is_bluetooth_connected = 56;

  // State of UWB adapter. Refers to
  // UwbManager#registerAdapterStateCallback(Executor, AdapterStateCallback)
  optional int32 uwb_adapter_state = 57;

  // Wifi Low Latency mode state
  optional bool is_low_latency_activated = 58;

  // Maximum supported tx link speed in Mbps
  optional int32 max_supported_tx_linkspeed = 59;

  // Maximum supported rx link speed in Mbps
  optional int32 max_supported_rx_linkspeed = 60;

  // Wifi Voip mode state
  optional int32 voip_mode = 61;

  // Device Role of thread. Refers to ThreadNetworkController@DeviceRole
  optional int32 thread_device_role = 62;

  // Capture buffer event type
  optional CaptureEventType capture_event_type = 63;

  // Some capture event types (eg. ip reachability lost) have a code associated
  // with them. This code is stored here.
  optional int32 capture_event_type_subcode = 64;

  optional int32 status_data_stall = 65;

  // If the full data capture is being stored (field isFullCapture is true in the function call
  // WifiManager.storeCapturedData), this field will represent the time offset between this sample
  // and the first sample in the capture buffer. i.e. this field will have the value 0 for the
  // first sample in the capture buffer.
  // If isFullCapture is false, then this field will be the time offset between the capture start
  // time and the timestamp of this sample.
  optional int64 timestamp_offset_ms = 66;
}

message ContentionTimeStats {
  enum AccessCategory {
    // WME Best Effort Access Category
    WME_ACCESS_CATEGORY_BE = 0;

    // WME Background Access Category
    WME_ACCESS_CATEGORY_BK = 1;

    // WME Video Access Category
    WME_ACCESS_CATEGORY_VI = 2;

    // WME Voice Access Category
    WME_ACCESS_CATEGORY_VO = 3;
  }

  // WME access category
  optional AccessCategory access_category = 1;

  // Data packet min contention time in microseconds
  optional int64 contention_time_min_micros = 2;

  // Data packet max contention time in microseconds
  optional int64 contention_time_max_micros = 3;

  // Data packet average contention time in microseconds
  optional int64 contention_time_avg_micros = 4;

  // Number of data packets used for contention statistics
  optional int64 contention_num_samples = 5;
}

message PacketStats {
  enum AccessCategory {
    // WME Best Effort Access Category
    WME_ACCESS_CATEGORY_BE = 0;

    // WME Background Access Category
    WME_ACCESS_CATEGORY_BK = 1;

    // WME Video Access Category
    WME_ACCESS_CATEGORY_VI = 2;

    // WME Voice Access Category
    WME_ACCESS_CATEGORY_VO = 3;
  }

  // WME access category
  optional AccessCategory access_category = 1;

  // The number of tx success counted from the last radio chip reset
  optional int64 tx_success = 2;

  // The number of MPDU data packet retries counted from the last radio chip reset
  optional int64 tx_retries = 3;

  // The number of tx bad counted from the last radio chip reset
  optional int64 tx_bad = 4;

  // The number of rx success counted from the last radio chip reset
  optional int64 rx_success = 5;
}

message RateStats {
  enum WifiPreambleType {
    // Preamble type for IEEE 802.11a/g, IEEE Std 802.11-2020, Section 17
    WIFI_PREAMBLE_OFDM = 0;
    // Preamble type for IEEE 802.11b, IEEE Std 802.11-2020, Section 16
    WIFI_PREAMBLE_CCK = 1;
    // Preamble type for IEEE 802.11n, IEEE Std 802.11-2020, Section 19
    WIFI_PREAMBLE_HT = 2;
    // Preamble type for IEEE 802.11ac, IEEE Std 802.11-2020, Section 21
    WIFI_PREAMBLE_VHT = 3;
    // Preamble type for IEEE 802.11ax, IEEE Std 802.11-2020, Section 27
    WIFI_PREAMBLE_HE = 5;
    // Invalid
    WIFI_PREAMBLE_INVALID = -1;
  }

  enum WifiSpatialStreams {
    // Single stream, 1x1
    WIFI_SPATIAL_STREAMS_ONE = 0;
    // Dual streams, 2x2
    WIFI_SPATIAL_STREAMS_TWO = 1;
    // Three streams, 3x3
    WIFI_SPATIAL_STREAMS_THREE = 2;
    // Four streams, 4x4
    WIFI_SPATIAL_STREAMS_FOUR = 3;
    // Invalid
    WIFI_SPATIAL_STREAMS_INVALID = -1;
  }

  enum WifiChannelBandwidth {
    // Channel bandwidth: 20MHz
    WIFI_BANDWIDTH_20_MHZ = 0;
    // Channel bandwidth: 40MHz
    WIFI_BANDWIDTH_40_MHZ = 1;
    // Channel bandwidth: 80MHz
    WIFI_BANDWIDTH_80_MHZ = 2;
    // Channel bandwidth: 160MHz
    WIFI_BANDWIDTH_160_MHZ = 3;
    // Channel bandwidth: 80MHz + 80MHz
    WIFI_BANDWIDTH_80P80_MHZ = 4;
    // Channel bandwidth: 5MHz
    WIFI_BANDWIDTH_5_MHZ = 5;
    // Channel bandwidth: 10MHz
    WIFI_BANDWIDTH_10_MHZ = 6;
    // Channel bandwidth: 320MHz
    WIFI_BANDWIDTH_320_MHZ = 7;
    // Invalid channel bandwidth
    WIFI_BANDWIDTH_INVALID = -1;
  }

  // Preamble information.
  optional WifiPreambleType preamble = 1;

  // Number of spatial streams.
  optional WifiSpatialStreams nss = 2;

  // Bandwidth information.
  optional WifiChannelBandwidth bw = 3;

  // MCS index. OFDM/CCK rate code would be as per IEEE std in the units of 0.5Mbps.
  // HT/VHT/HE: it would be MCS index.
  optional int32 rate_mcs_idx = 4;

  // Bitrate in units of 100 Kbps.
  optional int32 bit_rate_in_kbps = 5;

  // Number of successfully transmitted data packets (ACK received).
  optional int32 tx_mpdu = 6;

  // Number of received data packets.
  optional int32 rx_mpdu = 7;

  // Number of data packet losses (no ACK).
  optional int32 mpdu_lost = 8;

  // Number of data packet retries.
  optional int32 retries = 9;
}

message RadioStats {
  // The Radio ID
  optional int32 radio_id = 1;
  // The total time the wifi radio is on in ms counted from the last radio chip reset
  optional int64 total_radio_on_time_ms = 2;

  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
  optional int64 total_radio_tx_time_ms = 3;

  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
  optional int64 total_radio_rx_time_ms = 4;

  // The total time spent on all types of scans in ms counted from the last radio chip reset
  optional int64 total_scan_time_ms = 5;

  // The total time spent on nan scans in ms counted from the last radio chip reset
  optional int64 total_nan_scan_time_ms = 6;

  // The total time spent on background scans in ms counted from the last radio chip reset
  optional int64 total_background_scan_time_ms = 7;

  // The total time spent on roam scans in ms counted from the last radio chip reset
  optional int64 total_roam_scan_time_ms = 8;

  // The total time spent on pno scans in ms counted from the last radio chip reset
  optional int64 total_pno_scan_time_ms = 9;

  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
  // chip reset
  optional int64 total_hotspot_2_scan_time_ms = 10;

  // Time for which the radio is in active tranmission per tx level
  repeated int32 tx_time_ms_per_level = 11;
}

message LinkStats {
  enum LinkState {
    // Chip does not support reporting the state of the link
    LINK_STATE_UNKNOWN = 0;

    // Link has not been in use since last report. It is placed in power save
    LINK_STATE_NOT_IN_USE = 1;

    // Link is in use. In presence of traffic, it is set to be power active.
    LINK_STATE_IN_USE = 2;
  }

  enum WifiChannelBandwidth {
    // Channel bandwidth: 20MHz
    WIFI_BANDWIDTH_20_MHZ = 0;
    // Channel bandwidth: 40MHz
    WIFI_BANDWIDTH_40_MHZ = 1;
    // Channel bandwidth: 80MHz
    WIFI_BANDWIDTH_80_MHZ = 2;
    // Channel bandwidth: 160MHz
    WIFI_BANDWIDTH_160_MHZ = 3;
    // Channel bandwidth: 80MHz + 80MHz
    WIFI_BANDWIDTH_80P80_MHZ = 4;
    // Channel bandwidth: 5MHz
    WIFI_BANDWIDTH_5_MHZ = 5;
    // Channel bandwidth: 10MHz
    WIFI_BANDWIDTH_10_MHZ = 6;
    // Channel bandwidth: 320MHz
    WIFI_BANDWIDTH_320_MHZ = 7;
    // Invalid channel bandwidth
    WIFI_BANDWIDTH_INVALID = -1;
  }

  // The Link ID
  optional int32 link_id = 1;

  // Link state
  optional LinkState state = 2;

  // Identifier of the radio on which link is currently operating
  optional int32 radio_id = 3;

  // Frequency of the link in MHz
  optional int32 frequency_mhz = 4;

  // Number of beacons received from our own AP
  optional int32 beacon_rx = 5;

  // RSSI of management frames
  optional int32 rssi_mgmt = 6;

  // Duty cycle of the link.
  optional int32 time_slice_duty_cycle_in_percent = 7;

  // Overall RSSI from wpa_supplicant signal_poll
  optional int32 rssi = 8;

  // channel width of WiFi link.
  optional WifiChannelBandwidth channel_width = 9;

  // Center frequency (MHz) of first segment.
  optional int32 center_freq_first_seg = 10;

  // Center frequency (MHz) of second segment.
  optional int32 center_freq_second_seg = 11;

  // Total time for which the radio is awake on this channel.
  optional int64 on_time_in_ms = 12;

  // Total time for which CCA is held busy on this channel.
  optional int64 cca_busy_time_in_ms = 13;

  // WME data packet contention time statistics for all four categories: BE, BK, VI, VO
  repeated ContentionTimeStats contention_time_stats = 14;

  // Packet statistics for all four categories: BE, BK, VI, VO
  repeated PacketStats packet_stats = 15;

  // Peer statistics on this WiFi link
  repeated PeerInfo peer_info = 16;

  // List of scan results who have the same freq with current WiFi link
  repeated ScanResultWithSameFreq scan_result_with_same_freq = 17;

  // TX linkspeed in this WiFi link
  optional int32 tx_linkspeed = 18;

  // RX linkspeed in this WiFi link
  optional int32 rx_linkspeed = 19;
}

message PeerInfo {
  // Station count.
  optional int32 sta_count = 1;

  // Channel utilization.
  optional int32 chan_util = 2;

  // Rate statistics, including number of successful packets, retries, etc.,
  // indexed by preamble, bandwidth, number of spatial streams, MCS.
  repeated RateStats rate_stats = 3;
}

message ScanResultWithSameFreq {
  // timestamp in microseconds (since boot) when this result was last seen.
  optional int64 scan_result_timestamp_micros = 1;

  // The detected signal level in dBm
  optional int32 rssi = 2;

  // The center frequency of the primary 20 MHz frequency (in MHz) of the channel
  optional int32 frequency_mhz = 3;
}

message WifiUsabilityStats {
  enum Label {
    // Default label
    LABEL_UNKNOWN = 0;

    // Wifi is usable
    LABEL_GOOD = 1;

    // Wifi is unusable
    LABEL_BAD = 2;
  }

  enum UsabilityStatsTriggerType {
    // Default/Invalid event
    TYPE_UNKNOWN = 0;

    // There is a data stall from tx failures
    TYPE_DATA_STALL_BAD_TX = 1;

    // There is a data stall from rx failures
    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;

    // There is a data stall from both tx and rx failures
    TYPE_DATA_STALL_BOTH = 3;

    // Firmware generated an alert
    TYPE_FIRMWARE_ALERT = 4;

    // IP Manager lost reachability to network neighbors
    TYPE_IP_REACHABILITY_LOST = 5;
  }

  // The current wifi usability state
  optional Label label = 1;

  // The list of timestamped wifi usability stats
  repeated WifiUsabilityStatsEntry stats = 2;

  // What event triggered WifiUsabilityStats.
  optional UsabilityStatsTriggerType trigger_type = 3;

  // Firmware alert code. Only valid when the stats was triggered by a firmware
  // alert, otherwise -1.
  optional int32 firmware_alert_code = 4 [default = -1];

  // Absolute milliseconds from device boot when these stats were sampled
  optional int64 time_stamp_ms = 5;
}

message TrainingData {
  // The list of timestamped wifi usability stats
  repeated WifiUsabilityStatsEntry stats = 1;
}

message WifiUsabilityStatsTraining {
  // Data capture type
  optional int32 data_capture_type = 1;

  // Capture period start timestamp floored to the nearest hour.
  optional int64 capture_start_timestamp_secs = 2;

  optional TrainingData training_data = 3;

  // If isFullCapture is true in the WifiManager.storeCaptureData call, this represents the time
  // offset between the last sample in the capture buffer and the time the capture buffer was
  // stored. If ring buffer is empty (no last sample), we set store_time_offset_ms to 0.
  // If isFullCapture is false, this represents the time between 'capture period stop time' and the
  // time the capture buffer was stored.
  optional int64 store_time_offset_ms = 4;
}

message DeviceMobilityStatePnoScanStats {
  // see WifiManager.DEVICE_MOBILITY_STATE_* constants
  enum DeviceMobilityState {
    // Unknown mobility
    UNKNOWN = 0;

    // High movement
    HIGH_MVMT = 1;

    // Low movement
    LOW_MVMT = 2;

    // Stationary
    STATIONARY = 3;
  }

  // The device mobility state
  optional DeviceMobilityState device_mobility_state = 1;

  // The number of times that this state was entered
  optional int32 num_times_entered_state = 2;

  // The total duration elapsed while in this mobility state, in ms
  optional int64 total_duration_ms = 3;

  // the total duration elapsed while in this mobility state with PNO scans running, in ms
  optional int64 pno_duration_ms = 4;
}

// The information about the Wifi P2p events.
message WifiP2pStats {

  // Group event list tracking sessions and client counts in tethered mode.
  repeated GroupEvent group_event = 1;

  // Session information that gets logged for every Wifi P2p connection.
  repeated P2pConnectionEvent connection_event = 2;

  // Number of persistent group in the user profile.
  optional int32 num_persistent_group = 3;

  // Number of peer scan.
  optional int32 num_total_peer_scans = 4;

  // Number of service scan.
  optional int32 num_total_service_scans = 5;
}

message P2pConnectionEvent {

  enum ConnectionType {

    // fresh new connection.
    CONNECTION_FRESH = 0;

    // reinvoke a group.
    CONNECTION_REINVOKE = 1;

    // create a group with the current device as the group owner locally.
    CONNECTION_LOCAL = 2;

    // create a group or join a group with config.
    CONNECTION_FAST = 3;
  }

  enum ConnectivityLevelFailure {

    // Failure is unknown.
    CLF_UNKNOWN = 0;

    // No failure.
    CLF_NONE = 1;

    // Timeout for current connecting request.
    CLF_TIMEOUT = 2;

    // The connecting request is canceled by the user.
    CLF_CANCEL = 3;

    // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
    CLF_PROV_DISC_FAIL = 4;

    // Invitation failure, e.g. rejected by the peer.
    CLF_INVITATION_FAIL = 5;

    // Incoming request is rejected by the user.
    CLF_USER_REJECT = 6;

    // New connection request is issued before ending previous connecting request.
    CLF_NEW_CONNECTION_ATTEMPT = 7;

    // Group has been removed
    CLF_GROUP_REMOVED = 8;

    // Creating group failed
    CLF_CREATE_GROUP_FAILED = 9;
  }

  // WPS method.
  enum WpsMethod {
    // WPS is skipped for Group Reinvoke.
    WPS_NA = -1;

    // Push button configuration.
    WPS_PBC = 0;

    // Display pin method configuration - pin is generated and displayed on device.
    WPS_DISPLAY = 1;

    // Keypad pin method configuration - pin is entered on device.
    WPS_KEYPAD = 2;

    // Label pin method configuration - pin is labelled on device.
    WPS_LABEL = 3;
  }

  enum GroupBand {
    // Unknown band/frequency
    BAND_UNKNOWN = 0;
    // With 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;
  }

  // Start time of the connection.
  optional int64 start_time_millis = 1;

  // Type of the connection.
  optional ConnectionType connection_type = 2;

  // WPS method.
  optional WpsMethod wps_method = 3 [default = WPS_NA];

  // Duration to connect.
  optional int32 duration_taken_to_connect_millis = 4;

  // Failures that happen at the connectivity layer.
  optional ConnectivityLevelFailure connectivity_level_failure_code = 5;

  // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
  // credential.
  optional GroupEvent.GroupRole group_role = 6;

  // Group band preference
  optional GroupBand band = 7;

  // Group frequency in MHz if positive. Otherwise, no frequency preference.
  optional int32 frequency_mhz = 8;

  // STA mode channel frequency. 0 means unknown.
  optional int32 sta_frequency_mhz = 9;

  // The uid of the app that initiates the connection.
  optional int32 uid = 10;

  // if the country code is in the world mode
  optional bool is_country_code_world_mode = 11;

  // fallback to negotiation if device receives invitation response status code "information is
  // currently unavailable"
  optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 12;

  // The try count of connection
  optional int32 try_count = 13;

  // The Attribution tag to identify the caller
  optional string attribution_tag = 14;
}

// GroupEvent tracking group information from GroupStarted to GroupRemoved.
message GroupEvent {

  enum GroupRole {

    GROUP_OWNER = 0;

    GROUP_CLIENT = 1;

    GROUP_UNKNOWN = 2;
  }

  // The ID of network in supplicant for this group.
  optional int32 net_id = 1;

  // Start time of the group.
  optional int64 start_time_millis = 2;

  // Channel frequency used for Group.
  optional int32 channel_frequency = 3;

  // Is group owner or group client.
  optional GroupRole group_role = 5;

  // Number of connected clients.
  optional int32 num_connected_clients = 6;

  // Cumulative number of connected clients.
  optional int32 num_cumulative_clients = 7;

  // The session duration.
  optional int32 session_duration_millis = 8;

  // The idle duration. A group without any client is in idle.
  optional int32 idle_duration_millis = 9;
}

// Easy Connect (DPP)
message WifiDppLog {
  reserved 6;

  // Number of Configurator-Initiator requests
  optional int32 num_dpp_configurator_initiator_requests = 1;

  // Number of Enrollee-Initiator requests
  optional int32 num_dpp_enrollee_initiator_requests = 2;

  // Easy Connect (DPP) Enrollee success
  optional int32 num_dpp_enrollee_success = 3;

  // Easy Connect (DPP) Configurator success code bucket
  repeated DppConfiguratorSuccessStatusHistogramBucket dpp_configurator_success_code = 4;

  // Easy Connect (DPP) failure code bucket
  repeated DppFailureStatusHistogramBucket dpp_failure_code = 5;

  // Easy Connect (DPP) operation time bucket
  repeated HistogramBucketInt32 dpp_operation_time = 7;

  // Number of Enrollee-Responder peer devices supporting DPP protocol version 1
  optional int32 num_dpp_r1_capable_enrollee_responder_devices = 8;

  // Number of Enrollee-Responder peer devices supporting DPP protocol version 2
  optional int32 num_dpp_r2_capable_enrollee_responder_devices = 9;

  // Number of Enrollee-Responder incompatible configurations found in DPP R2 compatibility check.
  optional int32 num_dpp_r2_enrollee_responder_incompatible_configuration = 10;

  // Number of Enrollee-Responder requests
  optional int32 num_dpp_enrollee_responder_requests = 11;

  // Number of Enrollee-Responder success
  optional int32 num_dpp_enrollee_responder_success = 12;

  // Histogram bucket for Wi-Fi DPP configurator success
  message DppConfiguratorSuccessStatusHistogramBucket {
    // status type defining the bucket
    optional DppConfiguratorSuccessCode dpp_status_type = 1;

    // number of samples in the bucket
    optional int32 count = 2;
  }

  // Histogram bucket for Wi-Fi DPP failures
  message DppFailureStatusHistogramBucket {
    // status type defining the bucket
    optional DppFailureCode dpp_status_type = 1;

    // number of samples in the bucket
    optional int32 count = 2;
  }

  enum DppConfiguratorSuccessCode {
    // Unknown success code
    EASY_CONNECT_EVENT_SUCCESS_UNKNOWN = 0;

    // Easy Connect Configurator success event: Configuration sent to enrollee
    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 1;

    // Easy Connect Configurator success event: Configuration applied by enrollee
    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 2;
  }

  enum DppFailureCode {
    // Unknown failure
    EASY_CONNECT_EVENT_FAILURE_UNKNOWN = 0;

    // Easy Connect Failure event: Scanned QR code is either not a Easy Connect URI, or the Easy
    // Connect URI has errors.
    EASY_CONNECT_EVENT_FAILURE_INVALID_URI = 1;

    // Easy Connect Failure event: Bootstrapping/Authentication initialization process failure.
    EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = 2;

    // Easy Connect Failure event: Both devices are implementing the same role and are
    // incompatible.
    EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = 3;

    // Easy Connect Failure event: Configuration process has failed due to malformed message.
    EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = 4;

    // Easy Connect Failure event: Easy Connect request while in another Easy Connect exchange.
    EASY_CONNECT_EVENT_FAILURE_BUSY = 5;

    // Easy Connect Failure event: No response from the peer.
    EASY_CONNECT_EVENT_FAILURE_TIMEOUT = 6;

    // Easy Connect Failure event: General protocol failure.
    EASY_CONNECT_EVENT_FAILURE_GENERIC = 7;

    // Easy Connect Failure event: Feature or option is not supported.
    EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = 8;

    // Easy Connect Failure event: Invalid network provided to Easy Connect configurator.
    // Network must either be WPA3-Personal (SAE) or WPA2-Personal (PSK).
    EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = 9;

    // Easy Connect R2 Failure event: Enrollee cannot find the network.
    EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK = 10;

    // Easy Connect R2 Failure event: Enrollee failed to authenticate with the network.
    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION = 11;

    // Easy Connect R2 Failure event: Enrollee rejected the configuration.
    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION = 12;

    // Easy Connect Failure event: System failed to generate DPP URI.
    EASY_CONNECT_EVENT_FAILURE_URI_GENERATION = 13;

    // Easy Connect Failure event: Enrollee didn't scan the network's operating channel.
    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_FAILED_TO_SCAN_NETWORK_CHANNEL = 14;
  }
}

// WifiConfigStore read/write metrics.
message WifiConfigStoreIO {
  // Histogram of config store read durations.
  repeated DurationBucket read_durations = 1;

  // Histogram of config store write durations.
  repeated DurationBucket write_durations = 2;

  // Total Number of instances of write/read duration in this duration bucket.
  message DurationBucket {
    // Bucket covers duration : [range_start_ms, range_end_ms)
    // The (inclusive) lower bound of read/write duration represented by this bucket
    optional int32 range_start_ms = 1;

    // The (exclusive) upper bound of read/write duration represented by this bucket
    optional int32 range_end_ms = 2;

    // Number of read/write durations that fit into this bucket
    optional int32 count = 3;
  }
}

// Histogram bucket counting with int32. Range is [start, end)
message HistogramBucketInt32 {
  // lower range of the bucket (inclusive)
  optional int32 start = 1;

  // upper range of the bucket (exclusive)
  optional int32 end = 2;

  // number of samples in the bucket
  optional int32 count = 3;
}

// Counts occurrences of a int32 key
message Int32Count {
  // the key
  optional int32 key = 1;

  // the count
  optional int32 count = 2;
}

message LinkProbeStats {
  enum LinkProbeFailureReason {
    // unknown reason
    LINK_PROBE_FAILURE_REASON_UNKNOWN = 0;

    // Specified MCS rate when it is unsupported by the driver.
    LINK_PROBE_FAILURE_REASON_MCS_UNSUPPORTED = 1;

    // Driver reported that no ACK was received for the transmitted probe.
    LINK_PROBE_FAILURE_REASON_NO_ACK = 2;

    // Driver failed to report on the status of the transmitted probe within the timeout.
    LINK_PROBE_FAILURE_REASON_TIMEOUT = 3;

    // An existing link probe is in progress.
    LINK_PROBE_FAILURE_REASON_ALREADY_STARTED = 4;
  }

  // Counts the number of failures for each failure reason.
  message LinkProbeFailureReasonCount {
    // The failure reason.
    optional LinkProbeFailureReason failure_reason = 1;

    // The number of occurrences for this failure reason.
    optional int32 count = 2;
  }

  // Counts the number of link probes for each experiment.
  message ExperimentProbeCounts {
    // The experiment ID.
    optional string experiment_id = 1;

    // The number of link probes triggered for this experiment.
    optional int32 probe_count = 2;
  }

  // Counts the occurrences of RSSI values when a link probe succeeds.
  repeated Int32Count success_rssi_counts = 1;

  // Counts the occurrences of RSSI values when a link probe fails.
  repeated Int32Count failure_rssi_counts = 2;

  // Counts the occurrences of Link Speed values when a link probe succeeds.
  repeated Int32Count success_link_speed_counts = 3;

  // Counts the occurrences of Link Speed values when a link probe fails.
  repeated Int32Count failure_link_speed_counts = 4;

  // Histogram for the number of seconds since the last TX success when a link probe succeeds.
  repeated HistogramBucketInt32 success_seconds_since_last_tx_success_histogram = 5;

  // Histogram for the number of seconds since the last TX success when a link probe fails.
  repeated HistogramBucketInt32 failure_seconds_since_last_tx_success_histogram = 6;

  // Histogram for the elapsed time of successful link probes, in ms.
  repeated HistogramBucketInt32 success_elapsed_time_ms_histogram = 7;

  // Counts the occurrences of error codes for failed link probes.
  repeated LinkProbeFailureReasonCount failure_reason_counts = 8;

  // Counts the number of link probes for each experiment.
  repeated ExperimentProbeCounts experiment_probe_counts = 9;
}

// Stores the decisions that were made by a experiment when compared against another experiment
message NetworkSelectionExperimentDecisions {
  // the id of one experiment
  optional int32 experiment1_id = 1;

  // the id of the other experiment
  optional int32 experiment2_id = 2;

  // Counts occurrences of the number of network choices there were when experiment1 makes the
  // same network selection as experiment2.
  // The keys are the number of network choices, and the values are the number of occurrences of
  // this number of network choices when exp1 and exp2 make the same network selection.
  repeated Int32Count same_selection_num_choices_counter = 3;

  // Counts occurrences of the number of network choices there were when experiment1 makes the
  // same network selection as experiment2.
  // The keys are the number of network choices, and the values are the number of occurrences of
  // this number of network choices when exp1 and exp2 make different network selections.
  // Note that it is possible for the network selection to be different even when there only exists
  // a single network choice, since choosing not to connect to that network is a valid choice.
  repeated Int32Count different_selection_num_choices_counter = 4;
}

// NetworkRequest API metrics.
message WifiNetworkRequestApiLog {
  // Number of requests via this API surface.
  optional int32 num_request = 1;

  // Histogram of requests via this API surface to number of networks matched in scan results.
  repeated HistogramBucketInt32 network_match_size_histogram = 2;

  // Number of requests via this API surface that bypassed user approval.
  optional int32 num_user_approval_bypass = 4;

  // Number of requests via this API surface that was rejected by the user.
  optional int32 num_user_reject = 5;

  // Number of unique apps using this API surface.
  optional int32 num_apps = 6;

  // Number of connections on primary iface.
  optional int32 num_connect_on_primary_iface = 7;

  // Number of successful network connection from this API.
  optional int32 num_connect_success_on_primary_iface = 3;

  // Histogram of connection durations in seconds using this API surface.
  repeated HistogramBucketInt32 connection_duration_sec_on_primary_iface_histogram = 8;

  // Number of connections on secondary iface (STA + STA)
  optional int32 num_connect_on_secondary_iface = 9;

  // Number of connection success on secondary iface (STA + STA)
  optional int32 num_connect_success_on_secondary_iface = 10;

  // Histogram of connection durations in seconds on secondary iface using this API surface.
  repeated HistogramBucketInt32 connection_duration_sec_on_secondary_iface_histogram = 11;

  // Number of times there were concurrent connections (STA + STA):
  // - on a primary iface (internet) and
  // - on a secondary iface (using this API surface)
  optional int32 num_concurrent_connection = 12;

  // Histogram of concurrent connection durations in seconds using this API surface (STA + STA).
  repeated HistogramBucketInt32 concurrent_connection_duration_sec_histogram = 13;
}

// NetworkSuggestion API metrics.
message WifiNetworkSuggestionApiLog {
  enum SuggestionAppTypeCode {
    // UNKNOWN type suggestion app.
    TYPE_UNKNOWN = 0;
    // Suggestion app with carrier privilege.
    TYPE_CARRIER_PRIVILEGED = 1;
    // Suggestion app with network provisioning permission(NETWORK_CARRIER_PROVISIONING).
    TYPE_NETWORK_PROVISIONING = 2;
    // Suggestion app without special privilege.
    TYPE_NON_PRIVILEGED = 3;
  }

  message SuggestionAppCount {
    // Suggestion app type.
    optional SuggestionAppTypeCode app_type = 1;
    // Num of app in this type.
    optional int32 count = 2;
  }

  // Number of modifications to their suggestions by apps.
  optional int32 num_modification = 1;

  // Number of successful network connection from app suggestions.
  optional int32 num_connect_success = 2;

  // Number of network connection failures from app suggestions.
  optional int32 num_connect_failure = 3;

  // Histogram for size of the network lists provided by various apps on the device.
  repeated HistogramBucketInt32 network_list_size_histogram = 4;

  // Count of app using suggestion API with different privilege.
  repeated SuggestionAppCount app_count_per_type = 5;

  // Number of user revoke app's permission from settings or disallowed from UI.
  optional int32 user_revoke_app_suggestion_permission = 6;

  // Number of priority groups configured on the device, excluding the default priority group.
  optional int32 num_priority_groups = 7;

  // Number of times when a ScanResult matched more than one suggestions.
  optional int32 num_multiple_suggestions = 8;

  // Number of saved profiles which also have at least one suggestion (for the same network)
  // provisioned on the device.
  optional int32 num_saved_networks_with_configured_suggestion = 9;
}

// WifiLock metrics
message WifiLockStats {
    // Amount of time wifi is actively in HIGH_PERF mode (ms)
    // This means the lock takes effect and the device takes the actions required for this mode
    optional int64 high_perf_active_time_ms = 1;

    // Amount of time wifi is actively in LOW_LATENCY mode (ms)
    // This means the lock takes effect and the device takes the actions required for this mode
    optional int64 low_latency_active_time_ms = 2;

    // Histogram of HIGH_PERF lock acquisition duration (seconds)
    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
    repeated HistogramBucketInt32 high_perf_lock_acq_duration_sec_histogram = 3;

    // Histogram of LOW_LATENCY lock acquisition duration (seconds)
    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
    repeated HistogramBucketInt32 low_latency_lock_acq_duration_sec_histogram = 4;

    // Histogram of HIGH_PERF active session duration (seconds)
    // This means the lock takes effect and the device takes the actions required for this mode
    repeated HistogramBucketInt32 high_perf_active_session_duration_sec_histogram = 5;

    // Histogram of LOW_LATENCY active session duration (seconds)
    // This means the lock takes effect and the device takes the actions required for this mode
    repeated HistogramBucketInt32 low_latency_active_session_duration_sec_histogram = 6;
}

// Stats on number of times Wi-Fi is turned on/off though the WifiManager#setWifiEnabled API
message WifiToggleStats {
  // Number of time Wi-Fi is turned on by privileged apps
  optional int32 num_toggle_on_privileged = 1;

  // Number of time Wi-Fi is turned off by privileged apps
  optional int32 num_toggle_off_privileged = 2;

  // Number of time Wi-Fi is turned on by normal apps
  optional int32 num_toggle_on_normal = 3;

  // Number of time Wi-Fi is turned off by normal apps
  optional int32 num_toggle_off_normal = 4;
}

// Information about the Passpoint provision metrics.
message PasspointProvisionStats {
  enum ProvisionFailureCode {
    // provisioning failure for unknown reason.
    OSU_FAILURE_UNKNOWN = 0;

    // The reason code for Provisioning Failure due to connection failure to OSU AP.
    OSU_FAILURE_AP_CONNECTION = 1;

    // The reason code for invalid server URL address.
    OSU_FAILURE_SERVER_URL_INVALID = 2;

    // The reason code for provisioning failure due to connection failure to the server.
    OSU_FAILURE_SERVER_CONNECTION = 3;

    // The reason code for provisioning failure due to invalid server certificate.
    OSU_FAILURE_SERVER_VALIDATION = 4;

    // The reason code for provisioning failure due to invalid service provider.
    OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5;

    // The reason code for provisioning failure when a provisioning flow is aborted.
    OSU_FAILURE_PROVISIONING_ABORTED = 6;

    // The reason code for provisioning failure when a provisioning flow is not possible.
    OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;

    // The reason code for provisioning failure due to invalid web url format for an OSU web page.
    OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8;

    // The reason code for provisioning failure when a command received is not the expected command
    // type.
    OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9;

    // The reason code for provisioning failure when a SOAP message is not the expected message
    // type.
    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10;

    // The reason code for provisioning failure when a SOAP message exchange fails.
    OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11;

    // The reason code for provisioning failure when a redirect listener fails to start.
    OSU_FAILURE_START_REDIRECT_LISTENER = 12;

    // The reason code for provisioning failure when a redirect listener timed out to receive a HTTP
    // redirect response.
    OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13;

    // The reason code for provisioning failure when there is no OSU activity to listen to intent.
    OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14;

    // The reason code for provisioning failure when the status of a SOAP message is not the
    // expected message status.
    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15;

    // The reason code for provisioning failure when there is no PPS MO.
    OSU_FAILURE_NO_PPS_MO = 16;

    // The reason code for provisioning failure when there is no AAAServerTrustRoot node in a PPS
    // MO.
    OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17;

    // The reason code for provisioning failure when there is no TrustRoot node for remediation
    // server in a PPS MO.
    OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18;

    // The reason code for provisioning failure when there is no TrustRoot node for policy server in
    // a PPS MO.
    OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19;

    // The reason code for provisioning failure when failing to retrieve trust root certificates
    // used for validating server certificate for AAA, Remediation and Policy server.
    OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20;

    // The reason code for provisioning failure when there is no trust root certificate for AAA
    // server.
    OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21;

    // The reason code for provisioning failure when a {@link PasspointConfiguration} is failed to
    // install.
    OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22;

    // The reason code for provisioning failure when an {@link OsuProvider} is not found for
    // provisioning.
    OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23;
  }

  // Number of passpoint provisioning success
  optional int32 num_provision_success = 1;

  // Count for passpoint provisioning failure
  repeated ProvisionFailureCount provision_failure_count = 2;

  // Number of occurrences of a specific passpoint provision failure code
  message ProvisionFailureCount {
    // Failure code
    optional ProvisionFailureCode failure_code = 1;

    // Number of failure for the failure_code.
    optional int32 count = 2;
  }
}

// Counts number of networks on the device that are metered.
message MeteredNetworkStats {
  // Number of networks that are set or detected as metered.
  optional int32 num_metered = 1 [default = 0];

  // Number of networks that are set or detected as unmetered.
  optional int32 num_unmetered = 2;

  // Number of networks that have meteredOverride set to metered.
  optional int32 num_override_metered = 3;

  // Number of networks that have meteredOverride set to unmetered.
  optional int32 num_override_unmetered = 4;
}

// An event capturing user action on wifi
message UserActionEvent {
  enum EventType {
    // The default and unused event
    EVENT_UNKNOWN = 0;
    // User forgets the network
    EVENT_FORGET_WIFI = 1;
    // User manually triggers disconnect
    EVENT_DISCONNECT_WIFI = 2;
    // User changes the metered setting to "metered"
    EVENT_CONFIGURE_METERED_STATUS_METERED = 3;
    // User changes the metered setting to "unmetered"
    EVENT_CONFIGURE_METERED_STATUS_UNMETERED = 4;
    // User changes the mac randomization setting to use random MAC
    EVENT_CONFIGURE_MAC_RANDOMIZATION_ON = 5;
    // User changes the mac randomization setting to use factory MAC
    EVENT_CONFIGURE_MAC_RANDOMIZATION_OFF = 6;
    // User sets auto-connect to on
    EVENT_CONFIGURE_AUTO_CONNECT_ON = 7;
    // User sets auto-connect to off
    EVENT_CONFIGURE_AUTO_CONNECT_OFF = 8;
    // User toggles wifi on
    EVENT_TOGGLE_WIFI_ON = 9;
    // User toggles wifi off
    EVENT_TOGGLE_WIFI_OFF = 10;
    // User manually connects to a network
    EVENT_MANUAL_CONNECT = 11;
    // User changes the metered setting to "detect automatically"
    EVENT_CONFIGURE_METERED_STATUS_AUTO = 12;
    // User adds a new network or updates configurations for an existing network.
    EVENT_ADD_OR_UPDATE_NETWORK = 13;
    // User sets the adaptive connectivity to on
    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_ON = 14;
    // User sets the adaptive connectivity to off
    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_OFF = 15;
    // User restarts wifi subsystem
    EVENT_RESTART_WIFI_SUB_SYSTEM = 16;
  }

  // The type of user action
  optional EventType event_type = 1;

  // The start time of the event in milliseconds since boot.
  optional int64 start_time_millis = 2;

  // Additional information on the target network for the action. This is not applicable and will
  // be null for some actions such as EVENT_TOGGLE_WIFI_ON.
  optional TargetNetworkInfo target_network_info = 3;

  // Information about the currently connected network.
  optional WifiStatus wifi_status = 4;

  // Reasons why the network applicable for this user action is disabled.
  // Normally this should be referring to the currently connected network.
  // For a manual connection, this is referring to the user selected networks.
  optional NetworkDisableReason network_disable_reason = 5;
}

message WifiStatus {
  // Wifi is connected.
  optional bool is_connected = 1;

  // Wifi is validated
  optional bool is_validated = 2;

  // The last observed RSSI
  optional sint32 last_rssi = 3;

  // Estimated TX
  optional int32 estimated_tx_kbps = 4;

  // Estimated RX
  optional int32 estimated_rx_kbps = 5;

  // There is another candidate with better score, but user connect choice is preventing the switch.
  optional bool is_stuck_due_to_user_connect_choice = 6;
}

// Additional information on a network
message TargetNetworkInfo {
  // Whether the network is an ephemeral network.
  optional bool is_ephemeral = 1;

  // Whether the target is a passpoint network.
  optional bool is_passpoint = 2;
}

// Reasons why a configuration or BSSID is disabled.
message NetworkDisableReason {
  enum DisableReason {
    // Default value, should not be used.
    REASON_UNKNOWN = 0;
    // AP unable to accept more clients, a special kind of association rejection failure.
    REASON_AP_UNABLE_TO_HANDLE_NEW_STA = 1;
    // No internet
    REASON_NETWORK_VALIDATION_FAILURE = 2;
    // Password is incorrect, a special kind of authentication failure.
    REASON_WRONG_PASSWORD = 3;
    // Incorrect EAP credentials.
    REASON_EAP_FAILURE = 4;
    // Other association rejection failures.
    REASON_ASSOCIATION_REJECTION = 5;
    // Associated timeout failures.
    REASON_ASSOCIATION_TIMEOUT = 6;
    // Other authentication failures.
    REASON_AUTHENTICATION_FAILURE = 7;
    // DHCP failures.
    REASON_DHCP_FAILURE = 8;
    // Device disconnected shortly after connection.
    REASON_ABNORMAL_DISCONNECT = 9;
    // AP initiated disconnect for a given duration.
    REASON_FRAMEWORK_DISCONNECT_MBO_OCE = 10;
    // Avoid connecting to the failed AP when trying to reconnect on other available candidates.
    REASON_FRAMEWORK_DISCONNECT_FAST_RECONNECT = 11;
    // The connected scorer has disconnected this network.
    REASON_FRAMEWORK_DISCONNECT_CONNECTED_SCORE = 12;
    // The network is disabled due to absence of user credentials
    REASON_AUTHENTICATION_NO_CREDENTIALS = 13;
    // The network is disabled because service is not subscribed, a special kind of EAP failure.
    REASON_AUTHENTICATION_NO_SUBSCRIPTION = 14;
    // User disabled auto-join for this network.
    REASON_AUTO_JOIN_DISABLED = 15;
  }

  // The reason for disabling a network.
  optional DisableReason disable_reason = 1;

  // The configuration is temporarily disabled.
  optional bool config_temporarily_disabled = 2;

  // The configuration is disabled until the user manually re-enables it.
  optional bool config_permanently_disabled = 3;

  // Reasons why 1 or more BSSIDs are temporarily disabled.
  repeated DisableReason bssid_disable_reasons = 4;
}

// Number of networks with a large change of connection/disconnection
// failure rate or high failure rate at high RSSI
message HealthMonitorFailureStats {
  // Number of networks with a large change of (or high) association rejection rate
  optional int32 cnt_assoc_rejection = 1;
  // Number of networks with a large change of (or high) association timeout rate
  optional int32 cnt_assoc_timeout = 2;
  // Number of networks with a large change of (or high) auth failure rate
  optional int32 cnt_auth_failure = 3;
  // Number of networks with a large change of (or high) connection failure rate
  optional int32 cnt_connection_failure = 4;
  // Number of networks with a large change of (or high) nonlocal disconnection rate
  optional int32 cnt_disconnection_nonlocal = 5;
  // Number of networks with a large change of (or high) short disconnection rate
  optional int32 cnt_short_connection_nonlocal = 6;
  // Number of networks with a large change of (or high) disconnection-during-connecting rate
  optional int32 cnt_disconnection_nonlocal_connecting = 7;
}

// Metrics collected by health monitor
message HealthMonitorMetrics {
  // Number of networks with a large increase (compared to stats of previous build) of
  // connection/disconnection failure rate
  optional HealthMonitorFailureStats failure_stats_increase = 1;
  // Number of networks with a large decrease (compared to stats of previous build) of
  // connection/disconnection failure rate
  optional HealthMonitorFailureStats failure_stats_decrease = 2;
  // Number of networks with high connection/disconnection failure rate for
  // current build but without sufficient connection attempts for previous build
  optional HealthMonitorFailureStats failure_stats_high = 3;
  // Number of networks with sufficient connection attempts for current build
  // but without suffcient connection attempts for previous build
  optional int32 num_network_sufficient_recent_stats_only = 4;
  // Number of networks with sufficient connection attempts for both current and previous builds
  optional int32 num_network_sufficient_recent_prev_stats = 5;
}

// Connection duration statistics collected under various health conditions
// while Wifi link layer stats report are on
message ConnectionDurationStats {
  // Total time with sufficient Wifi throughput and with cellular data on
  optional int32 total_time_sufficient_throughput_ms = 1;
  // Total time with insufficient Wifi throughput and with cellular data on
  optional int32 total_time_insufficient_throughput_ms = 2;
  // Total time with cellular data off
  optional int32 total_time_cellular_data_off_ms = 3;
  // Total time with insufficient Wifi throughput and with cellular data on
  // while wifi is the default network
  optional int32 total_time_insufficient_throughput_default_wifi_ms = 4;
}

// Wi-Fi off metrics
// Keeps track of Wi-Fi off stats
message WifiOffMetrics {
  // Total number of Wi-Fi off
  optional int32 num_wifi_off = 1;

  // Total number of Wi-Fi off with deferring
  optional int32 num_wifi_off_deferring = 2;

  // Total number of Wi-Fi off deferring timeout
  optional int32 num_wifi_off_deferring_timeout = 3;

  // Histogram of wifi off deferring time
  repeated Int32Count wifi_off_deferring_time_histogram = 4;
}

// SoftAp Config  Limitation Metrics
message SoftApConfigLimitationMetrics {
  // Total number of softap security configuration reset to default because
  // hardware limitation when restore configuration from cloud
  optional int32 num_security_type_reset_to_default = 1;

  // Total number of softap max client setting reset to default because
  // hardware limitation when restore configuration from cloud
  optional int32 num_max_client_setting_reset_to_default = 2;

  // Total number of softap client control by user reset to default because
  // hardware limitation when restore configuration from cloud
  optional int32 num_client_control_by_user_reset_to_default = 3;

  // Histogram of max client count when client connection fail because
  // setting limitation
  repeated Int32Count max_client_setting_when_reach_histogram = 4;
}

// Channel utilization histogram
// The valid utilization range is between 0 and 255 corresponding to
// utilization ratio between 0 and 1
message ChannelUtilizationHistogram {
  // Histogram at 2G
  repeated HistogramBucketInt32 utilization_2g = 1;
  // Histogram above 2G
  repeated HistogramBucketInt32 utilization_above_2g = 2;
}

// Throughput histogram
message ThroughputMbpsHistogram {
  // Tx histogram at 2G
  repeated HistogramBucketInt32 tx_2g = 1;
  // Tx histogram above 2G
  repeated HistogramBucketInt32 tx_above_2g = 2;
  // Rx histogram at 2G
  repeated HistogramBucketInt32 rx_2g = 3;
  // Rx histogram above 2G
  repeated HistogramBucketInt32 rx_above_2g = 4;
}

// Initial Partial Scan stats
message InitPartialScanStats {
  // Total number of partial scans
  optional int32 num_scans = 1;

  // Number of instances a partial scan results in finding a network
  optional int32 num_success_scans = 2;

  // Number of instances a patial scan does not result in finding a network
  // and a follow up full scan finds a network.
  optional int32 num_failure_scans = 3;

  // Histogram of number of channels used in a successful partial scan
  repeated HistogramBucketInt32 successful_scan_channel_count_histogram = 4;

  // Histogram of number of channels used in a failed partial scan
  repeated HistogramBucketInt32 failed_scan_channel_count_histogram = 5;
}

// User reaction to the carrier IMSI protection exemption UI
message UserReactionToApprovalUiEvent {
  enum UserActionCode {
    // UNKNOWN user action.
    ACTION_UNKNOWN = 0;
    // Action user allowed.
    ACTION_ALLOWED = 1;
    // Action user disallowed.
    ACTION_DISALLOWED = 2;
    // Action user dismiss.
    ACTION_DISMISS = 3;
  }
  message UserReaction {
    // User action to the UI.
    optional UserActionCode user_action = 1;
    // Is UI a dialog or notification.
    optional bool is_dialog = 2;
  }

  // Event of user reaction to the app approval UI.
  repeated UserReaction user_approval_app_ui_reaction = 1;

  // Event of user reaction to the carrier approval UI.
  repeated UserReaction user_approval_carrier_ui_reaction = 2;
}

message CarrierWifiMetrics {
  // Number of successful network connection using Carrier ID
  optional int32 num_connection_success = 1;
  // Number of failed authentication from network connection using Carrier ID
  optional int32 num_connection_auth_failure = 2;
  optional int32 num_connection_non_auth_failure = 3;
}

message FirstConnectAfterBootStats {
  message Attempt {
    // The attempt completion timestamp, in milliseconds since boot.
    optional int64 timestamp_since_boot_millis = 1;

    // whether the attempt was successful.
    optional bool is_success = 2;
  }

  // Info about whether Wifi was enabled at boot time.
  // `is_success` is true if Wifi is toggled ON at boot, false otherwise.
  // This field will never be null.
  optional Attempt wifi_enabled_at_boot = 1;

  // Info about the first network selection attempt for auto-join.
  // `is_success` is true if a network candidate was found, false otherwise.
  // This field is null if `wifi_enabled_at_boot.is_success` is false.
  optional Attempt first_network_selection = 2;

  // Info about the first successful L2 connection.
  // `is_success` is true if the L2 connection was successfully established, false otherwise.
  // This field is null if `first_network_selection.is_success` is false.
  optional Attempt first_l2_connection = 3;

  // Info about the first successful L3 connection.
  // `is_success` is true if the L3 connection was successfully established, false otherwise.
  // This field is null if `first_l2_connection.is_success` is false.
  optional Attempt first_l3_connection = 4;
}

// Stats for Autojoin switches between Wifi networks. Does not include user/app-initiated switches.
message WifiToWifiSwitchStats {
  // Whether Make Before Break is supported by the hardware and enabled.
  optional bool is_make_before_break_supported = 1;

  // Number of times Wifi to Wifi switch was triggered. This includes Make Before Break and Break
  // Before Make.
  optional int32 wifi_to_wifi_switch_trigger_count = 2;

  // Number of times Wifi to Wifi switch was triggered using Make Before Break (MBB).
  // Note that MBB may not always be used for various reasons e.g. no additional iface available due
  // to ongoing SoftAP, both old and new network have MAC randomization disabled, etc.
  // TODO(b/180974604): also add metrics for the various reasons to not use MBB even when it is
  //  supported by the device.
  optional int32 make_before_break_trigger_count = 3;

  // TODO(b/180974604): add metrics for L2 failure and L3 failure

  // Number of times Make Before Break was aborted due to the new network not having internet.
  optional int32 make_before_break_no_internet_count = 4;

  // Number of times where, for some reason, Make Before Break resulted in the loss of the primary
  // ClientModeManager, and we needed to recover by making one of the SECONDARY_TRANSIENT
  // ClientModeManagers primary.
  optional int32 make_before_break_recover_primary_count = 5;

  // Number of times the new network in Make Before Break had its internet connection validated.
  optional int32 make_before_break_internet_validated_count = 6;

  // Number of times the new network was made primary in Make Before Break.
  // TODO(b/180974604): add metrics for the various ways this could fail.
  optional int32 make_before_break_success_count = 7;

  // Number of times the old network in Make Before Break completed lingering and was disconnected.
  optional int32 make_before_break_linger_completed_count = 8;

  // Histogram of lingering duration caused by make before break in seconds.
  repeated Int32Count make_before_break_linger_duration_seconds = 9;
}

// Network layer bandwidth estimator stats
message BandwidthEstimatorStats {
  // Bandwidth stats of each signal level
  message PerLevel {
    // Signal level derived by RssiUtil.calculateSignalLevel based on RSSI
    optional uint32 signal_level = 1;
    // Accumulated bandwidth sample count
    optional uint32 count = 2;
    // Average network layer bandwidth in kbps based on TrafficStats byte count and radio on time
    // of link layer stats.
    optional uint32 avg_bandwidth_kbps = 3;
    // Error of layer 2 link bandwidth in percent
    optional uint32 l2_error_percent = 4;
    // Error of network layer bandwidth estimation in percent
    optional uint32 bandwidth_est_error_percent = 5;
  }

  // Bandwidth stats of each link
  message PerLink {
    repeated PerLevel level = 1;
  }

  // Bandwidth stats of each band
  message PerBand {
    // Tx bandwidth stats
    optional PerLink tx = 1;
    // Rx bandwidth stats
    optional PerLink rx = 2;
  }

  // Stats of 2g band
  optional PerBand stats_2g = 1;
  // Stats of above-2g band
  optional PerBand stats_above_2g = 2;
}