shill: cellular: Migrate activation paths to use MobileOperatorInfo.

The code paths that determine whether cellular activation is required also
verify that some online portal information is available. This CL migrates this
check to be based off of the new MobileOperatorInfo objects. Before this CL, a
new |CellularOperatorInfo| object was used to make this decision.

BUG=chromium:371630
TEST=- Use pseudomodem to manually create a modem that exposes itself with
         operator id: '310995'
         operator name: ''
         subscription state: 'unknown'
         own: '0000000000'
       and verify that
         $ connectivity show devices
       shows the cellular service is 'not-activated'.
     - Run network_LTEActivate.

Change-Id: I22cecffca1169e8abf25148b367d01520aa171bc
Reviewed-on: https://chromium-review.googlesource.com/200687
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
diff --git a/cellular_capability_universal_cdma_unittest.cc b/cellular_capability_universal_cdma_unittest.cc
index bd57710..fb86542 100644
--- a/cellular_capability_universal_cdma_unittest.cc
+++ b/cellular_capability_universal_cdma_unittest.cc
@@ -374,13 +374,36 @@
 }
 
 TEST_F(CellularCapabilityUniversalCDMAMainTest, IsServiceActivationRequired) {
-  CellularOperatorInfo::OLP olp;
-  EXPECT_CALL(*modem_info_.mock_cellular_operator_info(), GetOLPBySID(_))
-      .WillOnce(Return((const CellularOperatorInfo::OLP *)NULL))
-      .WillRepeatedly(Return(&olp));
+  const vector<MobileOperatorInfo::OnlinePortal> empty_list;
+  const vector<MobileOperatorInfo::OnlinePortal> olp_list {
+    {"some@url", "some_method", "some_post_data"}
+  };
+  SetMockMobileOperatorInfoObjects();
+
   capability_->activation_state_ =
       MM_MODEM_CDMA_ACTIVATION_STATE_NOT_ACTIVATED;
+  EXPECT_CALL(*mock_serving_operator_info_, IsMobileNetworkOperatorKnown())
+      .WillRepeatedly(Return(false));
   EXPECT_FALSE(capability_->IsServiceActivationRequired());
+  Mock::VerifyAndClearExpectations(mock_serving_operator_info_);
+
+  capability_->activation_state_ =
+      MM_MODEM_CDMA_ACTIVATION_STATE_NOT_ACTIVATED;
+  EXPECT_CALL(*mock_serving_operator_info_, IsMobileNetworkOperatorKnown())
+      .WillRepeatedly(Return(true));
+  EXPECT_CALL(*mock_serving_operator_info_, olp_list())
+      .WillRepeatedly(ReturnRef(empty_list));
+  EXPECT_FALSE(capability_->IsServiceActivationRequired());
+  Mock::VerifyAndClearExpectations(mock_serving_operator_info_);
+
+  // These expectations hold for all subsequent tests.
+  EXPECT_CALL(*mock_serving_operator_info_, IsMobileNetworkOperatorKnown())
+      .WillRepeatedly(Return(true));
+  EXPECT_CALL(*mock_serving_operator_info_, olp_list())
+      .WillRepeatedly(ReturnRef(olp_list));
+
+  capability_->activation_state_ =
+      MM_MODEM_CDMA_ACTIVATION_STATE_NOT_ACTIVATED;
   EXPECT_TRUE(capability_->IsServiceActivationRequired());
   capability_->activation_state_ =
       MM_MODEM_CDMA_ACTIVATION_STATE_ACTIVATING;
@@ -392,9 +415,15 @@
 
 TEST_F(CellularCapabilityUniversalCDMAMainTest,
        UpdateServiceActivationStateProperty) {
-  CellularOperatorInfo::OLP olp;
-  EXPECT_CALL(*modem_info_.mock_cellular_operator_info(), GetOLPBySID(_))
-      .WillRepeatedly(Return(&olp));
+  const vector<MobileOperatorInfo::OnlinePortal> olp_list {
+    {"some@url", "some_method", "some_post_data"}
+  };
+  SetMockMobileOperatorInfoObjects();
+  EXPECT_CALL(*mock_serving_operator_info_, IsMobileNetworkOperatorKnown())
+      .WillRepeatedly(Return(true));
+  EXPECT_CALL(*mock_serving_operator_info_, olp_list())
+      .WillRepeatedly(ReturnRef(olp_list));
+
   EXPECT_CALL(*modem_info_.mock_pending_activation_store(),
               GetActivationState(_, _))
       .WillOnce(Return(PendingActivationStore::kStatePending))