TelecomAccountRegistry should be consistent in operator name retrieval
Currrently, the logic for deriving the operator name is different
between the single sim case and dual sim case. Minor update to make sure
the logic for these two scenarios are in par with one another.
Bug: 239730565
Test: Manual
Change-Id: Icef3cb269a82786cafb50508d41a54a185587ee6
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index f112d33..324fb85 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -310,8 +310,8 @@
subNumber = "";
}
- String label;
- String description;
+ String label = "";
+ String description = "";
Icon icon = null;
// We can only get the real slotId from the SubInfoRecord, we can't calculate the
@@ -327,7 +327,9 @@
} else if (mTelephonyManager.getPhoneCount() == 1) {
// For single-SIM devices, we show the label and description as whatever the name of
// the network is.
- description = label = tm.getNetworkOperatorName();
+ if (record != null) {
+ description = label = String.valueOf(record.getDisplayName());
+ }
} else {
CharSequence subDisplayName = null;