carriersettings-extractor Update to 12

Import proto files from
tools/carrier_settings 0a2c3b9ec4337283b67391971613cd06690a2d34
packages/providers/TelephonyProvider e9b03419e34ed174e239453f958aac0f042bf072

Change-Id: Ied7c51623dc6d14352fbc30db4632311ba455a0e
This commit is contained in:
Luca Stefani 2022-01-10 19:57:11 +01:00 committed by Chirayu Desai
parent 2db4321c92
commit d7c19b9074
11 changed files with 602 additions and 1379 deletions

View File

@ -1,4 +1,4 @@
TARGETS := carriersettings_pb2.py carrierId_pb2.py
TARGETS := carrierId_pb2.py carrier_list_pb2.py carrier_settings_pb2.py
.PHONY: all clean
all: $(TARGETS)

View File

@ -1 +0,0 @@
../../../frameworks/opt/telephony/proto/src/carrierId.proto

View File

@ -0,0 +1,89 @@
//
// Copyright (C) 2019 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 carrierIdentification;
// A complete list of carriers
message CarrierList {
// A collection of carriers. one entry for one carrier.
repeated CarrierId carrier_id = 1;
// Version number of current carrier list
optional int32 version = 2;
};
// CarrierId is the unique representation of a carrier in CID table.
message CarrierId {
// [Optional] A unique canonical number designated to a carrier.
optional int32 canonical_id = 1;
// [Optional] A user-friendly carrier name (not localized).
optional string carrier_name = 2;
// [Optional] Carrier attributes to match a carrier. At least one value is required.
repeated CarrierAttribute carrier_attribute = 3;
// [Optional] A unique canonical number to represent its parent carrier. The parent-child
// relationship can be used to differentiate a single carrier by different networks,
// by prepaid v.s. postpaid or even by 4G v.s. 3G plan.
optional int32 parent_canonical_id = 4;
};
// Attributes used to match a carrier.
// For each field within this message:
// - if not set, the attribute is ignored;
// - if set, the device must have one of the specified values to match.
// Match is based on AND between any field that is set and OR for values within a repeated field.
message CarrierAttribute {
// [Optional] The MCC and MNC that map to this carrier. At least one value is required.
repeated string mccmnc_tuple = 1;
// [Optional] Prefix of IMSI (International Mobile Subscriber Identity) in
// decimal format. Some digits can be replaced with "x" symbols matching any digit.
// Sample values: 20404794, 21670xx2xxx.
repeated string imsi_prefix_xpattern = 2;
// [Optional] The Service Provider Name. Read from subscription EF_SPN.
// Sample values: C Spire, LeclercMobile
repeated string spn = 3;
// [Optional] PLMN network name. Read from subscription EF_PNN.
// Sample values:
repeated string plmn = 4;
// [Optional] Group Identifier Level1 for a GSM phone. Read from subscription EF_GID1.
// Sample values: 6D, BAE0000000000000
repeated string gid1 = 5;
// [Optional] Group Identifier Level2 for a GSM phone. Read from subscription EF_GID2.
// Sample values: 6D, BAE0000000000000
repeated string gid2 = 6;
// [Optional] The Access Point Name, corresponding to "apn" field returned by
// "content://telephony/carriers/preferapn" on device.
// Sample values: fast.t-mobile.com, internet
repeated string preferred_apn = 7;
// [Optional] Prefix of Integrated Circuit Card Identifier. Read from subscription EF_ICCID.
// Sample values: 894430, 894410
repeated string iccid_prefix = 8;
// [Optional] Carrier Privilege Access Rule in hex string.
// Sample values: 61ed377e85d386a8dfee6b864bd85b0bfaa5af88
repeated string privilege_access_rule = 9;
};

View File

