summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiang Chen <quic_cqiang@quicinc.com>2022-05-30 13:28:25 +0800
committerQiang Chen <quic_cqiang@quicinc.com>2022-06-13 08:28:44 +0000
commit22c9aab8dcd677b91c76b2ea83bae62d033dd1c2 (patch)
tree5dca8f5b59a71c5fb2bec8cbaa17a97406941b75
parent8e25ad6f535977b5ca12329a6e73faaae85050b5 (diff)
Add PLMN null check for UserPLMNEditorActivity
Sometimes the PLMN is empty, so need to add the null check before using. Change-Id: I12bbe0cb91e5e94f356389ce4828d6f3aa0a09e1 CRs-Fixed: 3203993 (cherry picked from commit f3512b2300345b8a3114eb0f9c65e7d539b7f8f4)
-rwxr-xr-xsrc/com/android/settings/network/telephony/UserPLMNEditorActivity.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/settings/network/telephony/UserPLMNEditorActivity.java b/src/com/android/settings/network/telephony/UserPLMNEditorActivity.java
index 47e0836dda..dfac3fa180 100755
--- a/src/com/android/settings/network/telephony/UserPLMNEditorActivity.java
+++ b/src/com/android/settings/network/telephony/UserPLMNEditorActivity.java
@@ -40,6 +40,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.text.InputType;
import android.text.Editable;
+import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
@@ -318,7 +319,9 @@ public class UserPLMNEditorActivity extends PreferenceActivity implements
Log.d(LOG_TAG, "plmn = " + plmn);
String[] CuPlmnArray = getResources().getStringArray(R.array.uplmn_cu_mcc_mnc_values);
for (String CuPlmn : CuPlmnArray) {
- if (plmn.equals(CuPlmn)) return R.array.uplmn_prefer_network_mode_w_choices;
+ if (!TextUtils.isEmpty(plmn) && plmn.equals(CuPlmn)) {
+ return R.array.uplmn_prefer_network_mode_w_choices;
+ }
}
return R.array.uplmn_prefer_network_mode_td_choices;
}