Chromium Code Reviews| Index: chromeos/network/network_connect.cc |
| diff --git a/chromeos/network/network_connect.cc b/chromeos/network/network_connect.cc |
| index 5778905536ca09761448958fcee5e89a87382603..2687a4f73887187d9e311c4cc6dfa9e3ce0dad03 100644 |
| --- a/chromeos/network/network_connect.cc |
| +++ b/chromeos/network/network_connect.cc |
| @@ -435,31 +435,28 @@ void NetworkConnectImpl::SetTechnologyEnabled( |
| network_handler::ErrorCallback()); |
| return; |
| } |
| - // If we're dealing with a mobile network, then handle SIM lock here. |
| + // If we're dealing with a cellular network, then handle SIM lock here. |
| // SIM locking only applies to cellular, so the code below won't execute |
| // if |technology| has been explicitly set to WiMAX. |
| - if (technology.MatchesPattern(NetworkTypePattern::Mobile())) { |
| + if (technology.MatchesPattern(NetworkTypePattern::Cellular())) { |
| const DeviceState* mobile = handler->GetDeviceStateByType(technology); |
|
Kyle Horimoto
2017/06/01 22:12:23
nit: Change the variable name if we're changing th
Kyle Horimoto
2017/06/01 22:12:23
Don't we still want this code running for WiMAX ne
stevenjb
2017/06/01 22:29:47
This code explicitly checks against kTypeCellular
lesliewatkins
2017/06/02 21:31:17
Acknowledged.
|
| if (!mobile) { |
| NET_LOG_ERROR("SetTechnologyEnabled with no device", log_string); |
| return; |
| } |
| - // The following only applies to cellular. |
| - if (mobile->type() == shill::kTypeCellular) { |
| - if (mobile->IsSimAbsent()) { |
| - // If this is true, then we have a cellular device with no SIM |
| - // inserted. TODO(armansito): Chrome should display a notification here, |
| - // prompting the user to insert a SIM card and restart the device to |
| - // enable cellular. See crbug.com/125171. |
| - NET_LOG_USER("Cannot enable cellular device without SIM.", log_string); |
| - return; |
| - } |
| - if (!mobile->sim_lock_type().empty()) { |
| - // A SIM has been inserted, but it is locked. Let the user unlock it |
| - // via the dialog. |
| - delegate_->ShowMobileSimDialog(); |
| - return; |
| - } |
| + if (mobile->IsSimAbsent()) { |
| + // If this is true, then we have a cellular device with no SIM |
| + // inserted. TODO(armansito): Chrome should display a notification here, |
| + // prompting the user to insert a SIM card and restart the device to |
| + // enable cellular. See crbug.com/125171. |
| + NET_LOG_USER("Cannot enable cellular device without SIM.", log_string); |
| + return; |
| + } |
| + if (!mobile->sim_lock_type().empty()) { |
| + // A SIM has been inserted, but it is locked. Let the user unlock it |
| + // via the dialog. |
| + delegate_->ShowMobileSimDialog(); |
| + return; |
| } |
| } |
| handler->SetTechnologyEnabled(technology, true, |