@ -3,6 +3,7 @@
# source: carrierId.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
@ -13,204 +14,13 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='carrierId.proto',
package='carrierIdentification',
syntax='proto2',
serialized_options=b'\n\036com.android.internal.telephonyB\016CarrierIdProto',
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x0f\x63\x61rrierId.proto\x12\x15\x63\x61rrierIdentification\"T\n\x0b\x43\x61rrierList\x12\x34\n\ncarrier_id\x18\x01 \x03(\x0b\x32 .carrierIdentification.CarrierId\x12\x0f\n\x07version\x18\x02 \x01(\x05\"\x98\x01\n\tCarrierId\x12\x14\n\x0c\x63\x61nonical_id\x18\x01 \x01(\x05\x12\x14\n\x0c\x63\x61rrier_name\x18\x02 \x01(\t\x12\x42\n\x11\x63\x61rrier_attribute\x18\x03 \x03(\x0b\x32\'.carrierIdentification.CarrierAttribute\x12\x1b\n\x13parent_canonical_id\x18\x04 \x01(\x05\"\xc9\x01\n\x10\x43\x61rrierAttribute\x12\x14\n\x0cmccmnc_tuple\x18\x01 \x03(\t\x12\x1c\n\x14imsi_prefix_xpattern\x18\x02 \x03(\t\x12\x0b\n\x03spn\x18\x03 \x03(\t\x12\x0c\n\x04plmn\x18\x04 \x03(\t\x12\x0c\n\x04gid1\x18\x05 \x03(\t\x12\x0c\n\x04gid2\x18\x06 \x03(\t\x12\x15\n\rpreferred_apn\x18\x07 \x03(\t\x12\x14\n\x0ciccid_prefix\x18\x08 \x03(\t\x12\x1d\n\x15privilege_access_rule\x18\t \x03(\tB0\n\x1e\x63om.android.internal.telephonyB\x0e\x43\x61rrierIdProto'
)
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x63\x61rrierId.proto\x12\x15\x63\x61rrierIdentification\"T\n\x0b\x43\x61rrierList\x12\x34\n\ncarrier_id\x18\x01 \x03(\x0b\x32 .carrierIdentification.CarrierId\x12\x0f\n\x07version\x18\x02 \x01(\x05\"\x98\x01\n\tCarrierId\x12\x14\n\x0c\x63\x61nonical_id\x18\x01 \x01(\x05\x12\x14\n\x0c\x63\x61rrier_name\x18\x02 \x01(\t\x12\x42\n\x11\x63\x61rrier_attribute\x18\x03 \x03(\x0b\x32\'.carrierIdentification.CarrierAttribute\x12\x1b\n\x13parent_canonical_id\x18\x04 \x01(\x05\"\xc9\x01\n\x10\x43\x61rrierAttribute\x12\x14\n\x0cmccmnc_tuple\x18\x01 \x03(\t\x12\x1c\n\x14imsi_prefix_xpattern\x18\x02 \x03(\t\x12\x0b\n\x03spn\x18\x03 \x03(\t\x12\x0c\n\x04plmn\x18\x04 \x03(\t\x12\x0c\n\x04gid1\x18\x05 \x03(\t\x12\x0c\n\x04gid2\x18\x06 \x03(\t\x12\x15\n\rpreferred_apn\x18\x07 \x03(\t\x12\x14\n\x0ciccid_prefix\x18\x08 \x03(\t\x12\x1d\n\x15privilege_access_rule\x18\t \x03(\t')
_CARRIERLIST = _descriptor.Descriptor(
name='CarrierList',
full_name='carrierIdentification.CarrierList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='carrier_id', full_name='carrierIdentification.CarrierList.carrier_id', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='version', full_name='carrierIdentification.CarrierList.version', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=42,
serialized_end=126,
)
_CARRIERID = _descriptor.Descriptor(
name='CarrierId',
full_name='carrierIdentification.CarrierId',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='canonical_id', full_name='carrierIdentification.CarrierId.canonical_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='carrier_name', full_name='carrierIdentification.CarrierId.carrier_name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='carrier_attribute', full_name='carrierIdentification.CarrierId.carrier_attribute', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='parent_canonical_id', full_name='carrierIdentification.CarrierId.parent_canonical_id', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=129,
serialized_end=281,
)
_CARRIERATTRIBUTE = _descriptor.Descriptor(
name='CarrierAttribute',
full_name='carrierIdentification.CarrierAttribute',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='mccmnc_tuple', full_name='carrierIdentification.CarrierAttribute.mccmnc_tuple', index=0,
number=1, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='imsi_prefix_xpattern', full_name='carrierIdentification.CarrierAttribute.imsi_prefix_xpattern', index=1,
number=2, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='spn', full_name='carrierIdentification.CarrierAttribute.spn', index=2,
number=3, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='plmn', full_name='carrierIdentification.CarrierAttribute.plmn', index=3,
number=4, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gid1', full_name='carrierIdentification.CarrierAttribute.gid1', index=4,
number=5, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gid2', full_name='carrierIdentification.CarrierAttribute.gid2', index=5,
number=6, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='preferred_apn', full_name='carrierIdentification.CarrierAttribute.preferred_apn', index=6,
number=7, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='iccid_prefix', full_name='carrierIdentification.CarrierAttribute.iccid_prefix', index=7,
number=8, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='privilege_access_rule', full_name='carrierIdentification.CarrierAttribute.privilege_access_rule', index=8,
number=9, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=284,
serialized_end=485,
)
_CARRIERLIST.fields_by_name['carrier_id'].message_type = _CARRIERID
_CARRIERID.fields_by_name['carrier_attribute'].message_type = _CARRIERATTRIBUTE
DESCRIPTOR.message_types_by_name['CarrierList'] = _CARRIERLIST
DESCRIPTOR.message_types_by_name['CarrierId'] = _CARRIERID
DESCRIPTOR.message_types_by_name['CarrierAttribute'] = _CARRIERATTRIBUTE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_CARRIERLIST = DESCRIPTOR.message_types_by_name['CarrierList']
_CARRIERID = DESCRIPTOR.message_types_by_name['CarrierId']
_CARRIERATTRIBUTE = DESCRIPTOR.message_types_by_name['CarrierAttribute']
CarrierList = _reflection.GeneratedProtocolMessageType('CarrierList', (_message.Message,), {
'DESCRIPTOR' : _CARRIERLIST,
'__module__' : 'carrierId_pb2'
@ -232,6 +42,13 @@ CarrierAttribute = _reflection.GeneratedProtocolMessageType('CarrierAttribute',
})
_sym_db.RegisterMessage(CarrierAttribute)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._options = None
_CARRIERLIST._serialized_start=42
_CARRIERLIST._serialized_end=126
_CARRIERID._serialized_start=129
_CARRIERID._serialized_end=281
_CARRIERATTRIBUTE._serialized_start=284
_CARRIERATTRIBUTE._serialized_end=485
# @@protoc_insertion_point(module_scope)

View File

@ -1 +0,0 @@
../../../packages/providers/TelephonyProvider/assets/latest_carrier_id/carrier_list.pb

Binary file not shown.

View File

@ -0,0 +1,60 @@
/*
* Copyright (C) 2020 Google LLC
*
* 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 com.google.carrier;
// The carrier ID is matched against SIM data to determine carrier
message CarrierId {
// Mobile Country Code (MCC) & Mobile Network Code (MNC)
optional string mcc_mnc = 1;
// Additional data to identify MVNO
oneof mvno_data {
// SPN (Service Provider Name)
string spn = 2;
// IMSI prefix pattern
string imsi = 3;
// Group identifier (level 1) prefix
string gid1 = 4;
}
reserved 5;
}
// Maps CarrierIds to an internal unique carrier name
message CarrierMap {
// A unique canonical carrier name
// This name is the primary key to identify a carrier
// Typically a canonical_name looks like <carrier_name>_<iso_country_code>
optional string canonical_name = 1;
// A collection of network IDs owned by this carrier
repeated CarrierId carrier_id = 2;
reserved 3;
}
// Maps CarrierId to internal unique carrier name
message CarrierList {
// A collection of carrier maps; one entry for one carrier
repeated CarrierMap entry = 1;
// The version number of this CarrierList file
optional int64 version = 2;
}

View File

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: carrier_list.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x63\x61rrier_list.proto\x12\x12\x63om.google.carrier\"^\n\tCarrierId\x12\x0f\n\x07mcc_mnc\x18\x01 \x01(\t\x12\r\n\x03spn\x18\x02 \x01(\tH\x00\x12\x0e\n\x04imsi\x18\x03 \x01(\tH\x00\x12\x0e\n\x04gid1\x18\x04 \x01(\tH\x00\x42\x0b\n\tmvno_dataJ\x04\x08\x05\x10\x06\"]\n\nCarrierMap\x12\x16\n\x0e\x63\x61nonical_name\x18\x01 \x01(\t\x12\x31\n\ncarrier_id\x18\x02 \x03(\x0b\x32\x1d.com.google.carrier.CarrierIdJ\x04\x08\x03\x10\x04\"M\n\x0b\x43\x61rrierList\x12-\n\x05\x65ntry\x18\x01 \x03(\x0b\x32\x1e.com.google.carrier.CarrierMap\x12\x0f\n\x07version\x18\x02 \x01(\x03')
_CARRIERID = DESCRIPTOR.message_types_by_name['CarrierId']
_CARRIERMAP = DESCRIPTOR.message_types_by_name['CarrierMap']
_CARRIERLIST = DESCRIPTOR.message_types_by_name['CarrierList']
CarrierId = _reflection.GeneratedProtocolMessageType('CarrierId', (_message.Message,), {
'DESCRIPTOR' : _CARRIERID,
'__module__' : 'carrier_list_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierId)
})
_sym_db.RegisterMessage(CarrierId)
CarrierMap = _reflection.GeneratedProtocolMessageType('CarrierMap', (_message.Message,), {
'DESCRIPTOR' : _CARRIERMAP,
'__module__' : 'carrier_list_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierMap)
})
_sym_db.RegisterMessage(CarrierMap)
CarrierList = _reflection.GeneratedProtocolMessageType('CarrierList', (_message.Message,), {
'DESCRIPTOR' : _CARRIERLIST,
'__module__' : 'carrier_list_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierList)
})
_sym_db.RegisterMessage(CarrierList)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_CARRIERID._serialized_start=42
_CARRIERID._serialized_end=136
_CARRIERMAP._serialized_start=138
_CARRIERMAP._serialized_end=231
_CARRIERLIST._serialized_start=233
_CARRIERLIST._serialized_end=310
# @@protoc_insertion_point(module_scope)

View File

@ -0,0 +1,213 @@
/*
* Copyright (C) 2020 Google LLC
*
* 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 com.google.carrier;
// Settings of one carrier, including apns and configs
// This is the payload to be delivered from server
message CarrierSettings {
// A unique canonical carrier name
optional string canonical_name = 1;
// Version number of current carriers settings
optional int64 version = 2;
// Carrier APNs
optional CarrierApns apns = 3;
// Carrier configs
optional CarrierConfig configs = 4;
reserved 5;
// Vendor carrier configs
optional VendorConfigs vendor_configs = 6;
}
// A collection of multiple carriers settings
message MultiCarrierSettings {
// Version number
optional int64 version = 1;
// List of CarrierSettings
repeated CarrierSettings setting = 2;
}
// An access point name (aka. APN) entry
message ApnItem {
// The name of APN, map to xml apn "carrier" attribute
// eg. Verizon Internet, may visible to user in Settings
optional string name = 1;
// The value of APN, eg. send to modem for data call. map to xml
// "apn" attribute, eg. vzwinternet
optional string value = 2;
// Next two fields type and bearer_bitmask affect how APN is selected by
// platform. eg. type means APN capability and bearer_bitmask specifies
// which RATs apply.
// Note mcc/mnc and mvno data doesn't belong to this proto because they
// define a carrier.
// APN types as defined in Android code PhoneConstants.java
enum ApnType {
ALL = 0; // this APN can serve all kinds of data connections
DEFAULT = 1; // internet data
MMS = 2;
SUPL = 3;
DUN = 4;
HIPRI = 5;
FOTA = 6;
IMS = 7;
CBS = 8;
IA = 9; // Initial attach
EMERGENCY = 10;
XCAP = 11;
UT = 12;
RCS = 13;
}
repeated ApnType type = 3;
// Network types that this APN applies to, separated by "|". A network type
// is represented as an integer defined in TelephonyManager.NETWORK_TYPE_*.
// Default value "0" means all network types.
optional string bearer_bitmask = 4 [default = "0"];
// Below are all parameters for the APN
// APN server / auth parameters.
optional string server = 5;
optional string proxy = 6;
optional string port = 7;
optional string user = 8;
optional string password = 9;
optional int32 authtype = 10 [default = -1];
// MMS configuration.
optional string mmsc = 11;
optional string mmsc_proxy = 12;
optional string mmsc_proxy_port = 13;
// Protocols allowed to connect to the APN.
enum Protocol {
IP = 0;
IPV6 = 1;
IPV4V6 = 2;
PPP = 3;
}
optional Protocol protocol = 14 [default = IP];
optional Protocol roaming_protocol = 15 [default = IP];
// MTU for the connections.
optional int32 mtu = 16 [default = 0];
// An ID used to sync the APN in modem.
optional int32 profile_id = 17;
// Max connections.
optional int32 max_conns = 18 [default = 0];
// The wait time required between disconnecting and connecting, in seconds.
optional int32 wait_time = 19 [default = 0];
// The time to limit max connection, in seconds.
optional int32 max_conns_time = 20 [default = 0];
// VENDOR ADDED
optional bool carrier_enabled = 21;
// Whether to be persisted to modem.
optional bool modem_cognitive = 22 [default = false];
// Whether visible in APN settings.
optional bool user_visible = 23 [default = true];
// Whether editable in APN settings.
optional bool user_editable = 24 [default = true];
// If > 0: when an APN becomes a preferred APN on user/framework
// selection, other APNs with the same apn_set_id will also be preferred
// by framework when selecting APNs.
optional int32 apn_set_id = 25 [default = 0];
// The skip 464xlat flag. Flag works as follows.
// SKIP_464XLAT_DEFAULT: the APN will skip 464xlat only if the APN has type
// IMS and does not support INTERNET which has type
// DEFAULT or HIPRI.
// SKIP_464XLAT_DISABLE: the APN will NOT skip 464xlat
// SKIP_464XLAT_ENABLE: the APN will skip 464xlat
enum Xlat {
SKIP_464XLAT_DEFAULT = 0;
SKIP_464XLAT_DISABLE = 1;
SKIP_464XLAT_ENABLE = 2;
}
optional Xlat skip_464xlat = 26 [default = SKIP_464XLAT_DEFAULT];
}
// A collection of all APNs for a carrier
message CarrierApns {
reserved 1;
// APNs belong to this carrier
repeated ApnItem apn = 2;
}
// An array of text
message TextArray {
repeated string item = 1;
}
// An array of int
message IntArray {
repeated int32 item = 1;
}
// Carrier configs
message CarrierConfig {
reserved 1, 3;
// Key-Value pair as a config entry
message Config {
optional string key = 1;
oneof value {
string text_value = 2;
int32 int_value = 3;
int64 long_value = 4;
bool bool_value = 5;
TextArray text_array = 6;
IntArray int_array = 7;
}
}
// Key-value pairs, holding all config entries
repeated Config config = 2;
}
// The configs of one vendor client.
message VendorConfigClient {
// Name of the client for which the configuration items need to
// be stored
required string name = 1;
// Binary blob containing the configuration. The format
// of the configuration depends on the specific client.
// For some clients, the proto representation of {@link VendorConfigData}
// defined in vendorconfigdata.proto is used.
optional bytes value = 2;
// Range of extensions. The extensions from 100 to 1000 are reserved for
// Google's internal usage.
extensions 100 to 5000;
}
// A collection of configs from vendor clients.
message VendorConfigs {
reserved 1;
// Configuration
repeated VendorConfigClient client = 2;
}

View File

@ -0,0 +1,134 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: carrier_settings.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x63\x61rrier_settings.proto\x12\x12\x63om.google.carrier\"\xde\x01\n\x0f\x43\x61rrierSettings\x12\x16\n\x0e\x63\x61nonical_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12-\n\x04\x61pns\x18\x03 \x01(\x0b\x32\x1f.com.google.carrier.CarrierApns\x12\x32\n\x07\x63onfigs\x18\x04 \x01(\x0b\x32!.com.google.carrier.CarrierConfig\x12\x39\n\x0evendor_configs\x18\x06 \x01(\x0b\x32!.com.google.carrier.VendorConfigsJ\x04\x08\x05\x10\x06\"]\n\x14MultiCarrierSettings\x12\x0f\n\x07version\x18\x01 \x01(\x03\x12\x34\n\x07setting\x18\x02 \x03(\x0b\x32#.com.google.carrier.CarrierSettings\"\xf3\x07\n\x07\x41pnItem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x31\n\x04type\x18\x03 \x03(\x0e\x32#.com.google.carrier.ApnItem.ApnType\x12\x19\n\x0e\x62\x65\x61rer_bitmask\x18\x04 \x01(\t:\x01\x30\x12\x0e\n\x06server\x18\x05 \x01(\t\x12\r\n\x05proxy\x18\x06 \x01(\t\x12\x0c\n\x04port\x18\x07 \x01(\t\x12\x0c\n\x04user\x18\x08 \x01(\t\x12\x10\n\x08password\x18\t \x01(\t\x12\x14\n\x08\x61uthtype\x18\n \x01(\x05:\x02-1\x12\x0c\n\x04mmsc\x18\x0b \x01(\t\x12\x12\n\nmmsc_proxy\x18\x0c \x01(\t\x12\x17\n\x0fmmsc_proxy_port\x18\r \x01(\t\x12:\n\x08protocol\x18\x0e \x01(\x0e\x32$.com.google.carrier.ApnItem.Protocol:\x02IP\x12\x42\n\x10roaming_protocol\x18\x0f \x01(\x0e\x32$.com.google.carrier.ApnItem.Protocol:\x02IP\x12\x0e\n\x03mtu\x18\x10 \x01(\x05:\x01\x30\x12\x12\n\nprofile_id\x18\x11 \x01(\x05\x12\x14\n\tmax_conns\x18\x12 \x01(\x05:\x01\x30\x12\x14\n\twait_time\x18\x13 \x01(\x05:\x01\x30\x12\x19\n\x0emax_conns_time\x18\x14 \x01(\x05:\x01\x30\x12\x17\n\x0f\x63\x61rrier_enabled\x18\x15 \x01(\x08\x12\x1e\n\x0fmodem_cognitive\x18\x16 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0cuser_visible\x18\x17 \x01(\x08:\x04true\x12\x1b\n\ruser_editable\x18\x18 \x01(\x08:\x04true\x12\x15\n\napn_set_id\x18\x19 \x01(\x05:\x01\x30\x12L\n\x0cskip_464xlat\x18\x1a \x01(\x0e\x32 .com.google.carrier.ApnItem.Xlat:\x14SKIP_464XLAT_DEFAULT\"\x94\x01\n\x07\x41pnType\x12\x07\n\x03\x41LL\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x07\n\x03MMS\x10\x02\x12\x08\n\x04SUPL\x10\x03\x12\x07\n\x03\x44UN\x10\x04\x12\t\n\x05HIPRI\x10\x05\x12\x08\n\x04\x46OTA\x10\x06\x12\x07\n\x03IMS\x10\x07\x12\x07\n\x03\x43\x42S\x10\x08\x12\x06\n\x02IA\x10\t\x12\r\n\tEMERGENCY\x10\n\x12\x08\n\x04XCAP\x10\x0b\x12\x06\n\x02UT\x10\x0c\x12\x07\n\x03RCS\x10\r\"1\n\x08Protocol\x12\x06\n\x02IP\x10\x00\x12\x08\n\x04IPV6\x10\x01\x12\n\n\x06IPV4V6\x10\x02\x12\x07\n\x03PPP\x10\x03\"S\n\x04Xlat\x12\x18\n\x14SKIP_464XLAT_DEFAULT\x10\x00\x12\x18\n\x14SKIP_464XLAT_DISABLE\x10\x01\x12\x17\n\x13SKIP_464XLAT_ENABLE\x10\x02\"=\n\x0b\x43\x61rrierApns\x12(\n\x03\x61pn\x18\x02 \x03(\x0b\x32\x1b.com.google.carrier.ApnItemJ\x04\x08\x01\x10\x02\"\x19\n\tTextArray\x12\x0c\n\x04item\x18\x01 \x03(\t\"\x18\n\x08IntArray\x12\x0c\n\x04item\x18\x01 \x03(\x05\"\xb5\x02\n\rCarrierConfig\x12\x38\n\x06\x63onfig\x18\x02 \x03(\x0b\x32(.com.google.carrier.CarrierConfig.Config\x1a\xdd\x01\n\x06\x43onfig\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x14\n\ntext_value\x18\x02 \x01(\tH\x00\x12\x13\n\tint_value\x18\x03 \x01(\x05H\x00\x12\x14\n\nlong_value\x18\x04 \x01(\x03H\x00\x12\x14\n\nbool_value\x18\x05 \x01(\x08H\x00\x12\x33\n\ntext_array\x18\x06 \x01(\x0b\x32\x1d.com.google.carrier.TextArrayH\x00\x12\x31\n\tint_array\x18\x07 \x01(\x0b\x32\x1c.com.google.carrier.IntArrayH\x00\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02J\x04\x08\x03\x10\x04\"8\n\x12VendorConfigClient\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x01(\x0c*\x05\x08\x64\x10\x89\'\"M\n\rVendorConfigs\x12\x36\n\x06\x63lient\x18\x02 \x03(\x0b\x32&.com.google.carrier.VendorConfigClientJ\x04\x08\x01\x10\x02')
_CARRIERSETTINGS = DESCRIPTOR.message_types_by_name['CarrierSettings']
_MULTICARRIERSETTINGS = DESCRIPTOR.message_types_by_name['MultiCarrierSettings']
_APNITEM = DESCRIPTOR.message_types_by_name['ApnItem']
_CARRIERAPNS = DESCRIPTOR.message_types_by_name['CarrierApns']
_TEXTARRAY = DESCRIPTOR.message_types_by_name['TextArray']
_INTARRAY = DESCRIPTOR.message_types_by_name['IntArray']
_CARRIERCONFIG = DESCRIPTOR.message_types_by_name['CarrierConfig']
_CARRIERCONFIG_CONFIG = _CARRIERCONFIG.nested_types_by_name['Config']
_VENDORCONFIGCLIENT = DESCRIPTOR.message_types_by_name['VendorConfigClient']
_VENDORCONFIGS = DESCRIPTOR.message_types_by_name['VendorConfigs']
_APNITEM_APNTYPE = _APNITEM.enum_types_by_name['ApnType']
_APNITEM_PROTOCOL = _APNITEM.enum_types_by_name['Protocol']
_APNITEM_XLAT = _APNITEM.enum_types_by_name['Xlat']
CarrierSettings = _reflection.GeneratedProtocolMessageType('CarrierSettings', (_message.Message,), {
'DESCRIPTOR' : _CARRIERSETTINGS,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierSettings)
})
_sym_db.RegisterMessage(CarrierSettings)
MultiCarrierSettings = _reflection.GeneratedProtocolMessageType('MultiCarrierSettings', (_message.Message,), {
'DESCRIPTOR' : _MULTICARRIERSETTINGS,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.MultiCarrierSettings)
})
_sym_db.RegisterMessage(MultiCarrierSettings)
ApnItem = _reflection.GeneratedProtocolMessageType('ApnItem', (_message.Message,), {
'DESCRIPTOR' : _APNITEM,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.ApnItem)
})
_sym_db.RegisterMessage(ApnItem)
CarrierApns = _reflection.GeneratedProtocolMessageType('CarrierApns', (_message.Message,), {
'DESCRIPTOR' : _CARRIERAPNS,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierApns)
})
_sym_db.RegisterMessage(CarrierApns)
TextArray = _reflection.GeneratedProtocolMessageType('TextArray', (_message.Message,), {
'DESCRIPTOR' : _TEXTARRAY,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.TextArray)
})
_sym_db.RegisterMessage(TextArray)
IntArray = _reflection.GeneratedProtocolMessageType('IntArray', (_message.Message,), {
'DESCRIPTOR' : _INTARRAY,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.IntArray)
})
_sym_db.RegisterMessage(IntArray)
CarrierConfig = _reflection.GeneratedProtocolMessageType('CarrierConfig', (_message.Message,), {
'Config' : _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
'DESCRIPTOR' : _CARRIERCONFIG_CONFIG,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierConfig.Config)
})
,
'DESCRIPTOR' : _CARRIERCONFIG,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.CarrierConfig)
})
_sym_db.RegisterMessage(CarrierConfig)
_sym_db.RegisterMessage(CarrierConfig.Config)
VendorConfigClient = _reflection.GeneratedProtocolMessageType('VendorConfigClient', (_message.Message,), {
'DESCRIPTOR' : _VENDORCONFIGCLIENT,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.VendorConfigClient)
})
_sym_db.RegisterMessage(VendorConfigClient)
VendorConfigs = _reflection.GeneratedProtocolMessageType('VendorConfigs', (_message.Message,), {
'DESCRIPTOR' : _VENDORCONFIGS,
'__module__' : 'carrier_settings_pb2'
# @@protoc_insertion_point(class_scope:com.google.carrier.VendorConfigs)
})
_sym_db.RegisterMessage(VendorConfigs)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_CARRIERSETTINGS._serialized_start=47
_CARRIERSETTINGS._serialized_end=269
_MULTICARRIERSETTINGS._serialized_start=271
_MULTICARRIERSETTINGS._serialized_end=364
_APNITEM._serialized_start=367
_APNITEM._serialized_end=1378
_APNITEM_APNTYPE._serialized_start=1094
_APNITEM_APNTYPE._serialized_end=1242
_APNITEM_PROTOCOL._serialized_start=1244
_APNITEM_PROTOCOL._serialized_end=1293
_APNITEM_XLAT._serialized_start=1295
_APNITEM_XLAT._serialized_end=1378
_CARRIERAPNS._serialized_start=1380
_CARRIERAPNS._serialized_end=1441
_TEXTARRAY._serialized_start=1443
_TEXTARRAY._serialized_end=1468
_INTARRAY._serialized_start=1470
_INTARRAY._serialized_end=1494
_CARRIERCONFIG._serialized_start=1497
_CARRIERCONFIG._serialized_end=1806
_CARRIERCONFIG_CONFIG._serialized_start=1573
_CARRIERCONFIG_CONFIG._serialized_end=1794
_VENDORCONFIGCLIENT._serialized_start=1808
_VENDORCONFIGCLIENT._serialized_end=1864
_VENDORCONFIGS._serialized_start=1866
_VENDORCONFIGS._serialized_end=1943
# @@protoc_insertion_point(module_scope)

View File

@ -1,125 +0,0 @@
// For the HasField method, use proto2. proto3 does not distinguish between
// fields that are not set and fields that are set to default values, e.g.,
// authtype: 0.
syntax = "proto2";
message CarrierList {
message CarrierMap {
// canonicalName is not unique in CarrierList, e.g., the same settings
// may apply to multiple MCCMNCs or MVNOs. Use this field as the lookup
// key in CarrierSettings.
required string canonicalName = 1;
message CarrierId {
required string mccMnc = 1;
oneof mvno {
string spn = 2;
string imsi = 3;
string gid1 = 4;
string gid2 = 5; // deprecated
}
}
required CarrierId carrierId = 2;
}
repeated CarrierMap entry = 1;
required int64 version = 2;
}
message CarrierSettings {
required string canonicalName = 1; // unique key
optional int64 version = 2;
message CarrierApns {
message ApnItem {
optional string name = 1;
required string value = 2;
enum ApnType {
ALL = 0;
DEFAULT = 1;
MMS = 2;
SUPL = 3;
DUN = 4;
HIPRI = 5;
FOTA = 6;
IMS = 7;
CBS = 8;
IA = 9;
EMERGENCY = 10;
XCAP = 11;
UT = 12;
}
repeated ApnType type = 3;
optional string bearerBitmask = 4;
optional string server = 5;
optional string proxy = 6;
optional string port = 7;
optional string user = 8;
optional string password = 9;
optional int32 authtype = 10;
optional string mmsc = 11;
optional string mmscProxy = 12;
optional string mmscProxyPort = 13;
enum Protocol {
IP = 0;
IPV6 = 1;
IPV4V6 = 2;
PPP = 3;
}
optional Protocol protocol = 14;
optional Protocol roamingProtocol = 15;
optional int32 mtu = 16;
optional int32 profileId = 17;
optional int32 maxConns = 18;
optional int32 waitTime = 19; // unused
optional int32 maxConnsTime = 20;
optional bool carrierEnabled = 21;
optional bool modemCognitive = 22;
optional bool userVisible = 23;
optional bool userEditable = 24;
optional int32 apnSetId = 25; // unused
enum Xlat {
SKIP_464XLAT_DEFAULT = 0;
SKIP_464XLAT_DISABLE = 1;
SKIP_464XLAT_ENABLE = 2;
}
optional Xlat skip464Xlat = 26; // unused
}
repeated ApnItem apn = 2;
}
optional CarrierApns apns = 3;
message CarrierConfig {
message Config {
required string key = 1;
message TextArray {
repeated string item = 1;
}
message IntArray {
repeated int32 item = 1;
}
oneof value {
string textValue = 2;
int32 intValue = 3;
int64 longValue = 4;
bool boolValue = 5;
TextArray textArray = 6;
IntArray intArray = 7;
}
}
repeated Config config = 2;
}
optional CarrierConfig configs = 4;
message VendorConfigs {
message VendorConfigClient {
required string name = 1;
required bytes value = 2;
}
repeated VendorConfigClient client = 2;
}
optional VendorConfigs vendorConfigs = 5;
}
message MultiCarrierSettings {
required int64 version = 1;
repeated CarrierSettings setting = 2;
}

View File

@ -9,8 +9,8 @@ import sys
from xml.etree import ElementTree as ET
from xml.sax.saxutils import escape, quoteattr
from carriersettings_pb2 import CarrierList, CarrierSettings, \
MultiCarrierSettings
from carrier_settings_pb2 import CarrierSettings, MultiCarrierSettings
from carrier_list_pb2 import CarrierList
from carrierId_pb2 import CarrierList as CarrierIdList
@ -76,7 +76,7 @@ def main():
(s.lower() for s in getattr(carrier_attribute, i) or [''])
for i in [
'mccmnc_tuple', 'imsi_prefix_xpattern', 'spn', 'plmn',
'gid1', 'gid2', 'preferred_apn', 'iccid_prefix',
'gid1', 'preferred_apn', 'iccid_prefix',
'privilege_access_rule',
]
)):
@ -93,13 +93,13 @@ def main():
settings = MultiCarrierSettings()
settings.ParseFromString(pb.read())
for setting in settings.setting:
assert setting.canonicalName not in all_settings
all_settings[setting.canonicalName] = setting
assert setting.canonical_name not in all_settings
all_settings[setting.canonical_name] = setting
else:
setting = CarrierSettings()
setting.ParseFromString(pb.read())
assert setting.canonicalName not in all_settings
all_settings[setting.canonicalName] = setting
assert setting.canonical_name not in all_settings
all_settings[setting.canonical_name] = setting
carrier_config_root = ET.Element('carrier_config_list')
@ -145,12 +145,11 @@ def main():
self.add_attribute(
'carrier_id',
value=str(carrier_attribute_map[(
self.carrier_id.mccMnc,
self.carrier_id.mcc_mnc,
self.carrier_id.imsi,
self.carrier_id.spn.lower(),
'',
self.carrier_id.gid1.lower(),
self.carrier_id.gid2.lower(),
'',
'',
'',
@ -158,14 +157,14 @@ def main():
)
except KeyError:
pass
self.add_attribute('mcc', value=self.carrier_id.mccMnc[:3])
self.add_attribute('mnc', value=self.carrier_id.mccMnc[3:])
self.add_attribute('mcc', value=self.carrier_id.mcc_mnc[:3])
self.add_attribute('mnc', value=self.carrier_id.mcc_mnc[3:])
self.add_attribute('apn', 'value')
self.add_attribute('proxy')
self.add_attribute('port')
self.add_attribute('mmsc')
self.add_attribute('mmsproxy', 'mmscProxy')
self.add_attribute('mmsport', 'mmscProxyPort')
self.add_attribute('mmsproxy', 'mmsc_proxy')
self.add_attribute('mmsport', 'mmsc_proxy_port')
self.add_attribute('user')
self.add_attribute('password')
self.add_attribute('server')
@ -180,16 +179,16 @@ def main():
).lower(),
)
self.add_attribute('protocol')
self.add_attribute('roaming_protocol', 'roamingProtocol')
self.add_attribute('carrier_enabled', 'carrierEnabled')
self.add_attribute('bearer_bitmask', 'bearerBitmask')
self.add_attribute('profile_id', 'profileId')
self.add_attribute('modem_cognitive', 'modemCognitive')
self.add_attribute('max_conns', 'maxConns')
self.add_attribute('wait_time', 'waitTime')
self.add_attribute('max_conns_time', 'maxConnsTime')
self.add_attribute('roaming_protocol')
self.add_attribute('carrier_enabled')
self.add_attribute('bearer_bitmask')
self.add_attribute('profile_id')
self.add_attribute('modem_cognitive')
self.add_attribute('max_conns')
self.add_attribute('wait_time')
self.add_attribute('max_conns_time')
self.add_attribute('mtu')
mvno = self.carrier_id.WhichOneof('mvno')
mvno = self.carrier_id.WhichOneof('mvno_data')
if mvno:
self.add_attribute(
'mvno_type',
@ -199,21 +198,21 @@ def main():
'mvno_match_data',
value=getattr(self.carrier_id, mvno),
)
self.add_attribute('apn_set_id', 'apnSetId')
self.add_attribute('apn_set_id')
# No source for integer carrier_id?
self.add_attribute('skip_464xlat', 'skip464Xlat')
self.add_attribute('user_visible', 'userVisible')
self.add_attribute('user_editable', 'userEditable')
self.add_attribute('skip_464xlat')
self.add_attribute('user_visible')
self.add_attribute('user_editable')
with open(os.path.join(apns_folder, 'apns-conf.xml'), 'w', encoding='utf-8') as f:
f.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n')
f.write('<apns version="8">\n\n')
for entry in carrier_list.entry:
setting = all_settings[entry.canonicalName]
setting = all_settings[entry.canonical_name]
for apn in setting.apns.apn:
f.write(' <apn carrier={}\n'.format(quoteattr(apn.name)))
apn_element = ApnElement(apn, entry.carrierId)
apn_element = ApnElement(apn, entry.carrier_id[0])
for (key, value) in apn_element.attributes.items():
f.write(' {}={}\n'.format(escape(key), quoteattr(value)))
f.write(' />\n\n')
@ -222,26 +221,26 @@ def main():
carrier_config_root,
'carrier_config',
)
carrier_config_element.set('mcc', entry.carrierId.mccMnc[:3])
carrier_config_element.set('mnc', entry.carrierId.mccMnc[3:])
for field in ['spn', 'imsi', 'gid1', 'gid2']:
if entry.carrierId.HasField(field):
carrier_config_element.set('mcc', entry.carrier_id[0].mcc_mnc[:3])
carrier_config_element.set('mnc', entry.carrier_id[0].mcc_mnc[3:])
for field in ['spn', 'imsi', 'gid1']:
if entry.carrier_id[0].HasField(field):
carrier_config_element.set(
field,
getattr(entry.carrierId, field),
getattr(entry.carrier_id[0], field),
)
for config in setting.configs.config:
if config.key in unwanted_configs:
continue
value_type = config.WhichOneof('value')
if value_type == 'textValue':
if value_type == 'text_value':
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'string',
)
carrier_config_subelement.set('name', config.key)
carrier_config_subelement.text = getattr(config, value_type)
elif value_type == 'intValue':
elif value_type == 'int_value':
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'int',
@ -251,7 +250,7 @@ def main():
'value',
str(getattr(config, value_type)),
)
elif value_type == 'longValue':
elif value_type == 'long_value':
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'long',
@ -261,7 +260,7 @@ def main():
'value',
str(getattr(config, value_type)),
)
elif value_type == 'boolValue':
elif value_type == "bool_value":
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'boolean',
@ -271,7 +270,7 @@ def main():
'value',
str(getattr(config, value_type)).lower(),
)
elif value_type == 'textArray':
elif value_type == 'text_array':
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'string-array',
@ -287,7 +286,7 @@ def main():
'item',
)
carrier_config_item.set('value', value)
elif value_type == 'intArray':
elif value_type == 'int_array':
carrier_config_subelement = ET.SubElement(
carrier_config_element,
'int-array',

File diff suppressed because it is too large Load Diff