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

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

Issue 535283002: Translate activation/romaing state, restricted pool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_279351_internet_options_7b
Patch Set: Only set RestrictedConnectivity if true, fix tests Created 6 years, 3 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_translator_shill_to_onc.cc
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index 3abb44375c531743470b227a757659f8c48be251..168f0b14597c546d847a2d6b4000dc03efde43b1 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -315,6 +315,12 @@ void ShillToONCTranslator::TranslateWiFiWithState() {
void ShillToONCTranslator::TranslateCellularWithState() {
CopyPropertiesAccordingToSignature();
+ TranslateWithTableAndSet(shill::kActivationStateProperty,
+ kActivationStateTable,
+ ::onc::cellular::kActivationState);
+ TranslateWithTableAndSet(shill::kRoamingStateProperty,
+ kRoamingStateTable,
+ ::onc::cellular::kRoamingState);
const base::DictionaryValue* dictionary = NULL;
if (shill_dictionary_->GetDictionaryWithoutPathExpansion(
shill::kServingOperatorProperty, &dictionary)) {
@@ -402,6 +408,11 @@ void ShillToONCTranslator::TranslateNetworkWithState() {
}
onc_object_->SetStringWithoutPathExpansion(
::onc::network_config::kConnectionState, onc_state);
+ // Only set 'RestrictedConnectivity' if true.
+ if (state == shill::kStatePortal) {
+ onc_object_->SetBooleanWithoutPathExpansion(
+ ::onc::network_config::kRestrictedConnectivity, true);
+ }
}
// Use a human-readable aa:bb format for any hardware MAC address. Note:
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.cc ('k') | chromeos/test/data/network/shill_cellular_with_state.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698