Commit 230f2526 authored by mnissler@chromium.org's avatar mnissler@chromium.org

Fix always-in-roaming reset loop for cellular connections on Chromium OS.

Chrome would not incorrectly switch the roaming setting back and forth
when the cellular connection is marked as always roaming and the roaming
device settings was off.

BUG=chromium-os:33439
TEST=Manual, see bug.


Review URL: https://chromiumcodereview.appspot.com/10854112

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151320 0039d316-1c4b-4281-b951-d872f2087c98
parent a56af241
...@@ -27,7 +27,8 @@ namespace { ...@@ -27,7 +27,8 @@ namespace {
// List of cellular operators names that should have data roaming always enabled // List of cellular operators names that should have data roaming always enabled
// to be able to connect to any network. // to be able to connect to any network.
const char* kAlwaysInRoamingOperators[] = { const char* kAlwaysInRoamingOperators[] = {
"CUBIC" "CUBIC",
"Cubic",
}; };
// List of interfaces that have portal check enabled by default. // List of interfaces that have portal check enabled by default.
...@@ -163,10 +164,11 @@ void NetworkLibraryImplCros::UpdateNetworkDeviceStatus( ...@@ -163,10 +164,11 @@ void NetworkLibraryImplCros::UpdateNetworkDeviceStatus(
} }
} }
bool NetworkLibraryImplCros::UpdateCellularDeviceStatus( bool NetworkLibraryImplCros::UpdateCellularDeviceStatus(NetworkDevice* device,
NetworkDevice* device, PropertyIndex index) { PropertyIndex index) {
if (index == PROPERTY_INDEX_CELLULAR_ALLOW_ROAMING) { if (index == PROPERTY_INDEX_CELLULAR_ALLOW_ROAMING) {
if (!device->data_roaming_allowed() && IsCellularAlwaysInRoaming()) { if (IsCellularAlwaysInRoaming()) {
if (!device->data_roaming_allowed())
SetCellularDataRoamingAllowed(true); SetCellularDataRoamingAllowed(true);
} else { } else {
bool settings_value; bool settings_value;
...@@ -1201,19 +1203,11 @@ void NetworkLibraryImplCros::ParseNetworkDevice(const std::string& device_path, ...@@ -1201,19 +1203,11 @@ void NetworkLibraryImplCros::ParseNetworkDevice(const std::string& device_path,
CHECK(device) << "Attempted to add NULL device for path: " << device_path; CHECK(device) << "Attempted to add NULL device for path: " << device_path;
} }
VLOG(2) << "ParseNetworkDevice:" << device->name(); VLOG(2) << "ParseNetworkDevice:" << device->name();
if (device && device->type() == TYPE_CELLULAR) {
if (!device->data_roaming_allowed() && IsCellularAlwaysInRoaming()) { // Re-synchronize the roaming setting with the device property if required.
SetCellularDataRoamingAllowed(true); if (device && device->type() == TYPE_CELLULAR)
} else { UpdateCellularDeviceStatus(device, PROPERTY_INDEX_CELLULAR_ALLOW_ROAMING);
bool settings_value;
if (CrosSettings::Get()->GetBoolean(
kSignedDataRoamingEnabled, &settings_value) &&
device->data_roaming_allowed() != settings_value) {
// Switch back to signed settings value.
SetCellularDataRoamingAllowed(settings_value);
}
}
}
NotifyNetworkManagerChanged(false); // Not forced. NotifyNetworkManagerChanged(false); // Not forced.
AddNetworkDeviceObserver(device_path, network_device_observer_.get()); AddNetworkDeviceObserver(device_path, network_device_observer_.get());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment