Skip to content

Commit be95d77

Browse files
author
Jim Miller
committed
Fix 5487180: Check for empty plmn/spn strings instead of just null
This fixes a problem where we'd sometimes show a '|' in front of the spn string or after the plmn string. Change-Id: I6a3a398b0ddf89fcc8862b275dea0e925873b56a
1 parent 2333a02 commit be95d77

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,13 @@ public void onClick(View v) {
635635
* @return
636636
*/
637637
private static CharSequence makeCarierString(CharSequence plmn, CharSequence spn) {
638-
if (plmn != null && spn == null) {
639-
return plmn;
640-
} else if (plmn != null && spn != null) {
638+
final boolean plmnValid = !TextUtils.isEmpty(plmn);
639+
final boolean spnValid = !TextUtils.isEmpty(spn);
640+
if (plmnValid && spnValid) {
641641
return plmn + "|" + spn;
642-
} else if (plmn == null && spn != null) {
642+
} else if (plmnValid) {
643+
return plmn;
644+
} else if (spnValid) {
643645
return spn;
644646
} else {
645647
return "";

0 commit comments

Comments
 (0)