xref: /aosp_15_r20/tools/carrier_settings/proto/carrier_settings.proto (revision ff35212d322a3e892605b94fa777c67085d45efd)
1*ff35212dScey/*
2*ff35212dScey * Copyright (C) 2020 Google LLC
3*ff35212dScey *
4*ff35212dScey * Licensed under the Apache License, Version 2.0 (the "License");
5*ff35212dScey * you may not use this file except in compliance with the License.
6*ff35212dScey * You may obtain a copy of the License at
7*ff35212dScey *
8*ff35212dScey *      http://www.apache.org/licenses/LICENSE-2.0
9*ff35212dScey *
10*ff35212dScey * Unless required by applicable law or agreed to in writing, software
11*ff35212dScey * distributed under the License is distributed on an "AS IS" BASIS,
12*ff35212dScey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*ff35212dScey * See the License for the specific language governing permissions and
14*ff35212dScey * limitations under the License.
15*ff35212dScey */
16*ff35212dSceysyntax = "proto2";
17*ff35212dScey
18*ff35212dSceypackage com.google.carrier;
19*ff35212dScey
20*ff35212dSceyoption java_multiple_files = true;
21*ff35212dSceyoption java_outer_classname = "CarrierSettingsProtos";
22*ff35212dScey
23*ff35212dScey// Settings of one carrier, including apns and configs
24*ff35212dScey// This is the payload to be delivered from server
25*ff35212dSceymessage CarrierSettings {
26*ff35212dScey  // A unique canonical carrier name
27*ff35212dScey  optional string canonical_name = 1;
28*ff35212dScey
29*ff35212dScey  // Version number of current carrier’s settings
30*ff35212dScey  optional int64 version = 2;
31*ff35212dScey
32*ff35212dScey  // Carrier APNs
33*ff35212dScey  optional CarrierApns apns = 3;
34*ff35212dScey
35*ff35212dScey  // Carrier configs
36*ff35212dScey  optional CarrierConfig configs = 4;
37*ff35212dScey
38*ff35212dScey  reserved 5;
39*ff35212dScey
40*ff35212dScey  // Vendor carrier configs
41*ff35212dScey  optional VendorConfigs vendor_configs = 6;
42*ff35212dScey}
43*ff35212dScey
44*ff35212dScey// A collection of multiple carriers’ settings
45*ff35212dSceymessage MultiCarrierSettings {
46*ff35212dScey  // Version number
47*ff35212dScey  optional int64 version = 1;
48*ff35212dScey
49*ff35212dScey  // List of CarrierSettings
50*ff35212dScey  repeated CarrierSettings setting = 2;
51*ff35212dScey}
52*ff35212dScey
53*ff35212dScey// An access point name (aka. APN) entry
54*ff35212dSceymessage ApnItem {
55*ff35212dScey  // The name of APN, map to xml apn "carrier" attribute
56*ff35212dScey  // eg. Verizon Internet, may visible to user in Settings
57*ff35212dScey  optional string name = 1;
58*ff35212dScey  // The value of APN, eg. send to modem for data call. map to xml
59*ff35212dScey  // "apn" attribute, eg. vzwinternet
60*ff35212dScey  optional string value = 2;
61*ff35212dScey
62*ff35212dScey  // Next two fields type and bearer_bitmask affect how APN is selected by
63*ff35212dScey  // platform. eg. type means APN capability and bearer_bitmask specifies
64*ff35212dScey  // which RATs apply.
65*ff35212dScey  // Note mcc/mnc and mvno data doesn't belong to this proto because they
66*ff35212dScey  // define a carrier.
67*ff35212dScey  // APN types as defined in Android code PhoneConstants.java
68*ff35212dScey  enum ApnType {
69*ff35212dScey    ALL = 0;      // this APN can serve all kinds of data connections
70*ff35212dScey    DEFAULT = 1;  // internet data
71*ff35212dScey    MMS = 2;
72*ff35212dScey    SUPL = 3;
73*ff35212dScey    DUN = 4;
74*ff35212dScey    HIPRI = 5;
75*ff35212dScey    FOTA = 6;
76*ff35212dScey    IMS = 7;
77*ff35212dScey    CBS = 8;
78*ff35212dScey    IA = 9;  // Initial attach
79*ff35212dScey    EMERGENCY = 10;
80*ff35212dScey    XCAP = 11;
81*ff35212dScey    UT = 12;
82*ff35212dScey    RCS = 13;
83*ff35212dScey  }
84*ff35212dScey  repeated ApnType type = 3;
85*ff35212dScey
86*ff35212dScey  // Network types that this APN applies to, separated by "|". A network type
87*ff35212dScey  // is represented as an integer defined in TelephonyManager.NETWORK_TYPE_*.
88*ff35212dScey  // Default value "0" means all network types.
89*ff35212dScey  optional string bearer_bitmask = 4 [default = "0"];
90*ff35212dScey
91*ff35212dScey  // Below are all parameters for the APN
92*ff35212dScey  // APN server / auth parameters.
93*ff35212dScey  optional string server = 5;
94*ff35212dScey  optional string proxy = 6;
95*ff35212dScey  optional string port = 7;
96*ff35212dScey  optional string user = 8;
97*ff35212dScey  optional string password = 9;
98*ff35212dScey  optional int32 authtype = 10 [default = -1];
99*ff35212dScey
100*ff35212dScey  // MMS configuration.
101*ff35212dScey  optional string mmsc = 11;
102*ff35212dScey  optional string mmsc_proxy = 12;
103*ff35212dScey  optional string mmsc_proxy_port = 13;
104*ff35212dScey
105*ff35212dScey  // Protocols allowed to connect to the APN.
106*ff35212dScey  enum Protocol {
107*ff35212dScey    IP = 0;
108*ff35212dScey    IPV6 = 1;
109*ff35212dScey    IPV4V6 = 2;
110*ff35212dScey    PPP = 3;
111*ff35212dScey  }
112*ff35212dScey  optional Protocol protocol = 14 [default = IP];
113*ff35212dScey  optional Protocol roaming_protocol = 15 [default = IP];
114*ff35212dScey
115*ff35212dScey  // MTU for the connections.
116*ff35212dScey  optional int32 mtu = 16 [default = 0];
117*ff35212dScey  // An ID used to sync the APN in modem.
118*ff35212dScey  optional int32 profile_id = 17;
119*ff35212dScey  // Max connections.
120*ff35212dScey  optional int32 max_conns = 18 [default = 0];
121*ff35212dScey  // The wait time required between disconnecting and connecting, in seconds.
122*ff35212dScey  optional int32 wait_time = 19 [default = 0];
123*ff35212dScey  // The time to limit max connection, in seconds.
124*ff35212dScey  optional int32 max_conns_time = 20 [default = 0];
125*ff35212dScey  reserved 21;
126*ff35212dScey  // Whether to be persisted to modem.
127*ff35212dScey  optional bool modem_cognitive = 22 [default = false];
128*ff35212dScey  // Whether visible in APN settings.
129*ff35212dScey  optional bool user_visible = 23 [default = true];
130*ff35212dScey  // Whether editable in APN settings.
131*ff35212dScey  optional bool user_editable = 24 [default = true];
132*ff35212dScey
133*ff35212dScey  // If > 0: when an APN becomes a preferred APN on user/framework
134*ff35212dScey  // selection, other APNs with the same apn_set_id will also be preferred
135*ff35212dScey  // by framework when selecting APNs.
136*ff35212dScey  optional int32 apn_set_id = 25 [default = 0];
137*ff35212dScey
138*ff35212dScey  // The skip 464xlat flag. Flag works as follows.
139*ff35212dScey  // SKIP_464XLAT_DEFAULT: the APN will skip 464xlat only if the APN has type
140*ff35212dScey  //                       IMS and does not support INTERNET which has type
141*ff35212dScey  //                       DEFAULT or HIPRI.
142*ff35212dScey  // SKIP_464XLAT_DISABLE: the APN will NOT skip 464xlat
143*ff35212dScey  // SKIP_464XLAT_ENABLE: the APN will skip 464xlat
144*ff35212dScey  enum Xlat {
145*ff35212dScey    SKIP_464XLAT_DEFAULT = 0;
146*ff35212dScey    SKIP_464XLAT_DISABLE = 1;
147*ff35212dScey    SKIP_464XLAT_ENABLE = 2;
148*ff35212dScey  }
149*ff35212dScey  optional Xlat skip_464xlat = 26 [default = SKIP_464XLAT_DEFAULT];
150*ff35212dScey}
151*ff35212dScey
152*ff35212dScey// A collection of all APNs for a carrier
153*ff35212dSceymessage CarrierApns {
154*ff35212dScey  reserved 1;
155*ff35212dScey
156*ff35212dScey  // APNs belong to this carrier
157*ff35212dScey  repeated ApnItem apn = 2;
158*ff35212dScey}
159*ff35212dScey
160*ff35212dScey// An array of text
161*ff35212dSceymessage TextArray {
162*ff35212dScey  repeated string item = 1;
163*ff35212dScey}
164*ff35212dScey
165*ff35212dScey// An array of int
166*ff35212dSceymessage IntArray {
167*ff35212dScey  repeated int32 item = 1;
168*ff35212dScey}
169*ff35212dScey
170*ff35212dScey// Carrier configs
171*ff35212dSceymessage CarrierConfig {
172*ff35212dScey  reserved 1, 3;
173*ff35212dScey
174*ff35212dScey  // Key-Value pair as a config entry
175*ff35212dScey  message Config {
176*ff35212dScey    optional string key = 1;
177*ff35212dScey
178*ff35212dScey    oneof value {
179*ff35212dScey      string text_value = 2;
180*ff35212dScey      int32 int_value = 3;
181*ff35212dScey      int64 long_value = 4;
182*ff35212dScey      bool bool_value = 5;
183*ff35212dScey      TextArray text_array = 6;
184*ff35212dScey      IntArray int_array = 7;
185*ff35212dScey      CarrierConfig bundle = 8;
186*ff35212dScey      double double_value = 9;
187*ff35212dScey    }
188*ff35212dScey  }
189*ff35212dScey
190*ff35212dScey  // Key-value pairs, holding all config entries
191*ff35212dScey  repeated Config config = 2;
192*ff35212dScey}
193*ff35212dScey
194*ff35212dScey// The configs of one vendor client.
195*ff35212dSceymessage VendorConfigClient {
196*ff35212dScey  // Name of the client for which the configuration items need to
197*ff35212dScey  // be stored
198*ff35212dScey  required string name = 1;
199*ff35212dScey
200*ff35212dScey  // Binary blob containing the configuration. The format
201*ff35212dScey  // of the configuration depends on the specific client.
202*ff35212dScey  // For some clients, the proto representation of {@link VendorConfigData}
203*ff35212dScey  // defined in vendorconfigdata.proto is used.
204*ff35212dScey  optional bytes value = 2;
205*ff35212dScey
206*ff35212dScey  // Range of extensions. The extensions from 100 to 1000 are reserved for
207*ff35212dScey  // Google's internal usage.
208*ff35212dScey  extensions 100 to 5000;
209*ff35212dScey}
210*ff35212dScey
211*ff35212dScey// A collection of configs from vendor clients.
212*ff35212dSceymessage VendorConfigs {
213*ff35212dScey  reserved 1;
214*ff35212dScey
215*ff35212dScey  // Configuration
216*ff35212dScey  repeated VendorConfigClient client = 2;
217*ff35212dScey}
218