1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package telephonyStatsLog;
20
21option java_package = "com.android.internal.telephony";
22option java_outer_classname = "PersistAtomsProto";
23
24// Holds atoms to store on persist storage in case of power cycle or process crash.
25// NOTE: using int64 rather than google.protobuf.Timestamp for timestamps simplifies implementation.
26// Next id: 50
27message PersistAtoms {
28    /* Aggregated RAT usage during the call. */
29    repeated VoiceCallRatUsage voice_call_rat_usage = 1;
30
31    /* Timestamp of last voice_call_rat_usages pull. */
32    optional int64 voice_call_rat_usage_pull_timestamp_millis = 2;
33
34    /* Per call statistics and information. */
35    repeated VoiceCallSession voice_call_session = 3;
36
37    /* Timestamp of last voice_call_sessions pull. */
38    optional int64 voice_call_session_pull_timestamp_millis = 4;
39
40    /* Incoming SMS statistics and information. */
41    repeated IncomingSms incoming_sms = 5;
42
43    /* Timestamp of last incoming_sms pull. */
44    optional int64 incoming_sms_pull_timestamp_millis = 6;
45
46    /* Outgoing SMS statistics and information. */
47    repeated OutgoingSms outgoing_sms = 7;
48
49    /* Timestamp of last incoming_sms pull. */
50    optional int64 outgoing_sms_pull_timestamp_millis = 8;
51
52    /* List of carrier ID mismatch events already sent. */
53    repeated CarrierIdMismatch carrier_id_mismatch = 9;
54
55    /* Last version of carrier ID table sent. */
56    optional int32 carrier_id_table_version = 10;
57
58    /* Data Call session statistics and information. */
59    repeated DataCallSession data_call_session = 11;
60
61    /* Timestamp of last data_call_session pull. */
62    optional int64 data_call_session_pull_timestamp_millis = 12;
63
64    /* Duration spent in each possible service state. */
65    repeated CellularServiceState cellular_service_state = 13;
66
67    /* Timestamp of last cellular_service_state pull. */
68    optional int64 cellular_service_state_pull_timestamp_millis = 14;
69
70    /* Switch count between data RATs. */
71    repeated CellularDataServiceSwitch cellular_data_service_switch = 15;
72
73    /* Timestamp of last cellular_data_service_switch pull. */
74    optional int64 cellular_data_service_switch_pull_timestamp_millis = 16;
75
76    /* List of IMS registration terminations. */
77    repeated ImsRegistrationTermination ims_registration_termination = 17;
78
79    /* Timestamp of last ims_registration_termination pull. */
80    optional int64 ims_registration_termination_pull_timestamp_millis = 18;
81
82    /* Durations of IMS registrations and capabilities. */
83    repeated ImsRegistrationStats ims_registration_stats = 19;
84
85    /* Timestamp of last ims_registration_stats pull. */
86    optional int64 ims_registration_stats_pull_timestamp_millis = 20;
87
88    /* Last Android build fingerprint. This usually changes after system OTA. */
89    optional string build_fingerprint = 21;
90
91    /* Summary of received network requests. */
92    repeated NetworkRequests network_requests = 22;
93
94    /* Timestamp of last network_requests pull. */
95    optional int64 network_requests_pull_timestamp_millis = 23;
96
97    /* RCS single registrtions feature tag information. */
98    repeated ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats = 24;
99
100    /* Timestamp of last ims_registration_feature_tag_stats pull. */
101    optional int64 ims_registration_feature_tag_stats_pull_timestamp_millis = 25;
102
103    /* RCS client provisioning statistics and information. */
104    repeated RcsClientProvisioningStats rcs_client_provisioning_stats = 26;
105
106    /* Timestamp of last rcs_client_provisioning_stats pull. */
107    optional int64 rcs_client_provisioning_stats_pull_timestamp_millis = 27;
108
109    /* RCS configuration statistics and information based ACS. */
110    repeated RcsAcsProvisioningStats rcs_acs_provisioning_stats = 28;
111
112    /* Timestamp of last rcs_acs_provisioning_stats pull. */
113    optional int64 rcs_acs_provisioning_stats_pull_timestamp_millis = 29;
114
115    /* SIP delegate statistics and information. */
116    repeated SipDelegateStats sip_delegate_stats = 30;
117
118    /* Timestamp of last sip_delegate_stats pull. */
119    optional int64 sip_delegate_stats_pull_timestamp_millis = 31;
120
121    /* SIP Transport featuere tag statistics and information. */
122    repeated SipTransportFeatureTagStats sip_transport_feature_tag_stats = 32;
123
124    /* Timestamp of last sip_transport_feature_tag_stats pull. */
125    optional int64 sip_transport_feature_tag_stats_pull_timestamp_millis = 33;
126
127    /* SIP Message response statistics and information. */
128    repeated SipMessageResponse sip_message_response = 34;
129
130    /* Timestamp of last sip_message_response pull. */
131    optional int64 sip_message_response_pull_timestamp_millis = 35;
132
133    /* SIP Transport session statistics and information. */
134    repeated SipTransportSession sip_transport_session = 36;
135
136    /* Timestamp of last sip_transport_session pull. */
137    optional int64 sip_transport_session_pull_timestamp_millis = 37;
138
139    /* Dedicated bearer listener statistics and information. */
140    repeated ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event = 38;
141
142    /* Timestamp of last ims_dedicated_bearer_listener_event pull. */
143    optional int64 ims_dedicated_bearer_listener_event_pull_timestamp_millis = 39;
144
145    /* Dedicated bearer event statistics and information. */
146    repeated ImsDedicatedBearerEvent ims_dedicated_bearer_event = 40;
147
148    /* Timestamp of last ims_dedicated_bearer_event pull. */
149    optional int64 ims_dedicated_bearer_event_pull_timestamp_millis = 41;
150
151    /* Publish featere tag statistics and information. */
152    repeated ImsRegistrationServiceDescStats ims_registration_service_desc_stats = 42;
153
154    /* Timestamp of last ims_registration_service_desc_stats pull. */
155    optional int64 ims_registration_service_desc_stats_pull_timestamp_millis = 43;
156
157    /* UCE event stats statistics and information. */
158    repeated UceEventStats uce_event_stats = 44;
159
160    /* Timestamp of last uce_event_stats pull. */
161    optional int64 uce_event_stats_pull_timestamp_millis = 45;
162
163    /* Presence notify event statistics and information. */
164    repeated PresenceNotifyEvent presence_notify_event = 46;
165
166    /* Timestamp of last presence_notify_event pull. */
167    optional int64 presence_notify_event_pull_timestamp_millis = 47;
168
169    /* GBA event statistics and information. */
170    repeated GbaEvent gba_event = 48;
171
172    /* Timestamp of last gba_event pull. */
173    optional int64 gba_event_pull_timestamp_millis = 49;
174}
175
176// The canonical versions of the following enums live in:
177//   frameworks/proto_logging/stats/enums/telephony/enums.proto
178// The canonical versions of the following atoms live in:
179//   frameworks/proto_logging/stats/atoms.proto
180// We cannot link against framework's and statsd's protolite libraries as it is "for test only".
181// NOTE: StatsLog functions use int in place of enum
182
183message VoiceCallSession {
184    optional int32 bearer_at_start = 1;
185    optional int32 bearer_at_end = 2;
186    optional int32 direction = 3;
187    optional int32 setup_duration = 4;
188    optional bool setup_failed = 5;
189    optional int32 disconnect_reason_code = 6;
190    optional int32 disconnect_extra_code = 7;
191    optional string disconnect_extra_message = 8;
192    optional int32 rat_at_start = 9;
193    optional int32 rat_at_end = 10;
194    optional int64 rat_switch_count = 11;
195    optional int64 codec_bitmask = 12;
196    optional int32 concurrent_call_count_at_start = 13;
197    optional int32 concurrent_call_count_at_end = 14;
198    optional int32 sim_slot_index = 15;
199    optional bool is_multi_sim = 16;
200    optional bool is_esim = 17;
201    optional int32 carrier_id = 18;
202    optional bool srvcc_completed = 19;
203    optional int64 srvcc_failure_count = 20;
204    optional int64 srvcc_cancellation_count = 21;
205    optional bool rtt_enabled = 22;
206    optional bool is_emergency = 23;
207    optional bool is_roaming = 24;
208    optional int32 signal_strength_at_end = 25;
209    optional int32 band_at_end = 26;
210    optional int32 setup_duration_millis = 27;
211    optional int32 main_codec_quality = 28;
212    optional bool video_enabled = 29;
213    optional int32 rat_at_connected = 30;
214    optional bool is_multiparty = 31;
215
216    // Internal use only
217    optional int64 setup_begin_millis = 10001;
218}
219
220message VoiceCallRatUsage {
221    optional int32 carrier_id = 1;
222    optional int32 rat = 2;
223    optional int64 total_duration_millis = 3; // Duration needs to be rounded when pulled
224    optional int64 call_count = 4;
225}
226
227message IncomingSms {
228    optional int32 sms_format = 1;
229    optional int32 sms_tech = 2;
230    optional int32 rat = 3;
231    optional int32 sms_type = 4;
232    optional int32 total_parts = 5;
233    optional int32 received_parts = 6;
234    optional bool blocked = 7;
235    optional int32 error = 8;
236    optional bool is_roaming = 9;
237    optional int32 sim_slot_index = 10;
238    optional bool is_multi_sim = 11;
239    optional bool is_esim = 12;
240    optional int32 carrier_id = 13;
241    optional int64 message_id = 14;
242}
243
244message OutgoingSms {
245    optional int32 sms_format = 1;
246    optional int32 sms_tech = 2;
247    optional int32 rat = 3;
248    optional int32 send_result = 4;
249    optional int32 error_code = 5;
250    optional bool is_roaming = 6;
251    optional bool is_from_default_app = 7;
252    optional int32 sim_slot_index = 8;
253    optional bool is_multi_sim = 9;
254    optional bool is_esim = 10;
255    optional int32 carrier_id = 11;
256    optional int64 message_id = 12;
257    optional int32 retry_id = 13;
258}
259
260message CarrierIdMismatch {
261    optional string mcc_mnc = 1;
262    optional string gid1 = 2;
263    optional string spn = 3;
264    optional string pnn = 4;
265}
266
267message DataCallSession {
268    reserved 4;
269    optional int32 dimension = 1;
270    optional bool is_multi_sim = 2;
271    optional bool is_esim = 3;
272    optional int32 apn_type_bitmask = 5;
273    optional int32 carrier_id = 6;
274    optional bool is_roaming = 7;
275    optional int32 rat_at_end = 8;
276    optional bool oos_at_end = 9;
277    optional int64 rat_switch_count = 10;
278    optional bool is_opportunistic = 11;
279    optional int32 ip_type = 12;
280    optional bool setup_failed = 13;
281    optional int32 failure_cause = 14;
282    optional int32 suggested_retry_millis = 15;
283    optional int32 deactivate_reason = 16;
284    optional int64 duration_minutes = 17;
285    optional bool ongoing = 18;
286    optional int32 band_at_end = 19;
287}
288
289message CellularServiceState {
290    optional int32 voice_rat = 1;
291    optional int32 data_rat = 2;
292    optional int32 voice_roaming_type = 3;
293    optional int32 data_roaming_type = 4;
294    optional bool is_endc = 5;
295    optional int32 sim_slot_index = 6;
296    optional bool is_multi_sim = 7;
297    optional int32 carrier_id = 8;
298    optional int64 total_time_millis = 9; // Duration needs to be rounded when pulled
299
300    // Internal use only
301    optional int64 last_used_millis = 10001;
302}
303
304message CellularDataServiceSwitch {
305    optional int32 rat_from = 1;
306    optional int32 rat_to = 2;
307    optional int32 sim_slot_index = 3;
308    optional bool is_multi_sim = 4;
309    optional int32 carrier_id = 5;
310    optional int32 switch_count = 6;
311
312    // Internal use only
313    optional int64 last_used_millis = 10001;
314}
315
316message ImsRegistrationTermination {
317    optional int32 carrier_id = 1;
318    optional bool is_multi_sim = 2;
319    optional int32 rat_at_end = 3;
320    optional bool setup_failed = 4;
321    optional int32 reason_code = 5;
322    optional int32 extra_code = 6;
323    optional string extra_message = 7;
324    optional int32 count = 8;
325
326    // Internal use only
327    optional int64 last_used_millis = 10001;
328}
329
330message ImsRegistrationStats {
331    optional int32 carrier_id = 1;
332    optional int32 sim_slot_index = 2;
333    optional int32 rat = 3;
334    // Durations need to be rounded when pulled
335    optional int64 registered_millis = 4;
336    optional int64 voice_capable_millis = 5;
337    optional int64 voice_available_millis = 6;
338    optional int64 sms_capable_millis = 7;
339    optional int64 sms_available_millis = 8;
340    optional int64 video_capable_millis = 9;
341    optional int64 video_available_millis = 10;
342    optional int64 ut_capable_millis = 11;
343    optional int64 ut_available_millis = 12;
344
345    // Internal use only
346    optional int64 last_used_millis = 10001;
347}
348
349message NetworkRequests {
350    optional int32 carrier_id = 1;
351    optional int32 enterprise_request_count = 2;
352    optional int32 enterprise_release_count = 3;
353}
354
355message ImsRegistrationFeatureTagStats {
356    optional int32 carrier_id = 1;
357    optional int32 slot_id = 2;
358    optional int32 feature_tag_name = 3;
359    optional int32 registration_tech = 4;
360    optional int64 registered_millis = 5;
361}
362
363message RcsClientProvisioningStats {
364    optional int32 carrier_id = 1;
365    optional int32 slot_id = 2;
366    optional int32 event = 3;
367    optional int32 count = 4;
368}
369
370message RcsAcsProvisioningStats {
371    optional int32 carrier_id = 1;
372    optional int32 slot_id = 2;
373    optional int32 response_code = 3;
374    optional int32 response_type = 4;
375    optional bool is_single_registration_enabled = 5;
376    optional int32 count = 6;
377    optional int64 state_timer_millis = 7;
378}
379
380message SipDelegateStats {
381    optional int32 dimension = 1;
382    optional int32 carrier_id = 2;
383    optional int32 slot_id = 3;
384    optional int32 destroy_reason = 4;
385    optional int64 uptime_millis = 5;
386}
387
388message SipTransportFeatureTagStats {
389    optional int32 carrier_id = 1;
390    optional int32 slot_id = 2;
391    optional int32 feature_tag_name = 3;
392    optional int32 sip_transport_denied_reason = 4;
393    optional int32 sip_transport_deregistered_reason = 5;
394    optional int64 associated_millis = 6;
395}
396
397message SipMessageResponse {
398    optional int32 carrier_id = 1;
399    optional int32 slot_id = 2;
400    optional int32 sip_message_method = 3;
401    optional int32 sip_message_response = 4;
402    optional int32 sip_message_direction = 5;
403    optional int32 message_error = 6;
404    optional int32 count = 7;
405}
406
407message SipTransportSession {
408    optional int32 carrier_id = 1;
409    optional int32 slot_id = 2;
410    optional int32 session_method = 3;
411    optional int32 sip_message_direction = 4;
412    optional int32 sip_response = 5;
413    optional int32 session_count = 6;
414    optional int32 ended_gracefully_count = 7;
415
416    // Internal use only
417    optional bool is_ended_gracefully = 10001;
418}
419
420message ImsDedicatedBearerListenerEvent {
421    optional int32 carrier_id = 1;
422    optional int32 slot_id = 2;
423    optional int32 rat_at_end = 3;
424    optional int32 qci = 4;
425    optional bool dedicated_bearer_established = 5;
426    optional int32 event_count = 6;
427}
428
429message ImsDedicatedBearerEvent {
430    optional int32 carrier_id = 1;
431    optional int32 slot_id = 2;
432    optional int32 rat_at_end = 3;
433    optional int32 qci = 4;
434    optional int32 bearer_state = 5;
435    optional bool local_connection_info_received = 6;
436    optional bool remote_connection_info_received = 7;
437    optional bool has_listeners = 8;
438    optional int32 count = 9;
439}
440
441message ImsRegistrationServiceDescStats {
442    optional int32 carrier_id = 1;
443    optional int32 slot_id = 2;
444    optional int32 service_id_name = 3;
445    optional float service_id_version = 4;
446    optional int32 registration_tech = 5;
447    optional int64 published_millis = 6;
448}
449
450message UceEventStats {
451    optional int32 carrier_id = 1;
452    optional int32 slot_id = 2;
453    optional int32 type = 3;
454    optional bool successful = 4;
455    optional int32 command_code = 5;
456    optional int32 network_response = 6;
457    optional int32 count = 7;
458}
459
460message PresenceNotifyEvent {
461    optional int32 carrier_id = 1;
462    optional int32 slot_id = 2;
463    optional int32 reason = 3;
464    optional bool content_body_received = 4;
465    optional int32 rcs_caps_count = 5;
466    optional int32 mmtel_caps_count = 6;
467    optional int32 no_caps_count = 7;
468    optional int32 count = 8;
469}
470
471message GbaEvent {
472    optional int32 carrier_id = 1;
473    optional int32 slot_id = 2;
474    optional bool successful = 3;
475    optional int32 failed_reason = 4;
476    optional int32 count = 5;
477}