shill: cellular: Move ownership of MobileOperatorInfo objects to Cellular.
Before this CL, |home_provider_info_| and |service_operator_info_| objects were
owned by ModemInfo. The aim was to allow |Cellular| objects who's lifetime does
not overlap to reuse these objects. But on a device with multiple modems, two
concomitant |Cellular| objects would interfere when they try to use the shared
MobileOperatorInfo objects.
This CL moves the ownership to |Cellular|. Preliminary experiments show that
both the space and time cost of creating MobileOperatorInfo objects is small
enough to all recreating them on modem reset. This is a stop-gap solution. The
more elegant solution is to split the MobileOperatorInfo object so that the
costly parts can continue to be owned by ModemInfo.
BUG=chromium:363874
TEST=(1) Run shill unittests.
(2) Run cellular_ServiceName and network_3GModemControl.
Change-Id: I85d0b5bc6f82b934c3bcec6c2fd5408a1d9b03ff
Reviewed-on: https://chromium-review.googlesource.com/197130
Reviewed-by: Prathmesh Prabhu <pprabhu@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 597b9a4..37a993e 100644
--- a/cellular_capability_universal_cdma.cc
+++ b/cellular_capability_universal_cdma.cc
@@ -622,8 +622,8 @@
cdma_evdo_registration_state_ = state_evdo;
sid_ = sid;
nid_ = nid;
- modem_info()->serving_operator_info()->UpdateSID(UintToString(sid));
- modem_info()->serving_operator_info()->UpdateNID(UintToString(nid));
+ cellular()->serving_operator_info()->UpdateSID(UintToString(sid));
+ cellular()->serving_operator_info()->UpdateNID(UintToString(nid));
UpdateOperatorInfo();
cellular()->HandleNewRegistrationState();
}