• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file was generated using a Google-internal version of
6 // https://cs.android.com/android/platform/superproject/main/+/main:frameworks/proto_logging/stats/stats_log_api_gen/
7 // fed with Google-internal Cronet atom proto definitions. Google employees should refer to
8 // go/extend-cronet-telemetry.
9 
10 package org.chromium.net.telemetry;
11 
12 import android.os.Build;
13 import android.util.StatsEvent;
14 import android.util.StatsLog;
15 
16 import androidx.annotation.RequiresApi;
17 
18 /** Utility class for logging statistics events. */
19 public final class CronetStatsLog {
20     // Constants for atom codes.
21 
22     /**
23      * CronetEngineCreated cronet_engine_created<br>
24      * Usage: StatsLog.write(StatsLog.CRONET_ENGINE_CREATED, long engine_instance_ref, int
25      * major_version, int minor_version, int build_version, int patch_version, int source, boolean
26      * enable_brotli, boolean enable_http2, int http_cache_mode, boolean
27      * enable_public_key_pinning_bypass_for_local_trust_anchors, boolean enable_quic, boolean
28      * enable_network_quality_estimator, int thread_priority, java.lang.String
29      * experimental_options_quic_connection_options, int
30      * experimental_options_quic_store_server_configs_in_properties, int
31      * experimental_options_quic_max_server_configs_stored_in_properties, int
32      * experimental_options_quic_idle_connection_timeout_seconds, int
33      * experimental_options_quic_goaway_sessions_on_ip_change, int
34      * experimental_options_quic_close_sessions_on_ip_change, int
35      * experimental_options_quic_migrate_sessions_on_network_change_v2, int
36      * experimental_options_quic_migrate_sessions_early_v2, int
37      * experimental_options_quic_quic_disable_bidirectional_streams, int
38      * experimental_options_quic_max_time_before_crypto_handshake_seconds, int
39      * experimental_options_quic_max_idle_time_before_crypto_handshake_seconds, int
40      * experimental_options_quic_enable_socket_recv_optimization, int
41      * experimental_options_asyncdns_enable, int experimental_options_staledns_enable, int
42      * experimental_options_staledns_delay_ms, int
43      * experimental_options_staledns_max_expired_time_ms, int
44      * experimental_options_staledns_max_stale_uses, int
45      * experimental_options_staledns_allow_other_network, int
46      * experimental_options_staledns_persist_to_disk, int
47      * experimental_options_staledns_persist_delay_ms, int
48      * experimental_options_staledns_use_stale_on_name_not_resolved, int
49      * experimental_options_disable_ipv6_on_wifi, long cronet_initialization_ref);<br>
50      */
51     public static final int CRONET_ENGINE_CREATED = 703;
52 
53     /**
54      * CronetTrafficReported cronet_traffic_reported<br>
55      * Usage: StatsLog.write(StatsLog.CRONET_TRAFFIC_REPORTED, long engine_instance_ref, int
56      * request_headers_size, int request_body_size, int response_headers_size, int
57      * response_body_size, int http_status_code, long negotiated_protocol_hash, int
58      * headers_latency_millis, int overall_latency_millis, boolean connection_migration_attempted,
59      * boolean connection_migration_successful, int samples_rate_limited, int terminal_state, int
60      * user_callback_exception_count, long total_idle_time_millis, long
61      * total_user_executor_execute_latency_millis, int read_count, int on_upload_read_count, int
62      * is_bidi_stream);<br>
63      */
64     public static final int CRONET_TRAFFIC_REPORTED = 704;
65 
66     /**
67      * CronetEngineBuilderInitialized cronet_engine_builder_initialized<br>
68      * Usage: StatsLog.write(StatsLog.CRONET_ENGINE_BUILDER_INITIALIZED, long
69      * cronet_initialization_ref, int engine_builder_created_latency_millis, int source, int
70      * creation_successful, long cronet_http_flags_ref, int cronet_api_level, int
71      * cronet_impl_api_level, int major_version, int minor_version, int build_version, int
72      * patch_version, int uid);<br>
73      */
74     public static final int CRONET_ENGINE_BUILDER_INITIALIZED = 762;
75 
76     /**
77      * CronetHttpFlagsInitialized cronet_http_flags_initialized<br>
78      * Usage: StatsLog.write(StatsLog.CRONET_HTTP_FLAGS_INITIALIZED, long cronet_http_flags_ref, int
79      * http_flags_latency_millis, int flags_successful, long[] http_flags_names, long[]
80      * http_flags_values);<br>
81      */
82     public static final int CRONET_HTTP_FLAGS_INITIALIZED = 763;
83 
84     /**
85      * CronetInitialized cronet_initialized<br>
86      * Usage: StatsLog.write(StatsLog.CRONET_INITIALIZED, long cronet_initialization_ref, int
87      * engine_creation_latency_millis, int engine_async_latency_millis);<br>
88      */
89     public static final int CRONET_INITIALIZED = 764;
90 
91     // Constants for enum values.
92 
93     // Values for CronetEngineCreated.source
94     public static final int CRONET_ENGINE_CREATED__SOURCE__CRONET_SOURCE_UNSPECIFIED = 0;
95     public static final int CRONET_ENGINE_CREATED__SOURCE__CRONET_SOURCE_STATICALLY_LINKED = 1;
96     public static final int CRONET_ENGINE_CREATED__SOURCE__CRONET_SOURCE_GMSCORE_DYNAMITE = 2;
97     public static final int CRONET_ENGINE_CREATED__SOURCE__CRONET_SOURCE_FALLBACK = 3;
98 
99     // Values for CronetEngineCreated.http_cache_mode
100     public static final int CRONET_ENGINE_CREATED__HTTP_CACHE_MODE__HTTP_CACHE_MODE_UNSPECIFIED = 0;
101     public static final int CRONET_ENGINE_CREATED__HTTP_CACHE_MODE__HTTP_CACHE_DISABLED = 1;
102     public static final int CRONET_ENGINE_CREATED__HTTP_CACHE_MODE__HTTP_CACHE_DISK = 2;
103     public static final int CRONET_ENGINE_CREATED__HTTP_CACHE_MODE__HTTP_CACHE_DISK_NO_HTTP = 3;
104     public static final int CRONET_ENGINE_CREATED__HTTP_CACHE_MODE__HTTP_CACHE_IN_MEMORY = 4;
105 
106     // Values for CronetEngineCreated.experimental_options_quic_store_server_configs_in_properties
107     public static final int
108             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_STORE_SERVER_CONFIGS_IN_PROPERTIES__OPTIONAL_BOOLEAN_UNSET =
109                     0;
110     public static final int
111             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_STORE_SERVER_CONFIGS_IN_PROPERTIES__OPTIONAL_BOOLEAN_TRUE =
112                     1;
113     public static final int
114             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_STORE_SERVER_CONFIGS_IN_PROPERTIES__OPTIONAL_BOOLEAN_FALSE =
115                     2;
116 
117     // Values for CronetEngineCreated.experimental_options_quic_goaway_sessions_on_ip_change
118     public static final int
119             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_GOAWAY_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_UNSET =
120                     0;
121     public static final int
122             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_GOAWAY_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_TRUE =
123                     1;
124     public static final int
125             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_GOAWAY_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_FALSE =
126                     2;
127 
128     // Values for CronetEngineCreated.experimental_options_quic_close_sessions_on_ip_change
129     public static final int
130             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_CLOSE_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_UNSET =
131                     0;
132     public static final int
133             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_CLOSE_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_TRUE =
134                     1;
135     public static final int
136             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_CLOSE_SESSIONS_ON_IP_CHANGE__OPTIONAL_BOOLEAN_FALSE =
137                     2;
138 
139     // Values for
140     // CronetEngineCreated.experimental_options_quic_migrate_sessions_on_network_change_v2
141     public static final int
142             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_ON_NETWORK_CHANGE_V2__OPTIONAL_BOOLEAN_UNSET =
143                     0;
144     public static final int
145             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_ON_NETWORK_CHANGE_V2__OPTIONAL_BOOLEAN_TRUE =
146                     1;
147     public static final int
148             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_ON_NETWORK_CHANGE_V2__OPTIONAL_BOOLEAN_FALSE =
149                     2;
150 
151     // Values for CronetEngineCreated.experimental_options_quic_migrate_sessions_early_v2
152     public static final int
153             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_EARLY_V2__OPTIONAL_BOOLEAN_UNSET =
154                     0;
155     public static final int
156             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_EARLY_V2__OPTIONAL_BOOLEAN_TRUE =
157                     1;
158     public static final int
159             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_MIGRATE_SESSIONS_EARLY_V2__OPTIONAL_BOOLEAN_FALSE =
160                     2;
161 
162     // Values for CronetEngineCreated.experimental_options_quic_quic_disable_bidirectional_streams
163     public static final int
164             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_QUIC_DISABLE_BIDIRECTIONAL_STREAMS__OPTIONAL_BOOLEAN_UNSET =
165                     0;
166     public static final int
167             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_QUIC_DISABLE_BIDIRECTIONAL_STREAMS__OPTIONAL_BOOLEAN_TRUE =
168                     1;
169     public static final int
170             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_QUIC_DISABLE_BIDIRECTIONAL_STREAMS__OPTIONAL_BOOLEAN_FALSE =
171                     2;
172 
173     // Values for CronetEngineCreated.experimental_options_quic_enable_socket_recv_optimization
174     public static final int
175             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_ENABLE_SOCKET_RECV_OPTIMIZATION__OPTIONAL_BOOLEAN_UNSET =
176                     0;
177     public static final int
178             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_ENABLE_SOCKET_RECV_OPTIMIZATION__OPTIONAL_BOOLEAN_TRUE =
179                     1;
180     public static final int
181             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_QUIC_ENABLE_SOCKET_RECV_OPTIMIZATION__OPTIONAL_BOOLEAN_FALSE =
182                     2;
183 
184     // Values for CronetEngineCreated.experimental_options_asyncdns_enable
185     public static final int
186             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_ASYNCDNS_ENABLE__OPTIONAL_BOOLEAN_UNSET = 0;
187     public static final int
188             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_ASYNCDNS_ENABLE__OPTIONAL_BOOLEAN_TRUE = 1;
189     public static final int
190             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_ASYNCDNS_ENABLE__OPTIONAL_BOOLEAN_FALSE = 2;
191 
192     // Values for CronetEngineCreated.experimental_options_staledns_enable
193     public static final int
194             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ENABLE__OPTIONAL_BOOLEAN_UNSET = 0;
195     public static final int
196             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ENABLE__OPTIONAL_BOOLEAN_TRUE = 1;
197     public static final int
198             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ENABLE__OPTIONAL_BOOLEAN_FALSE = 2;
199 
200     // Values for CronetEngineCreated.experimental_options_staledns_allow_other_network
201     public static final int
202             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ALLOW_OTHER_NETWORK__OPTIONAL_BOOLEAN_UNSET =
203                     0;
204     public static final int
205             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ALLOW_OTHER_NETWORK__OPTIONAL_BOOLEAN_TRUE =
206                     1;
207     public static final int
208             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_ALLOW_OTHER_NETWORK__OPTIONAL_BOOLEAN_FALSE =
209                     2;
210 
211     // Values for CronetEngineCreated.experimental_options_staledns_persist_to_disk
212     public static final int
213             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_PERSIST_TO_DISK__OPTIONAL_BOOLEAN_UNSET =
214                     0;
215     public static final int
216             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_PERSIST_TO_DISK__OPTIONAL_BOOLEAN_TRUE =
217                     1;
218     public static final int
219             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_PERSIST_TO_DISK__OPTIONAL_BOOLEAN_FALSE =
220                     2;
221 
222     // Values for CronetEngineCreated.experimental_options_staledns_use_stale_on_name_not_resolved
223     public static final int
224             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_USE_STALE_ON_NAME_NOT_RESOLVED__OPTIONAL_BOOLEAN_UNSET =
225                     0;
226     public static final int
227             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_USE_STALE_ON_NAME_NOT_RESOLVED__OPTIONAL_BOOLEAN_TRUE =
228                     1;
229     public static final int
230             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_STALEDNS_USE_STALE_ON_NAME_NOT_RESOLVED__OPTIONAL_BOOLEAN_FALSE =
231                     2;
232 
233     // Values for CronetEngineCreated.experimental_options_disable_ipv6_on_wifi
234     public static final int
235             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_DISABLE_IPV6_ON_WIFI__OPTIONAL_BOOLEAN_UNSET =
236                     0;
237     public static final int
238             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_DISABLE_IPV6_ON_WIFI__OPTIONAL_BOOLEAN_TRUE =
239                     1;
240     public static final int
241             CRONET_ENGINE_CREATED__EXPERIMENTAL_OPTIONS_DISABLE_IPV6_ON_WIFI__OPTIONAL_BOOLEAN_FALSE =
242                     2;
243 
244     // Values for CronetTrafficReported.request_headers_size
245     public static final int
246             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_UNSPECIFIED =
247                     0;
248     public static final int
249             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_UNDER_ONE_KIB =
250                     1;
251     public static final int
252             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_ONE_TO_TEN_KIB =
253                     2;
254     public static final int
255             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_TEN_TO_TWENTY_FIVE_KIB =
256                     3;
257     public static final int
258             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_TWENTY_FIVE_TO_FIFTY_KIB =
259                     4;
260     public static final int
261             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_FIFTY_TO_HUNDRED_KIB =
262                     5;
263     public static final int
264             CRONET_TRAFFIC_REPORTED__REQUEST_HEADERS_SIZE__REQUEST_HEADERS_SIZE_BUCKET_OVER_HUNDRED_KIB =
265                     6;
266 
267     // Values for CronetTrafficReported.request_body_size
268     public static final int
269             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_UNSPECIFIED = 0;
270     public static final int
271             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_ZERO = 1;
272     public static final int
273             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_UNDER_TEN_KIB = 2;
274     public static final int
275             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_TEN_TO_FIFTY_KIB =
276                     3;
277     public static final int
278             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_FIFTY_TO_TWO_HUNDRED_KIB =
279                     4;
280     public static final int
281             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_TWO_HUNDRED_TO_FIVE_HUNDRED_KIB =
282                     5;
283     public static final int
284             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_FIVE_HUNDRED_KIB_TO_ONE_MIB =
285                     6;
286     public static final int
287             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_ONE_TO_FIVE_MIB =
288                     7;
289     public static final int
290             CRONET_TRAFFIC_REPORTED__REQUEST_BODY_SIZE__REQUEST_BODY_SIZE_BUCKET_OVER_FIVE_MIB = 8;
291 
292     // Values for CronetTrafficReported.response_headers_size
293     public static final int
294             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_UNSPECIFIED =
295                     0;
296     public static final int
297             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_UNDER_ONE_KIB =
298                     1;
299     public static final int
300             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_ONE_TO_TEN_KIB =
301                     2;
302     public static final int
303             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_TEN_TO_TWENTY_FIVE_KIB =
304                     3;
305     public static final int
306             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_TWENTY_FIVE_TO_FIFTY_KIB =
307                     4;
308     public static final int
309             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_FIFTY_TO_HUNDRED_KIB =
310                     5;
311     public static final int
312             CRONET_TRAFFIC_REPORTED__RESPONSE_HEADERS_SIZE__RESPONSE_HEADERS_SIZE_BUCKET_OVER_HUNDRED_KIB =
313                     6;
314 
315     // Values for CronetTrafficReported.response_body_size
316     public static final int
317             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_UNSPECIFIED = 0;
318     public static final int
319             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_ZERO = 1;
320     public static final int
321             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_UNDER_TEN_KIB =
322                     2;
323     public static final int
324             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_TEN_TO_FIFTY_KIB =
325                     3;
326     public static final int
327             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_FIFTY_TO_TWO_HUNDRED_KIB =
328                     4;
329     public static final int
330             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_TWO_HUNDRED_TO_FIVE_HUNDRED_KIB =
331                     5;
332     public static final int
333             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_FIVE_HUNDRED_KIB_TO_ONE_MIB =
334                     6;
335     public static final int
336             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_ONE_TO_FIVE_MIB =
337                     7;
338     public static final int
339             CRONET_TRAFFIC_REPORTED__RESPONSE_BODY_SIZE__RESPONSE_BODY_SIZE_BUCKET_OVER_FIVE_MIB =
340                     8;
341 
342     // Values for CronetTrafficReported.terminal_state
343     public static final int CRONET_TRAFFIC_REPORTED__TERMINAL_STATE__STATE_UNKNOWN = 0;
344     public static final int CRONET_TRAFFIC_REPORTED__TERMINAL_STATE__STATE_SUCCEEDED = 1;
345     public static final int CRONET_TRAFFIC_REPORTED__TERMINAL_STATE__STATE_ERROR = 2;
346     public static final int CRONET_TRAFFIC_REPORTED__TERMINAL_STATE__STATE_CANCELLED = 3;
347 
348     // Values for CronetTrafficReported.is_bidi_stream
349     public static final int CRONET_TRAFFIC_REPORTED__IS_BIDI_STREAM__OPTIONAL_BOOLEAN_UNSET = 0;
350     public static final int CRONET_TRAFFIC_REPORTED__IS_BIDI_STREAM__OPTIONAL_BOOLEAN_TRUE = 1;
351     public static final int CRONET_TRAFFIC_REPORTED__IS_BIDI_STREAM__OPTIONAL_BOOLEAN_FALSE = 2;
352 
353     // Values for CronetEngineBuilderInitialized.source
354     public static final int CRONET_ENGINE_BUILDER_INITIALIZED__SOURCE__CRONET_SOURCE_UNSPECIFIED =
355             0;
356     public static final int
357             CRONET_ENGINE_BUILDER_INITIALIZED__SOURCE__CRONET_SOURCE_EMBEDDED_NATIVE = 1;
358     public static final int CRONET_ENGINE_BUILDER_INITIALIZED__SOURCE__CRONET_SOURCE_EMBEDDED_JAVA =
359             2;
360     public static final int
361             CRONET_ENGINE_BUILDER_INITIALIZED__SOURCE__CRONET_SOURCE_GMSCORE_NATIVE = 3;
362     public static final int
363             CRONET_ENGINE_BUILDER_INITIALIZED__SOURCE__CRONET_SOURCE_HTTPENGINE_NATIVE = 4;
364 
365     // Values for CronetEngineBuilderInitialized.creation_successful
366     public static final int
367             CRONET_ENGINE_BUILDER_INITIALIZED__CREATION_SUCCESSFUL__OPTIONAL_BOOLEAN_UNSET = 0;
368     public static final int
369             CRONET_ENGINE_BUILDER_INITIALIZED__CREATION_SUCCESSFUL__OPTIONAL_BOOLEAN_TRUE = 1;
370     public static final int
371             CRONET_ENGINE_BUILDER_INITIALIZED__CREATION_SUCCESSFUL__OPTIONAL_BOOLEAN_FALSE = 2;
372 
373     // Values for CronetHttpFlagsInitialized.flags_successful
374     public static final int
375             CRONET_HTTP_FLAGS_INITIALIZED__FLAGS_SUCCESSFUL__OPTIONAL_BOOLEAN_UNSET = 0;
376     public static final int CRONET_HTTP_FLAGS_INITIALIZED__FLAGS_SUCCESSFUL__OPTIONAL_BOOLEAN_TRUE =
377             1;
378     public static final int
379             CRONET_HTTP_FLAGS_INITIALIZED__FLAGS_SUCCESSFUL__OPTIONAL_BOOLEAN_FALSE = 2;
380 
381     // Annotation constants.
382     public static final byte ANNOTATION_ID_IS_UID = StatsLog.ANNOTATION_ID_IS_UID;
383     public static final byte ANNOTATION_ID_TRUNCATE_TIMESTAMP =
384             StatsLog.ANNOTATION_ID_TRUNCATE_TIMESTAMP;
385     public static final byte ANNOTATION_ID_PRIMARY_FIELD = StatsLog.ANNOTATION_ID_PRIMARY_FIELD;
386     public static final byte ANNOTATION_ID_EXCLUSIVE_STATE = StatsLog.ANNOTATION_ID_EXCLUSIVE_STATE;
387     public static final byte ANNOTATION_ID_PRIMARY_FIELD_FIRST_UID =
388             StatsLog.ANNOTATION_ID_PRIMARY_FIELD_FIRST_UID;
389     public static final byte ANNOTATION_ID_DEFAULT_STATE = StatsLog.ANNOTATION_ID_DEFAULT_STATE;
390     public static final byte ANNOTATION_ID_TRIGGER_STATE_RESET =
391             StatsLog.ANNOTATION_ID_TRIGGER_STATE_RESET;
392     public static final byte ANNOTATION_ID_STATE_NESTED = StatsLog.ANNOTATION_ID_STATE_NESTED;
393 
394     // Write methods
write(int code, long arg1, int arg2, int arg3)395     public static void write(int code, long arg1, int arg2, int arg3) {
396         final StatsEvent.Builder builder = StatsEvent.newBuilder();
397         builder.setAtomId(code);
398         builder.writeLong(arg1);
399         builder.writeInt(arg2);
400         builder.writeInt(arg3);
401 
402         builder.usePooledBuffer();
403         StatsLog.write(builder.build());
404     }
405 
write( int code, long arg1, int arg2, int arg3, int arg4, int arg5, int arg6, boolean arg7, boolean arg8, int arg9, boolean arg10, boolean arg11, boolean arg12, int arg13, java.lang.String arg14, int arg15, int arg16, int arg17, int arg18, int arg19, int arg20, int arg21, int arg22, int arg23, int arg24, int arg25, int arg26, int arg27, int arg28, int arg29, int arg30, int arg31, int arg32, int arg33, int arg34, int arg35, long arg36)406     public static void write(
407             int code,
408             long arg1,
409             int arg2,
410             int arg3,
411             int arg4,
412             int arg5,
413             int arg6,
414             boolean arg7,
415             boolean arg8,
416             int arg9,
417             boolean arg10,
418             boolean arg11,
419             boolean arg12,
420             int arg13,
421             java.lang.String arg14,
422             int arg15,
423             int arg16,
424             int arg17,
425             int arg18,
426             int arg19,
427             int arg20,
428             int arg21,
429             int arg22,
430             int arg23,
431             int arg24,
432             int arg25,
433             int arg26,
434             int arg27,
435             int arg28,
436             int arg29,
437             int arg30,
438             int arg31,
439             int arg32,
440             int arg33,
441             int arg34,
442             int arg35,
443             long arg36) {
444         final StatsEvent.Builder builder = StatsEvent.newBuilder();
445         builder.setAtomId(code);
446         builder.writeLong(arg1);
447         builder.writeInt(arg2);
448         builder.writeInt(arg3);
449         builder.writeInt(arg4);
450         builder.writeInt(arg5);
451         builder.writeInt(arg6);
452         builder.writeBoolean(arg7);
453         builder.writeBoolean(arg8);
454         builder.writeInt(arg9);
455         builder.writeBoolean(arg10);
456         builder.writeBoolean(arg11);
457         builder.writeBoolean(arg12);
458         builder.writeInt(arg13);
459         builder.writeString(arg14);
460         builder.writeInt(arg15);
461         builder.writeInt(arg16);
462         builder.writeInt(arg17);
463         builder.writeInt(arg18);
464         builder.writeInt(arg19);
465         builder.writeInt(arg20);
466         builder.writeInt(arg21);
467         builder.writeInt(arg22);
468         builder.writeInt(arg23);
469         builder.writeInt(arg24);
470         builder.writeInt(arg25);
471         builder.writeInt(arg26);
472         builder.writeInt(arg27);
473         builder.writeInt(arg28);
474         builder.writeInt(arg29);
475         builder.writeInt(arg30);
476         builder.writeInt(arg31);
477         builder.writeInt(arg32);
478         builder.writeInt(arg33);
479         builder.writeInt(arg34);
480         builder.writeInt(arg35);
481         builder.writeLong(arg36);
482 
483         builder.usePooledBuffer();
484         StatsLog.write(builder.build());
485     }
486 
write( int code, long arg1, int arg2, int arg3, int arg4, int arg5, int arg6, long arg7, int arg8, int arg9, boolean arg10, boolean arg11, int arg12, int arg13, int arg14, long arg15, long arg16, int arg17, int arg18, int arg19)487     public static void write(
488             int code,
489             long arg1,
490             int arg2,
491             int arg3,
492             int arg4,
493             int arg5,
494             int arg6,
495             long arg7,
496             int arg8,
497             int arg9,
498             boolean arg10,
499             boolean arg11,
500             int arg12,
501             int arg13,
502             int arg14,
503             long arg15,
504             long arg16,
505             int arg17,
506             int arg18,
507             int arg19) {
508         final StatsEvent.Builder builder = StatsEvent.newBuilder();
509         builder.setAtomId(code);
510         builder.writeLong(arg1);
511         builder.writeInt(arg2);
512         builder.writeInt(arg3);
513         builder.writeInt(arg4);
514         builder.writeInt(arg5);
515         builder.writeInt(arg6);
516         builder.writeLong(arg7);
517         builder.writeInt(arg8);
518         builder.writeInt(arg9);
519         builder.writeBoolean(arg10);
520         builder.writeBoolean(arg11);
521         builder.writeInt(arg12);
522         builder.writeInt(arg13);
523         builder.writeInt(arg14);
524         builder.writeLong(arg15);
525         builder.writeLong(arg16);
526         builder.writeInt(arg17);
527         builder.writeInt(arg18);
528         builder.writeInt(arg19);
529 
530         builder.usePooledBuffer();
531         StatsLog.write(builder.build());
532     }
533 
write( int code, long arg1, int arg2, int arg3, int arg4, long arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12)534     public static void write(
535             int code,
536             long arg1,
537             int arg2,
538             int arg3,
539             int arg4,
540             long arg5,
541             int arg6,
542             int arg7,
543             int arg8,
544             int arg9,
545             int arg10,
546             int arg11,
547             int arg12) {
548         final StatsEvent.Builder builder = StatsEvent.newBuilder();
549         builder.setAtomId(code);
550         builder.writeLong(arg1);
551         builder.writeInt(arg2);
552         builder.writeInt(arg3);
553         builder.writeInt(arg4);
554         builder.writeLong(arg5);
555         builder.writeInt(arg6);
556         builder.writeInt(arg7);
557         builder.writeInt(arg8);
558         builder.writeInt(arg9);
559         builder.writeInt(arg10);
560         builder.writeInt(arg11);
561         builder.writeInt(arg12);
562         if (CRONET_ENGINE_BUILDER_INITIALIZED == code) {
563             builder.addBooleanAnnotation(ANNOTATION_ID_IS_UID, true);
564         }
565 
566         builder.usePooledBuffer();
567         StatsLog.write(builder.build());
568     }
569 
570     // **The @RequiresApi annotation below needs to be added back after regenerating this file.**
571     // TODO(b/313088483): Autogenerate the @RequiresApi annotation
572     @RequiresApi(Build.VERSION_CODES.TIRAMISU)
write(int code, long arg1, int arg2, int arg3, long[] arg4, long[] arg5)573     public static void write(int code, long arg1, int arg2, int arg3, long[] arg4, long[] arg5) {
574         final StatsEvent.Builder builder = StatsEvent.newBuilder();
575         builder.setAtomId(code);
576         builder.writeLong(arg1);
577         builder.writeInt(arg2);
578         builder.writeInt(arg3);
579         builder.writeLongArray(null == arg4 ? new long[0] : arg4);
580         builder.writeLongArray(null == arg5 ? new long[0] : arg5);
581 
582         builder.usePooledBuffer();
583         StatsLog.write(builder.build());
584     }
585 
586 }
587