aboutsummaryrefslogtreecommitdiffstats
path: root/proto/telephony.proto
blob: 066375953a715f34664035474c94de68ed037d8f (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
//
// 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 clearcut.connectivity;

option java_package = "com.android.internal.telephony";
option java_outer_classname = "TelephonyProto";

// The information about Telephony events.
message TelephonyLog {

  // Events logged by telephony services
  repeated TelephonyEvent events = 1;

  // Voice/Video call sessions
  repeated TelephonyCallSession call_sessions = 2;

  // Send/Receive SMS sessions
  repeated SmsSession sms_sessions = 3;

  // Telephony Histograms
  repeated TelephonyHistogram histograms = 4;

  // Indicating some telephony events are dropped
  optional bool events_dropped = 5;

  // The start time of this log
  optional Time start_time = 6;

  // The end time of this log
  optional Time end_time = 7;
}

// The time information
message Time {
  // The system time in milli seconds. This represents the actual
  // time of the events.
  optional int64 system_timestamp_millis = 1;

  // The time since boot in milli seconds.
  // This is used for calculating the time interval between events. Different
  // from the system time, this won't be affected by time changed by the network or users.
  optional int64 elapsed_timestamp_millis = 2;
}

// Telephony Histogram
message TelephonyHistogram {

  // Type of histogram
  optional int32 category = 1;

  // Unique Id identifying a sample within
  // particular category of the histogram.
  optional int32 id = 2;

  // Min time taken in millis.
  optional int32 min_time_millis = 3;

  // Max time taken in millis.
  optional int32 max_time_millis = 4;

  // Average time taken in millis.
  optional int32 avg_time_millis = 5;

  // Total count of histogram samples.
  optional int32 count = 6;

  // Total number of time ranges expected
  // (must be greater than 1).
  optional int32 bucket_count = 7;

  // Array storing endpoints of range buckets.
  repeated int32 bucket_end_points = 8;

  // Array storing counts for each time range
  // starting from smallest value range.
  repeated int32 bucket_counters = 9;
}

// Telephony related user settings
message TelephonySettings {

  // NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
  enum RilNetworkMode {

    // Mode is unknown.
    NETWORK_MODE_UNKNOWN = 0;

    // GSM/WCDMA (WCDMA preferred)
    NETWORK_MODE_WCDMA_PREF = 1;

    // GSM only
    NETWORK_MODE_GSM_ONLY = 2;

    // WCDMA only
    NETWORK_MODE_WCDMA_ONLY = 3;

    // GSM/WCDMA (auto mode, according to PRL)
    NETWORK_MODE_GSM_UMTS = 4;

    // CDMA and EvDo (auto mode, according to PRL)
    NETWORK_MODE_CDMA = 5;

    // CDMA only
    NETWORK_MODE_CDMA_NO_EVDO = 6;

    // EvDo only
    NETWORK_MODE_EVDO_NO_CDMA = 7;

    // GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
    NETWORK_MODE_GLOBAL = 8;

    // LTE, CDMA and EvDo
    NETWORK_MODE_LTE_CDMA_EVDO = 9;

    // LTE, GSM/WCDMA
    NETWORK_MODE_LTE_GSM_WCDMA = 10;

    // LTE, CDMA, EvDo, GSM/WCDMA
    NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = 11;

    // LTE Only mode
    NETWORK_MODE_LTE_ONLY = 12;

    // LTE/WCDMA
    NETWORK_MODE_LTE_WCDMA = 13;

    // TD-SCDMA only
    NETWORK_MODE_TDSCDMA_ONLY = 14;

    // TD-SCDMA and WCDMA
    NETWORK_MODE_TDSCDMA_WCDMA = 15;

    // TD-SCDMA and LTE
    NETWORK_MODE_LTE_TDSCDMA = 16;

    // TD-SCDMA and GSM
    NETWORK_MODE_TDSCDMA_GSM = 17;

    // TD-SCDMA,GSM and LTE
    NETWORK_MODE_LTE_TDSCDMA_GSM = 18;

    // TD-SCDMA, GSM/WCDMA
    NETWORK_MODE_TDSCDMA_GSM_WCDMA = 19;

    // TD-SCDMA, WCDMA and LTE
    NETWORK_MODE_LTE_TDSCDMA_WCDMA = 20;

    // TD-SCDMA, GSM/WCDMA and LTE
    NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = 21;

    // TD-SCDMA,EvDo,CDMA,GSM/WCDMA
    NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 22;

    // TD-SCDMA/LTE/GSM/WCDMA, CDMA, and EvDo
    NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 23;
  }

  // Constants for WiFi Calling mode
  enum WiFiCallingMode {

    // Calling mode is unknown.
    WFC_MODE_UNKNOWN = 0;

    WFC_MODE_WIFI_ONLY = 1;

    WFC_MODE_CELLULAR_PREFERRED = 2;

    WFC_MODE_WIFI_PREFERRED = 3;
  }

  // If the device is in airplane mode.
  optional bool is_airplane_mode = 1;

  // If cell-data has been enabled.
  optional bool is_cellular_data_enabled = 2;

  // If cell-roaming has been enabled.
  optional bool is_data_roaming_enabled = 3;

  // Preferred network mode.
  optional RilNetworkMode preferred_network_mode = 4;

  // If enhanced mode enabled.
  optional bool is_enhanced_4g_lte_mode_enabled = 5;

  // If wifi has been enabled.
  optional bool is_wifi_enabled = 6;

  // If wifi-calling has been enabled.
  optional bool is_wifi_calling_enabled = 7;

  // Wifi-calling Mode.
  optional WiFiCallingMode wifi_calling_mode = 8;

  // If video over LTE enabled.
  optional bool is_vt_over_lte_enabled = 9;

  // If video over wifi enabled.
  optional bool is_vt_over_wifi_enabled = 10;
}

// Contains phone state and service related information.
message TelephonyServiceState {

  // The information about cellular network operator
  message TelephonyOperator {

    // Name in long alphanumeric format
    optional string alpha_long = 1;

    // Name in short alphanumeric format
    optional string alpha_short = 2;

    // Numeric id.
    // In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit
    // network code. Same as MCC/MNC.
    optional string numeric = 3;
  }

  // Roaming type
  enum RoamingType {

    // In home network
    ROAMING_TYPE_NOT_ROAMING = 0;

    // In a roaming network, but we can not tell
    // if it's domestic or international
    ROAMING_TYPE_UNKNOWN = 1;

    // In domestic roaming network
    ROAMING_TYPE_DOMESTIC = 2;

    // In international roaming network
    ROAMING_TYPE_INTERNATIONAL = 3;
  }

  // Current registered operator
  optional TelephonyOperator voice_operator = 1;

  // Current registered data network operator
  optional TelephonyOperator data_operator = 2;

  // Current voice network roaming type
  optional RoamingType voice_roaming_type = 3;

  // Current data network roaming type
  optional RoamingType data_roaming_type = 4;

  // Current voice radio technology
  optional RadioAccessTechnology voice_rat = 5;

  // Current data radio technology
  optional RadioAccessTechnology data_rat = 6;
}

// Radio access families
enum RadioAccessTechnology {

  RAT_UNKNOWN = 0;

  RAT_GPRS = 1;

  RAT_EDGE = 2;

  RAT_UMTS = 3;

  RAT_IS95A = 4;

  RAT_IS95B = 5;

  RAT_1XRTT = 6;

  RAT_EVDO_0 = 7;

  RAT_EVDO_A = 8;

  RAT_HSDPA = 9;

  RAT_HSUPA = 10;

  RAT_HSPA = 11;

  RAT_EVDO_B = 12;

  RAT_EHRPD = 13;

  RAT_LTE = 14;

  RAT_HSPAP = 15;

  RAT_GSM = 16;

  RAT_TD_SCDMA = 17;

  RAT_IWLAN = 18;

  RAT_LTE_CA = 19;
}

// The information about IMS errors
// https://cs.corp.google.com/#android/frameworks/base/telephony/java/com/android/ims/ImsReasonInfo.java
message ImsReasonInfo {

  // Main reason code.
  optional int32 reason_code = 1;

  // Extra code value; it depends on the code value.
  optional int32 extra_code = 2;

  // Additional message of the reason info. We get this from the modem.
  optional string extra_message = 3;
}

// The information about state connection between IMS service and IMS server
message ImsConnectionState {

  // Current state
  optional State state = 1;

  // If DISCONNECTED then this field may have additional information about
  // connection problem.
  optional ImsReasonInfo reason_info = 2;

  // Posible states
  enum State {

    // State is unknown.
    STATE_UNKNOWN = 0;

    CONNECTED = 1;

    PROGRESSING = 2;

    DISCONNECTED = 3;

    RESUMED = 4;

    SUSPENDED = 5;
  }
}

// The information about current capabilities of IMS service
message ImsCapabilities {

  optional bool voice_over_lte = 1;

  optional bool voice_over_wifi = 2;

  optional bool video_over_lte = 3;

  optional bool video_over_wifi = 4;

  optional bool ut_over_lte = 5;

  optional bool ut_over_wifi = 6;
}

// Errors returned by RIL
enum RilErrno {

  // type is unknown.
  RIL_E_UNKNOWN = 0;

  RIL_E_SUCCESS = 1;

  // If radio did not start or is resetting
  RIL_E_RADIO_NOT_AVAILABLE = 2;

  RIL_E_GENERIC_FAILURE = 3;

  // for PIN/PIN2 methods only!
  RIL_E_PASSWORD_INCORRECT = 4;

  // Operation requires SIM PIN2 to be entered
  RIL_E_SIM_PIN2 = 5;

  // Operation requires SIM PIN2 to be entered
  RIL_E_SIM_PUK2 = 6;

  RIL_E_REQUEST_NOT_SUPPORTED = 7;

  RIL_E_CANCELLED = 8;

  // data ops are not allowed during voice call on a Class C GPRS device
  RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 9;

  // data ops are not allowed before device registers in network
  RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 10;

  // fail to send sms and need retry
  RIL_E_SMS_SEND_FAIL_RETRY = 11;

  // fail to set the location where CDMA subscription shall be retrieved
  // because of SIM or RUIM card absent
  RIL_E_SIM_ABSENT = 12;

  // fail to find CDMA subscription from specified location
  RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 13;

  // HW does not support preferred network type
  RIL_E_MODE_NOT_SUPPORTED = 14;

  // command failed because recipient is not on FDN list
  RIL_E_FDN_CHECK_FAILURE = 15;

  // network selection failed due to illegal SIM or ME
  RIL_E_ILLEGAL_SIM_OR_ME = 16;

  // no logical channel available
  RIL_E_MISSING_RESOURCE = 17;

  // application not found on SIM
  RIL_E_NO_SUCH_ELEMENT = 18;

  // DIAL request modified to USSD
  RIL_E_DIAL_MODIFIED_TO_USSD = 19;

  // DIAL request modified to SS
  RIL_E_DIAL_MODIFIED_TO_SS = 20;

  // DIAL request modified to DIAL with different data
  RIL_E_DIAL_MODIFIED_TO_DIAL = 21;

  // USSD request modified to DIAL
  RIL_E_USSD_MODIFIED_TO_DIAL = 22;

  // USSD request modified to SS
  RIL_E_USSD_MODIFIED_TO_SS = 23;

  // USSD request modified to different USSD request
  RIL_E_USSD_MODIFIED_TO_USSD = 24;

  // SS request modified to DIAL
  RIL_E_SS_MODIFIED_TO_DIAL = 25;

  // SS request modified to USSD
  RIL_E_SS_MODIFIED_TO_USSD = 26;

  // Subscription not supported by RIL
  RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 27;

  // SS request modified to different SS request
  RIL_E_SS_MODIFIED_TO_SS = 28;

  // LCE service not supported(36 in RILConstants.java)
  RIL_E_LCE_NOT_SUPPORTED = 36;
}

// PDP_type values in TS 27.007 section 10.1.1.
enum PdpType {

  // type is unknown.
  PDP_UNKNOWN = 0;

  PDP_TYPE_IP = 1;

  PDP_TYPE_IPV6 = 2;

  PDP_TYPE_IPV4V6 = 3;

  PDP_TYPE_PPP = 4;
}

// The information about packet data connection
message RilDataCall {

  // Context ID, uniquely identifies this call
  optional int32 cid = 1;

  // One of the PDP_type values in TS 27.007 section 10.1.1
  optional PdpType type = 2;

  // The network interface name e.g. wlan0, rmnet_data0.
  optional string iframe = 3;
}

message TelephonyEvent {

  enum Type {

    // Unknown event
    UNKNOWN = 0;

    // Telephony related user settings changed
    SETTINGS_CHANGED = 1;

    // Phone state changed
    RIL_SERVICE_STATE_CHANGED = 2;

    // IMS connected/disconnected
    IMS_CONNECTION_STATE_CHANGED = 3;

    // IMS Voice, Video and Ut capabilities changed
    IMS_CAPABILITIES_CHANGED = 4;

    // Setup a packet data connection
    DATA_CALL_SETUP = 5;

    // RIL request result
    DATA_CALL_SETUP_RESPONSE = 6;

    // Notification that new data call has appeared in the list
    // or old data call has removed.
    DATA_CALL_LIST_CHANGED = 7;

    // Deactivate packet data connection
    DATA_CALL_DEACTIVATE = 8;

    // RIL request result
    DATA_CALL_DEACTIVATE_RESPONSE = 9;

    // Logging a data stall + its action
    DATA_STALL_ACTION = 10;

    // Modem Restarted. Logging a baseband version and reason for restart
    // along with the event if it is available
    MODEM_RESTART = 11;

    // System time overwritten by NITZ (Network time)
    NITZ_TIME = 12;
  }

  // Setup a packet data connection
  message RilSetupDataCall {

    // See ril.h RIL_REQUEST_SETUP_DATA_CALL
    enum RilDataProfile {

      // type is unknown.
      RIL_DATA_UNKNOWN = 0;

      RIL_DATA_PROFILE_DEFAULT = 1;

      RIL_DATA_PROFILE_TETHERED = 2;

      RIL_DATA_PROFILE_IMS = 3;

      RIL_DATA_PROFILE_FOTA = 4;

      RIL_DATA_PROFILE_CBS = 5;

      RIL_DATA_PROFILE_OEM_BASE = 6;

      RIL_DATA_PROFILE_INVALID = 7;
    }

    // Radio technology to use
    optional RadioAccessTechnology rat = 1;

    // optional RIL_DataProfile
    optional RilDataProfile data_profile = 2;

    // APN to connect to if radio technology is GSM/UMTS
    optional string apn = 3;

    // the connection type to request
    optional PdpType type = 4;
  }

  // RIL response to RilSetupDataCall
  message RilSetupDataCallResponse {

    // Copy of enum RIL_DataCallFailCause defined at
    // https://cs.corp.google.com/android/hardware/ril/include/telephony/ril.h
    enum RilDataCallFailCause {

      // Failure reason is unknown.
      PDP_FAIL_UNKNOWN = 0;

      // No error, connection ok
      PDP_FAIL_NONE = 1;

      PDP_FAIL_OPERATOR_BARRED = 8;

      PDP_FAIL_NAS_SIGNALLING = 14;

      PDP_FAIL_LLC_SNDCP = 25;

      PDP_FAIL_INSUFFICIENT_RESOURCES = 26;

      PDP_FAIL_MISSING_UKNOWN_APN = 27;

      PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 28;

      PDP_FAIL_USER_AUTHENTICATION = 29;

      PDP_FAIL_ACTIVATION_REJECT_GGSN = 30;

      PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 31;

      PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 32;

      PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33;

      PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 34;

      PDP_FAIL_NSAPI_IN_USE = 35;

      // Possibly restart radio, based on framework config
      PDP_FAIL_REGULAR_DEACTIVATION = 36;

      PDP_FAIL_QOS_NOT_ACCEPTED = 37;

      PDP_FAIL_NETWORK_FAILURE = 38;

      PDP_FAIL_UMTS_REACTIVATION_REQ = 39;

      PDP_FAIL_FEATURE_NOT_SUPP = 40;

      PDP_FAIL_TFT_SEMANTIC_ERROR = 41;

      PDP_FAIL_TFT_SYTAX_ERROR = 42;

      PDP_FAIL_UNKNOWN_PDP_CONTEXT = 43;

      PDP_FAIL_FILTER_SEMANTIC_ERROR = 44;

      PDP_FAIL_FILTER_SYTAX_ERROR = 45;

      PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 46;

      PDP_FAIL_ONLY_IPV4_ALLOWED = 50;

      PDP_FAIL_ONLY_IPV6_ALLOWED = 51;

      PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 52;

      PDP_FAIL_ESM_INFO_NOT_RECEIVED = 53;

      PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 54;

      PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55;

      PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 65;

      PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 66;

      PDP_FAIL_INVALID_TRANSACTION_ID = 81;

      PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 95;

      PDP_FAIL_INVALID_MANDATORY_INFO = 96;

      PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 97;

      PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 98;

      PDP_FAIL_UNKNOWN_INFO_ELEMENT = 99;

      PDP_FAIL_CONDITIONAL_IE_ERROR = 100;

      PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101;

      PDP_FAIL_PROTOCOL_ERRORS   = 111;

      PDP_FAIL_APN_TYPE_CONFLICT = 112;

      PDP_FAIL_INVALID_PCSCF_ADDR = 113;

      PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114;

      PDP_FAIL_EMM_ACCESS_BARRED = 115;

      PDP_FAIL_EMERGENCY_IFACE_ONLY = 116;

      PDP_FAIL_IFACE_MISMATCH = 117;

      PDP_FAIL_COMPANION_IFACE_IN_USE = 118;

      PDP_FAIL_IP_ADDRESS_MISMATCH = 119;

      PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 120;

      PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 121;

      PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 122;

      // Not mentioned in the specification
      PDP_FAIL_VOICE_REGISTRATION_FAIL = -1;

      PDP_FAIL_DATA_REGISTRATION_FAIL = -2;

      // Reasons for data call drop - network/modem disconnect
      PDP_FAIL_SIGNAL_LOST = -3;

      // Preferred technology has changed, should retry with parameters
      // appropriate for new technology
      PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4;

      // Data call was disconnected because radio was resetting,
      // powered off - no retry
      PDP_FAIL_RADIO_POWER_OFF = -5;

      // Data call was disconnected by modem because tethered mode was up
      // on same APN/data profile - no retry until tethered call is off
      PDP_FAIL_TETHERED_CALL_ACTIVE = -6;

      // retry silently
      PDP_FAIL_ERROR_UNSPECIFIED = 65535;
    }

    // A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error
    optional RilDataCallFailCause status = 1;

    // If status != 0, this fields indicates the suggested retry back-off timer
    // value RIL wants to override the one pre-configured in FW
    optional int32 suggested_retry_time_millis = 2;

    optional RilDataCall call = 3;
  }

  // Deactivate packet data connection
  message RilDeactivateDataCall {

    // Context ID
    optional int32 cid = 1;

    // Reason for deactivating data call
    optional DeactivateReason reason = 2;

    // Deactivate data call reasons
    enum DeactivateReason {

      // Reason is unknown.
      DEACTIVATE_REASON_UNKNOWN = 0;

      DEACTIVATE_REASON_NONE = 1;

      DEACTIVATE_REASON_RADIO_OFF = 2;

      DEACTIVATE_REASON_PDP_RESET = 3;
    }
  }

  message ModemRestart {
     // The baseband_version is used to identify the particular software version
     // where the modem restarts happened
     optional string baseband_version = 1;

     // Indicates the modem restart reason. The restart reason can be used to
     // categorize any modem crashes and group similar crashes together. This
     // information will be useful to identify the cause of modem crashes,
     // reproduce the issue and confirm that the fix works.
     optional string reason = 2;
  }

  // Time when event happened on device, in milliseconds since epoch
  optional int64 timestamp_millis = 1;

  // In Multi-SIM devices this indicates SIM slot
  optional int32 phone_id = 2;

  // Event type
  optional Type type = 3;

  // User settings
  optional TelephonySettings settings = 4;

  // RIL Service State
  optional TelephonyServiceState service_state = 5;

  // IMS state
  optional ImsConnectionState ims_connection_state = 6;

  // IMS capabilities
  optional ImsCapabilities ims_capabilities = 7;

  // List of data calls when changed
  repeated RilDataCall data_calls = 8;

  // RIL error code
  optional RilErrno error = 9;

  // Setup data call request
  optional RilSetupDataCall setup_data_call = 10;

  // Setup data call response
  optional RilSetupDataCallResponse setup_data_call_response = 11;

  // Deactivate data call request
  optional RilDeactivateDataCall deactivate_data_call = 12;

  // Data call stall recovery action
  optional int32 data_stall_action = 13;

  // Modem restart event
  optional ModemRestart modem_restart = 14;

  // NITZ time in milliseconds
  optional int64 nitz_timestamp_millis = 15;
}

enum TimeInterval {
  TI_UNKNOWN = 0;
  TI_10_MILLIS = 1;
  TI_20_MILLIS = 2;
  TI_50_MILLIS = 3;
  TI_100_MILLIS = 4;
  TI_200_MILLIS = 5;
  TI_500_MILLIS = 6;
  TI_1_SEC = 7;
  TI_2_SEC = 8;
  TI_5_SEC = 9;
  TI_10_SEC = 10;
  TI_30_SEC = 11;
  TI_1_MINUTE = 12;
  TI_3_MINUTES = 13;
  TI_10_MINUTES = 14;
  TI_30_MINUTES = 15;
  TI_1_HOUR = 16;
  TI_2_HOURS = 17;
  TI_4_HOURS = 18;
  TI_MANY_HOURS = 19;
}

// Information about CS and/or PS call session.
// Session starts when call is placed or accepted and
// ends when there are no more active calls.
message TelephonyCallSession {

  message Event {

    enum Type {

      // Unknown event
      EVENT_UNKNOWN = 0;

      // Telephony related user settings changed
      SETTINGS_CHANGED = 1;

      // Phone state changed
      RIL_SERVICE_STATE_CHANGED = 2;

      // IMS connected/disconnected
      IMS_CONNECTION_STATE_CHANGED = 3;

      // IMS Voice, Video and Ut capabilities changed
      IMS_CAPABILITIES_CHANGED = 4;

      // Notification that new data call has appeared in the list
      // or old data call has removed.
      DATA_CALL_LIST_CHANGED = 5;

      // Send request to RIL
      RIL_REQUEST = 6;

      // Result of the RIL request
      RIL_RESPONSE = 7;

      // Ring indication for an incoming call
      RIL_CALL_RING = 8;

      // Notification that Single Radio Voice Call Continuity(SRVCC)
      // progress state has changed.
      RIL_CALL_SRVCC = 9;

      // Notification that list of calls has changed.
      RIL_CALL_LIST_CHANGED = 10;

      // Command sent to IMS Service. See ImsCommand.
      IMS_COMMAND = 11;

      // Command sent to IMS Service. See ImsCommand.
      IMS_COMMAND_RECEIVED = 12;

      // Command sent to IMS Service. See ImsCommand.
      IMS_COMMAND_FAILED = 13;

      // Command sent to IMS Service. See ImsCommand.
      IMS_COMMAND_COMPLETE = 14;

      // Notification about incoming voice call
      IMS_CALL_RECEIVE = 15;

      // Notification that state of the call has changed
      IMS_CALL_STATE_CHANGED = 16;

      // Notification about IMS call termination
      IMS_CALL_TERMINATED = 17;

      // Notification that session access technology has changed
      IMS_CALL_HANDOVER = 18;

      // Notification that session access technology has changed
      IMS_CALL_HANDOVER_FAILED = 19;

      // Notification about phone state changed.
      PHONE_STATE_CHANGED = 20;

      // System time overwritten by NITZ (Network time)
      NITZ_TIME = 21;
    }

    enum RilRequest {

      RIL_REQUEST_UNKNOWN = 0;

      // Initiate voice call
      RIL_REQUEST_DIAL = 1;

      // Answer incoming call
      RIL_REQUEST_ANSWER = 2;

      // Hang up a specific line
      RIL_REQUEST_HANGUP = 3;

      // Configure current call waiting state
      RIL_REQUEST_SET_CALL_WAITING = 4;

      RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE = 5;

      // Send FLASH
      RIL_REQUEST_CDMA_FLASH = 6;

      // Conference holding and active
      RIL_REQUEST_CONFERENCE = 7;
    }

    enum ImsCommand {

      // Command is unknown.
      IMS_CMD_UNKNOWN = 0;

      IMS_CMD_START = 1;

      IMS_CMD_ACCEPT = 2;

      IMS_CMD_REJECT = 3;

      IMS_CMD_TERMINATE = 4;

      IMS_CMD_HOLD = 5;

      IMS_CMD_RESUME = 6;

      IMS_CMD_MERGE = 7;

      IMS_CMD_UPDATE = 8;

      IMS_CMD_CONFERENCE_EXTEND = 9;

      IMS_CMD_INVITE_PARTICIPANT = 10;

      IMS_CMD_REMOVE_PARTICIPANT = 11;
    }

    enum PhoneState {

      // State is unknown.
      STATE_UNKNOWN = 0;

      STATE_IDLE = 1;

      STATE_RINGING = 2;

      STATE_OFFHOOK = 3;
    }

    // Telephony call states
    enum CallState {

      // State is unknown.
      CALL_UNKNOWN = 0;

      CALL_IDLE = 1;

      CALL_ACTIVE = 2;

      CALL_HOLDING = 3;

      CALL_DIALING = 4;

      CALL_ALERTING = 5;

      CALL_INCOMING = 6;

      CALL_WAITING = 7;

      CALL_DISCONNECTED = 8;

      CALL_DISCONNECTING = 9;
    }

    // The information about a voice call
    message RilCall {

      enum Type {

        // Scan Type is unknown.
        UNKNOWN = 0;

        // Mobile originated
        MO = 1;

        // Mobile terminated
        MT = 2;
      }

      // Connection Index
      optional int32 index = 1;

      optional CallState state = 2;

      optional Type type = 3;
    }

    // Single Radio Voice Call Continuity(SRVCC) progress state
    enum RilSrvccState {

      // State is unknown.
      HANDOVER_UNKNOWN = 0;

      HANDOVER_STARTED = 1;

      HANDOVER_COMPLETED = 2;

      HANDOVER_FAILED = 3;

      HANDOVER_CANCELED = 4;
    }

    // Event type
    optional Type type = 1;

    // Time since previous event
    optional TimeInterval delay = 2;

    // Settings at the begining of the session or when changed
    optional TelephonySettings settings = 3;

    // State at the beginning of the session or when changed
    optional TelephonyServiceState service_state = 4;

    // State at the beginning of the session or when changed
    optional ImsConnectionState ims_connection_state = 5;

    // Capabilities at the beginning of the session or when changed
    optional ImsCapabilities ims_capabilities = 6;

    // List of data calls at the beginning of the session or when changed
    repeated RilDataCall data_calls = 7;

    // New state
    optional PhoneState phone_state = 8;

    // New state
    optional CallState call_state = 9;

    // CS or IMS Voice call index
    optional int32 call_index = 10;

    // New merged call
    optional int32 merged_call_index = 11;

    // Active CS Voice calls
    repeated RilCall calls = 12;

    // RIL error code
    optional RilErrno error = 13;

    // RIL request
    optional RilRequest ril_request = 14;

    // Numeric ID
    optional int32 ril_request_id = 15;

    // New SRVCC state
    optional RilSrvccState srvcc_state = 16;

    // IMS command
    optional ImsCommand ims_command = 17;

    // IMS Failure reason
    optional ImsReasonInfo reason_info = 18;

    // Original access technology
    optional RadioAccessTechnology src_access_tech = 19;

    // New access technology
    optional RadioAccessTechnology target_access_tech = 20;

    // NITZ time in milliseconds
    optional int64 nitz_timestamp_millis = 21;
  }

  // Time when call has started, in minutes since epoch,
  // with 5 minutes precision
  optional int32 start_time_minutes = 1;

  // In Multi-SIM devices this indicates SIM slot
  optional int32 phone_id = 2;

  // List of events happened during the call
  repeated Event events = 3;

  // Indicating some call events are dropped
  optional bool events_dropped = 4;
}

message SmsSession {

  message Event {

    enum Type {

      // Unknown event
      EVENT_UNKNOWN = 0;

      // Telephony related user settings changed
      SETTINGS_CHANGED = 1;

      // Phone state changed
      RIL_SERVICE_STATE_CHANGED = 2;

      // IMS connected/disconnected
      IMS_CONNECTION_STATE_CHANGED = 3;

      // IMS Voice, Video and Ut capabilities changed
      IMS_CAPABILITIES_CHANGED = 4;

      // Notification that new data call has appeared in the list
      // or old data call has removed.
      DATA_CALL_LIST_CHANGED = 5;

      // Send a SMS message
      SMS_SEND = 6;

      // Message has been sent to network
      SMS_SEND_RESULT = 7;

      // Notification about received SMS
      SMS_RECEIVED = 8;
    }

    // Formats used to encode SMS messages
    enum Format {

      // State is unknown.
      SMS_FORMAT_UNKNOWN = 0;

      // GSM, WCDMA
      SMS_FORMAT_3GPP = 1;

      // CDMA
      SMS_FORMAT_3GPP2 = 2;
    }

    enum Tech {
      SMS_UNKNOWN = 0;

      SMS_GSM = 1;

      SMS_CDMA = 2;

      SMS_IMS = 3;
    }

    // Event type
    optional Type type = 1;

    // Time since previous event
    optional TimeInterval delay = 2;

    // Settings at the begining of the session or when changed
    optional TelephonySettings settings = 3;

    // State at the beginning of the session or when changed
    optional TelephonyServiceState service_state = 4;

    // State at the beginning of the session or when changed
    optional ImsConnectionState ims_connection_state = 5;

    // Capabilities at the beginning of the session or when changed
    optional ImsCapabilities ims_capabilities = 6;

    // List of data calls at the beginning of the session or when changed
    repeated RilDataCall data_calls = 7;

    // Format of the message
    optional Format format = 8;

    // Technology used to send/receive SMS
    optional Tech tech = 9;

    // See 3GPP 27.005, 3.2.5 for GSM/UMTS,
    // 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
    // -1 if unknown or not applicable
    optional int32 error_code = 10;

    // RIL error code
    optional RilErrno error = 11;

    // Numeric ID
    optional int32 ril_request_id = 12;
  }

  // Time when session has started, in minutes since epoch,
  // with 5 minutes precision
  optional int32 start_time_minutes = 1;

  // In Multi-SIM devices this indicates SIM slot
  optional int32 phone_id = 2;

  // List of events happened during the call
  repeated Event events = 3;

  // Indicating some sms session events are dropped
  optional bool events_dropped = 4;
}