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: 5
27message PersistAtoms {
28    /* Aggregated RAT usage during the call. */
29    repeated RawVoiceCallRatUsage raw_voice_call_rat_usage = 1;
30
31    /* Timestamp of last voice_call_rat_usages pull. */
32    optional int64 raw_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
41// The canonical versions of the following enums live in:
42//   frameworks/base/core/proto/android/telephony/enums.proto
43// The canonical versions of the following atoms live in:
44//   frameworks/base/cmds/statsd/src/atoms.proto
45// We cannot link against framework's and statsd's protolite libraries as it is "for test only".
46// NOTE: StatsLog functions use int in place of enum
47
48message VoiceCallSession {
49    optional int32 bearer_at_start = 1;
50    optional int32 bearer_at_end = 2;
51    optional int32 direction = 3;
52    optional int32 setup_duration = 4;
53    optional bool setup_failed = 5;
54    optional int32 disconnect_reason_code = 6;
55    optional int32 disconnect_extra_code = 7;
56    optional string disconnect_extra_message = 8;
57    optional int32 rat_at_start = 9;
58    optional int32 rat_at_end = 10;
59    optional int64 rat_switch_count = 11;
60    optional int64 codec_bitmask = 12;
61    optional int32 concurrent_call_count_at_start = 13;
62    optional int32 concurrent_call_count_at_end = 14;
63    optional int32 sim_slot_index = 15;
64    optional bool is_multi_sim = 16;
65    optional bool is_esim = 17;
66    optional int32 carrier_id = 18;
67    optional bool srvcc_completed = 19;
68    optional int64 srvcc_failure_count = 20;
69    optional int64 srvcc_cancellation_count = 21;
70    optional bool rtt_enabled = 22;
71    optional bool is_emergency = 23;
72    optional bool is_roaming = 24;
73
74    // Internal use only
75    optional int64 setup_begin_millis = 10001;
76}
77
78// Internal use only
79message RawVoiceCallRatUsage {
80    optional int32 carrier_id = 1;
81    optional int32 rat = 2;
82    optional int64 total_duration_millis = 3;
83    optional int64 call_count = 4;
84}
85