shill: cellular: Enable out-of-credits detection for ALT3100 modem.
BUG=chrome-os-partner:21739
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that an out-of-credits notification is shown when the SIM on
an ALT3100 modem runs out of data allowance.
Change-Id: Id6a89c672dbdad196457eb0209c8e1aa95f9a90e
Reviewed-on: https://gerrit.chromium.org/gerrit/65102
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/cellular_capability_universal.cc b/cellular_capability_universal.cc
index 887c94f..68b9b5a 100644
--- a/cellular_capability_universal.cc
+++ b/cellular_capability_universal.cc
@@ -69,6 +69,7 @@
const char CellularCapabilityUniversal::kOperatorAccessTechnologyProperty[] =
"access-technology";
const char CellularCapabilityUniversal::kIpConfigPropertyMethod[] = "method";
+const char CellularCapabilityUniversal::kALT3100ModelId[] = "ALT3100";
const char CellularCapabilityUniversal::kE362ModelId[] = "E362 WWAN";
const int CellularCapabilityUniversal::kSetPowerStateTimeoutMilliseconds =
20000;
@@ -728,9 +729,11 @@
// WORKAROUND:
// E362 modems on Verizon network does not properly redirect when a SIM
// runs out of credits, we need to enforce out-of-credits detection.
- // TODO(thieule): Remove this workaround (crosbug.com/p/18619).
- if (model_id_ == kE362ModelId)
- cellular()->service()->set_enforce_out_of_credits_detection(true);
+ //
+ // The out-of-credits detection is also needed on ALT3100 modems until the PCO
+ // support is ready (crosbug.com/p/20461).
+ cellular()->service()->set_enforce_out_of_credits_detection(
+ ShouldDetectOutOfCredit());
// Make sure that the network technology is set when the service gets
// created, just in case.
@@ -837,7 +840,7 @@
}
bool CellularCapabilityUniversal::ShouldDetectOutOfCredit() const {
- return model_id_ == kE362ModelId;
+ return model_id_ == kALT3100ModelId || model_id_ == kE362ModelId;
}
void CellularCapabilityUniversal::GetProperties() {