Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: chromeos/network/onc/onc_translation_tables.cc

Issue 402953004: Correctly translate Cellular Device properties to ONC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix APNList and FoundNetworks Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/onc/onc_translation_tables.cc
diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc
index 81812164fe04c1f2530c25a78ede8cdd2bcee0b3..9b8709fbc01d83a7ecc89295008024bdda960074 100644
--- a/chromeos/network/onc/onc_translation_tables.cc
+++ b/chromeos/network/onc/onc_translation_tables.cc
@@ -119,9 +119,20 @@ const FieldTranslationEntry wifi_fields[] = {
{NULL}};
const FieldTranslationEntry cellular_apn_fields[] = {
+ { ::onc::cellular_apn::kApn, shill::kApnProperty},
{ ::onc::cellular_apn::kName, shill::kApnProperty},
{ ::onc::cellular_apn::kUsername, shill::kApnUsernameProperty},
{ ::onc::cellular_apn::kPassword, shill::kApnPasswordProperty},
+ { ::onc::cellular_apn::kLocalizedName, shill::kApnLocalizedNameProperty},
+ { ::onc::cellular_apn::kLanguage, shill::kApnLanguageProperty},
+ {NULL}};
+
+const FieldTranslationEntry cellular_found_network_fields[] = {
+ { ::onc::cellular_found_network::kNetworkId, shill::kNetworkIdProperty},
+ { ::onc::cellular_found_network::kStatus, shill::kStatusProperty},
+ { ::onc::cellular_found_network::kTechnology, shill::kTechnologyProperty},
+ { ::onc::cellular_found_network::kShortName, shill::kShortNameProperty},
+ { ::onc::cellular_found_network::kLongName, shill::kLongNameProperty},
{NULL}};
const FieldTranslationEntry cellular_provider_fields[] = {
@@ -130,8 +141,13 @@ const FieldTranslationEntry cellular_provider_fields[] = {
{ ::onc::cellular_provider::kName, shill::kOperatorNameKey},
{NULL}};
+const FieldTranslationEntry sim_lock_status_fields[] = {
+ { ::onc::sim_lock_status::kLockEnabled, shill::kSIMLockEnabledProperty},
+ { ::onc::sim_lock_status::kLockType, shill::kSIMLockTypeProperty},
+ { ::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty},
+ {NULL}};
+
// This must only contain Service properties and not Device properties.
-// For Device properties see kCellularDeviceTable.
const FieldTranslationEntry cellular_fields[] = {
{ ::onc::cellular::kActivateOverNonCellularNetwork,
shill::kActivateOverNonCellularNetworkProperty},
@@ -140,6 +156,38 @@ const FieldTranslationEntry cellular_fields[] = {
{ ::onc::cellular::kRoamingState, shill::kRoamingStateProperty},
{NULL}};
+// This must contain only Shill Device properties and no Service properties.
+const FieldTranslationEntry cellular_device_fields[] = {
+ // This field is converted during translation, see onc_translator_*.
+ // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty},
+ { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty},
+ { ::onc::cellular::kCarrier, shill::kCarrierProperty},
+ { ::onc::cellular::kESN, shill::kEsnProperty},
+ { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty},
+ { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty},
+ // This field is converted during translation, see onc_translator_*.
+ // { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty},
+ { ::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty},
+ { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty},
+ { ::onc::cellular::kICCID, shill::kIccidProperty},
+ { ::onc::cellular::kIMEI, shill::kImeiProperty},
+ { ::onc::cellular::kIMSI, shill::kImsiProperty},
+ { ::onc::cellular::kManufacturer, shill::kManufacturerProperty},
+ { ::onc::cellular::kMDN, shill::kMdnProperty},
+ { ::onc::cellular::kMEID, shill::kMeidProperty},
+ { ::onc::cellular::kMIN, shill::kMinProperty},
+ { ::onc::cellular::kModelID, shill::kModelIDProperty},
+ { ::onc::cellular::kPRLVersion, shill::kPRLVersionProperty},
+ { ::onc::cellular::kProviderRequiresRoaming,
+ shill::kProviderRequiresRoamingProperty},
+ { ::onc::cellular::kSelectedNetwork, shill::kSelectedNetworkProperty},
+ // This field is converted during translation, see onc_translator_*.
+ // { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty},
+ { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty},
+ { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty},
+ { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty},
+ {NULL}};
+
const FieldTranslationEntry network_fields[] = {
{ ::onc::network_config::kGUID, shill::kGuidProperty},
{ ::onc::network_config::kConnectable, shill::kConnectableProperty },
@@ -185,9 +233,12 @@ const OncValueTranslationEntry onc_value_translation_table[] = {
{ &kWiFiSignature, wifi_fields },
{ &kWiFiWithStateSignature, wifi_fields },
{ &kCellularApnSignature, cellular_apn_fields },
+ { &kCellularFoundNetworkSignature, cellular_found_network_fields },
{ &kCellularProviderSignature, cellular_provider_fields },
+ { &kSIMLockStatusSignature, sim_lock_status_fields },
{ &kCellularSignature, cellular_fields },
{ &kCellularWithStateSignature, cellular_fields },
+ { &kCellularDeviceSignature, cellular_device_fields },
{ &kNetworkWithStateSignature, network_fields },
{ &kNetworkConfigurationSignature, network_fields },
{ &kIPConfigSignature, ipconfig_fields },
@@ -255,37 +306,6 @@ const StringTranslationEntry kEAP_TTLS_InnerTable[] = {
{ ::onc::eap::kPAP, shill::kEapPhase2AuthTTLSPAP},
{NULL}};
-// This must contain only Shill Device properties and no Service properties.
-// For Service properties see cellular_fields.
-const FieldTranslationEntry kCellularDeviceTable[] = {
- { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty},
- { ::onc::cellular::kCarrier, shill::kCarrierProperty},
- { ::onc::cellular::kESN, shill::kEsnProperty},
- { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty},
- { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty},
- { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty},
- { ::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty},
- { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty},
- { ::onc::cellular::kICCID, shill::kIccidProperty},
- { ::onc::cellular::kIMEI, shill::kImeiProperty},
- { ::onc::cellular::kIMSI, shill::kImsiProperty},
- { ::onc::cellular::kManufacturer, shill::kManufacturerProperty},
- { ::onc::cellular::kMDN, shill::kMdnProperty},
- { ::onc::cellular::kMEID, shill::kMeidProperty},
- { ::onc::cellular::kMIN, shill::kMinProperty},
- { ::onc::cellular::kModelID, shill::kModelIDProperty},
- { ::onc::cellular::kPRLVersion, shill::kPRLVersionProperty},
- { ::onc::cellular::kProviderRequiresRoaming,
- shill::kProviderRequiresRoamingProperty},
- { ::onc::cellular::kSelectedNetwork, shill::kSelectedNetworkProperty},
- { ::onc::cellular::kSIMLockEnabled, shill::kSIMLockEnabledProperty},
- { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty},
- { ::onc::cellular::kSIMLockType, shill::kSIMLockTypeProperty},
- { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty},
- { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty},
- { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty},
- {NULL}};
-
const FieldTranslationEntry* GetFieldTranslationTable(
const OncValueSignature& onc_signature) {
for (const OncValueTranslationEntry* it = onc_value_translation_table;

Powered by Google App Engine
This is Rietveld 408576698