cellular: Added check for null callback in *UniversalCDMA::OnActivateReply.
Added check for null callback in CellularCapabilityUniversalCDMA::OnActivateReply.
Additionally, added activation_code entry for Test Network.
BUG=chromium:243590
TEST=Option 1. Activate a CDMA service on an image built with USE="-gobi qmi".
Check the logs to see that shill hasn't crashed during
activation.
Option 2. Run network_CDMAActivate once it gets checked in. It
should pass.
Change-Id: I6c588498d827f35e5fd3a9ddfc670765a2e44858
Reviewed-on: https://gerrit.chromium.org/gerrit/56550
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
diff --git a/cellular_capability_universal_cdma.cc b/cellular_capability_universal_cdma.cc
index 67d76d6..7b9c7ec 100644
--- a/cellular_capability_universal_cdma.cc
+++ b/cellular_capability_universal_cdma.cc
@@ -130,7 +130,7 @@
Bind(&CellularCapabilityUniversalCDMA::OnActivateReply,
weak_cdma_ptr_factory_.GetWeakPtr(),
ResultCallback());
- // TODO(armansito): Read the activation code from CellularOperatorInfo
+
Error error;
modem_cdma_proxy_->Activate(
activation_code_, &error, activation_callback, kTimeoutActivate);
@@ -352,7 +352,12 @@
PendingActivationStore::kStateFailureRetry);
}
UpdatePendingActivationState();
- callback.Run(error);
+
+ // CellularCapabilityUniversalCDMA::ActivateAutomatic passes a dummy
+ // ResultCallback when it calls Activate on the proxy object, in which case
+ // |callback.is_null()| will return true.
+ if (!callback.is_null())
+ callback.Run(error);
}
void CellularCapabilityUniversalCDMA::HandleNewActivationStatus(uint32 error) {