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

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 signature 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..3e26fa36732373bb437c3a6e2b86598028c50a6d 100644
--- a/chromeos/network/onc/onc_translation_tables.cc
+++ b/chromeos/network/onc/onc_translation_tables.cc
@@ -130,8 +130,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 +145,35 @@ 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[] = {
+ { ::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},
+ // 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 },
@@ -186,8 +220,10 @@ const OncValueTranslationEntry onc_value_translation_table[] = {
{ &kWiFiWithStateSignature, wifi_fields },
{ &kCellularApnSignature, cellular_apn_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 +291,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