shill: cellular: Sid belonging to an unknown carrier should be visible.

CellularCapabilityUniversalCDMA will know expose the SID of an unknown
carrier as part of the Cellular.ServingOperator property. If there is no
match for the SID in the database, the "name" and "country" fields of
|serving_operator_| will be cleared.

BUG=chromium:274835
TEST=Build and run unit tests.

Change-Id: If485b8e53bbd6b84b14fecbf10d3765c909686ee
Reviewed-on: https://gerrit.chromium.org/gerrit/66148
Reviewed-by: Thieu Le <thieule@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 925956e..6dbe183 100644
--- a/cellular_capability_universal_cdma.cc
+++ b/cellular_capability_universal_cdma.cc
@@ -293,16 +293,21 @@
     SLOG(Cellular, 2) << "CDMA provider with "
                       << FormattedSID(sid)
                       << " not found.";
-    return;
-  }
+    // If a matching provider is not found, shill should update the
+    // Cellular.ServingOperator property to to display the Sid.
+    provider_.SetCode(sid);
+    provider_.SetCountry("");
+    provider_.SetName("");
+    activation_code_.clear();
+  } else {
+    if (!provider->name_list().empty()) {
+      provider_.SetName(provider->name_list()[0].name);
+    }
+    provider_.SetCode(sid);
+    provider_.SetCountry(provider->country());
 
-  if (!provider->name_list().empty()) {
-    provider_.SetName(provider->name_list()[0].name);
+    activation_code_ = provider->activation_code();
   }
-  provider_.SetCode(sid);
-  provider_.SetCountry(provider->country());
-
-  activation_code_ = provider->activation_code();
 
   // TODO(armansito): The CDMA interface only returns information about the
   // current serving carrier, so for now both the home provider and the
@@ -310,7 +315,6 @@
   // out if there is a way to (and whether or not it is necessary to)
   // determine if we're roaming.
   cellular()->set_home_provider(provider_);
-
   UpdateServingOperator();
 }