• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: 22
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
98// The canonical versions of the following enums live in:
99//   frameworks/proto_logging/stats/enums/telephony/enums.proto
100// The canonical versions of the following atoms live in:
101//   frameworks/proto_logging/stats/atoms.proto
102// We cannot link against framework's and statsd's protolite libraries as it is "for test only".
103// NOTE: StatsLog functions use int in place of enum
104
105message VoiceCallSession {
106    optional int32 bearer_at_start = 1;
107    optional int32 bearer_at_end = 2;
108    optional int32 direction = 3;
109    optional int32 setup_duration = 4;
110    optional bool setup_failed = 5;
111    optional int32 disconnect_reason_code = 6;
112    optional int32 disconnect_extra_code = 7;
113    optional string disconnect_extra_message = 8;
114    optional int32 rat_at_start = 9;
115    optional int32 rat_at_end = 10;
116    optional int64 rat_switch_count = 11;
117    optional int64 codec_bitmask = 12;
118    optional int32 concurrent_call_count_at_start = 13;
119    optional int32 concurrent_call_count_at_end = 14;
120    optional int32 sim_slot_index = 15;
121    optional bool is_multi_sim = 16;
122    optional bool is_esim = 17;
123    optional int32 carrier_id = 18;
124    optional bool srvcc_completed = 19;
125    optional int64 srvcc_failure_count = 20;
126    optional int64 srvcc_cancellation_count = 21;
127    optional bool rtt_enabled = 22;
128    optional bool is_emergency = 23;
129    optional bool is_roaming = 24;
130    optional int32 signal_strength_at_end = 25;
131    optional int32 band_at_end = 26;
132    optional int32 setup_duration_millis = 27;
133    optional int32 main_codec_quality = 28;
134    optional bool video_enabled = 29;
135    optional int32 rat_at_connected = 30;
136    optional bool is_multiparty = 31;
137
138    // Internal use only
139    optional int64 setup_begin_millis = 10001;
140}
141
142message VoiceCallRatUsage {
143    optional int32 carrier_id = 1;
144    optional int32 rat = 2;
145    optional int64 total_duration_millis = 3; // Duration needs to be rounded when pulled
146    optional int64 call_count = 4;
147}
148
149message IncomingSms {
150    optional int32 sms_format = 1;
151    optional int32 sms_tech = 2;
152    optional int32 rat = 3;
153    optional int32 sms_type = 4;
154    optional int32 total_parts = 5;
155    optional int32 received_parts = 6;
156    optional bool blocked = 7;
157    optional int32 error = 8;
158    optional bool is_roaming = 9;
159    optional int32 sim_slot_index = 10;
160    optional bool is_multi_sim = 11;
161    optional bool is_esim = 12;
162    optional int32 carrier_id = 13;
163    optional int64 message_id = 14;
164}
165
166message OutgoingSms {
167    optional int32 sms_format = 1;
168    optional int32 sms_tech = 2;
169    optional int32 rat = 3;
170    optional int32 send_result = 4;
171    optional int32 error_code = 5;
172    optional bool is_roaming = 6;
173    optional bool is_from_default_app = 7;
174    optional int32 sim_slot_index = 8;
175    optional bool is_multi_sim = 9;
176    optional bool is_esim = 10;
177    optional int32 carrier_id = 11;
178    optional int64 message_id = 12;
179    optional int32 retry_id = 13;
180}
181
182message CarrierIdMismatch {
183    optional string mcc_mnc = 1;
184    optional string gid1 = 2;
185    optional string spn = 3;
186    optional string pnn = 4;
187}
188
189message DataCallSession {
190    reserved 4;
191    optional int32 dimension = 1;
192    optional bool is_multi_sim = 2;
193    optional bool is_esim = 3;
194    optional int32 apn_type_bitmask = 5;
195    optional int32 carrier_id = 6;
196    optional bool is_roaming = 7;
197    optional int32 rat_at_end = 8;
198    optional bool oos_at_end = 9;
199    optional int64 rat_switch_count = 10;
200    optional bool is_opportunistic = 11;
201    optional int32 ip_type = 12;
202    optional bool setup_failed = 13;
203    optional int32 failure_cause = 14;
204    optional int32 suggested_retry_millis = 15;
205    optional int32 deactivate_reason = 16;
206    optional int64 duration_minutes = 17;
207    optional bool ongoing = 18;
208    optional int32 band_at_end = 19;
209}
210
211message CellularServiceState {
212    optional int32 voice_rat = 1;
213    optional int32 data_rat = 2;
214    optional int32 voice_roaming_type = 3;
215    optional int32 data_roaming_type = 4;
216    optional bool is_endc = 5;
217    optional int32 sim_slot_index = 6;
218    optional bool is_multi_sim = 7;
219    optional int32 carrier_id = 8;
220    optional int64 total_time_millis = 9; // Duration needs to be rounded when pulled
221
222    // Internal use only
223    optional int64 last_used_millis = 10001;
224}
225
226message CellularDataServiceSwitch {
227    optional int32 rat_from = 1;
228    optional int32 rat_to = 2;
229    optional int32 sim_slot_index = 3;
230    optional bool is_multi_sim = 4;
231    optional int32 carrier_id = 5;
232    optional int32 switch_count = 6;
233
234    // Internal use only
235    optional int64 last_used_millis = 10001;
236}
237
238message ImsRegistrationTermination {
239    optional int32 carrier_id = 1;
240    optional bool is_multi_sim = 2;
241    optional int32 rat_at_end = 3;
242    optional bool setup_failed = 4;
243    optional int32 reason_code = 5;
244    optional int32 extra_code = 6;
245    optional string extra_message = 7;
246    optional int32 count = 8;
247
248    // Internal use only
249    optional int64 last_used_millis = 10001;
250}
251
252message ImsRegistrationStats {
253    optional int32 carrier_id = 1;
254    optional int32 sim_slot_index = 2;
255    optional int32 rat = 3;
256    // Durations need to be rounded when pulled
257    optional int64 registered_millis = 4;
258    optional int64 voice_capable_millis = 5;
259    optional int64 voice_available_millis = 6;
260    optional int64 sms_capable_millis = 7;
261    optional int64 sms_available_millis = 8;
262    optional int64 video_capable_millis = 9;
263    optional int64 video_available_millis = 10;
264    optional int64 ut_capable_millis = 11;
265    optional int64 ut_available_millis = 12;
266
267    // Internal use only
268    optional int64 last_used_millis = 10001;
269}
270
271message NetworkRequests {
272    optional int32 carrier_id = 1;
273    optional int32 enterprise_request_count = 2;
274    optional int32 enterprise_release_count = 3;
275}
276