shill: cellular: Obtain |actvation_code| from serving operator.
In automatic activation implemented in CellularCapabilityUniversalCDMA, obtain
the activation code from the serving operator.
BUG=chromium:376098
TEST=(1) Run shill_unittests
(2) Run network_CDMAActivate
Change-Id: Id56dcd99625ad2d655e58b68090a17febb7a56f9
Reviewed-on: https://chromium-review.googlesource.com/201084
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
diff --git a/cellular_capability_universal_cdma.cc b/cellular_capability_universal_cdma.cc
index 3d6f65d..dd925f3 100644
--- a/cellular_capability_universal_cdma.cc
+++ b/cellular_capability_universal_cdma.cc
@@ -92,11 +92,13 @@
}
void CellularCapabilityUniversalCDMA::ActivateAutomatic() {
- if (activation_code_.empty()) {
+ if (!cellular()->serving_operator_info()->IsMobileNetworkOperatorKnown() ||
+ cellular()->serving_operator_info()->activation_code().empty()) {
SLOG(Cellular, 2) << "OTA activation cannot be run in the presence of no "
<< "activation code.";
return;
}
+
PendingActivationStore::State state =
modem_info()->pending_activation_store()->GetActivationState(
PendingActivationStore::kIdentifierMEID, cellular()->meid());
@@ -125,7 +127,10 @@
Error error;
modem_cdma_proxy_->Activate(
- activation_code_, &error, activation_callback, kTimeoutActivate);
+ cellular()->serving_operator_info()->activation_code(),
+ &error,
+ activation_callback,
+ kTimeoutActivate);
}
void CellularCapabilityUniversalCDMA::UpdatePendingActivationState() {