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