shill: cellular: Obtain IMSI when a GSM device is constructed.
This CL modifies CellularCapabilityGSM to obtain the IMSI value at
construction instead of when the modem is enabled. The IMSI value is
checked by Chrome to determine if a SIM is present before the device can
be enabled.
BUG=chromium-os:31651
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that Gobi and Icera modems can be enabled as follows:
a. Configure the modem in GSM and insert a SIM with no PIN lock.
b. Disable the cellular device from UI.
c. Reboot the Chromebook.
d. Enable the cellular device from UI and it works.
e. Repeat with a PIN-locked SIM.
3. Verify that Gobi and Icera modems cannot be enabled as follows:
a. Configure the modem in GSM with no SIM inserted.
b. Disable the cellular device from UI.
c. Reboot the Chromebook.
d. Enable the cellular device from UI and it does not work.
Change-Id: Iff21f972661cedb383b9a6820fdc7ba3160fd01a
Reviewed-on: https://gerrit.chromium.org/gerrit/29313
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/modem_unittest.cc b/modem_unittest.cc
index d214c81..e010bcd 100644
--- a/modem_unittest.cc
+++ b/modem_unittest.cc
@@ -98,11 +98,6 @@
ModemTest *test_;
};
- CellularCapabilityGSM *GetCapabilityGSM() {
- return dynamic_cast<CellularCapabilityGSM *>(
- modem_->device_->capability_.get());
- }
-
MockGLib glib_;
MockControl control_interface_;
EventDispatcher dispatcher_;
@@ -170,11 +165,12 @@
kLinkName,
kAddressAsString,
kTestInterfaceIndex,
- Cellular::kTypeGSM,
+ Cellular::kTypeCDMA,
kOwner,
kService,
kPath,
- static_cast<mobile_provider_db *>(NULL));
+ static_cast<mobile_provider_db *>(NULL),
+ ProxyFactory::GetInstance());
EXPECT_CALL(*modem_,
ConstructCellular(StrEq(kLinkName),