summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard/src
diff options
context:
space:
mode:
authorSanket Padawe <sanketpadawe@google.com>2015-04-01 14:02:16 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2015-04-23 10:06:04 -0700
commitb8726b7002aa39c7a01245212d35ac9296c58a1a (patch)
tree7b3187dd4d1bde8b5c068e35632fc630b5700191 /packages/Keyguard/src
parent7fadb2f5428e0b8a1a327cd300c0ade8a6fdc348 (diff)
downloadframeworks_base-b8726b7002aa39c7a01245212d35ac9296c58a1a.zip
frameworks_base-b8726b7002aa39c7a01245212d35ac9296c58a1a.tar.gz
frameworks_base-b8726b7002aa39c7a01245212d35ac9296c58a1a.tar.bz2
Don't show two identical carrier names.
Multi-sim device would show 2 PLMN in status bar even if they are same. Bug: 19710990 Change-Id: I07ba5cbf82d4cc99bb7be644cc1e95c525bcfb8b
Diffstat (limited to 'packages/Keyguard/src')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/CarrierText.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java
index 4fbcc1e..e083c9c 100644
--- a/packages/Keyguard/src/com/android/keyguard/CarrierText.java
+++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java
@@ -18,6 +18,7 @@ package com.android.keyguard;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import android.content.Context;
import android.content.Intent;
@@ -141,7 +142,11 @@ public class CarrierText extends TextView {
plmn = i.getStringExtra(TelephonyIntents.EXTRA_PLMN);
}
if (DEBUG) Log.d(TAG, "Getting plmn/spn sticky brdcst " + plmn + "/" + spn);
- text = concatenate(plmn, spn);
+ if (Objects.equals(plmn, spn)) {
+ text = plmn;
+ } else {
+ text = concatenate(plmn, spn);
+ }
}
displayText = makeCarrierStringOnEmergencyCapable(
getContext().getText(R.string.keyguard_missing_sim_message_short), text);
@@ -293,11 +298,7 @@ public class CarrierText extends TextView {
final boolean plmnValid = !TextUtils.isEmpty(plmn);
final boolean spnValid = !TextUtils.isEmpty(spn);
if (plmnValid && spnValid) {
- if (plmn.equals(spn)) {
- return plmn;
- } else {
- return new StringBuilder().append(plmn).append(mSeparator).append(spn).toString();
- }
+ return new StringBuilder().append(plmn).append(mSeparator).append(spn).toString();
} else if (plmnValid) {
return plmn;
} else if (spnValid) {