summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorxiaognol <xiaognol@gmail.com>2016-06-14 01:39:30 +0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-08-11 16:24:06 -0700
commitb4bac9841a13c1ad747da3bc981993f0d6d67fd0 (patch)
tree1a63ca0db42b12bda4c7961ca0ff142d11b682cb /src/com
parent6817e26de1630c8385e1cb601fd75ec64888355a (diff)
downloadpackages_apps_Settings-b4bac9841a13c1ad747da3bc981993f0d6d67fd0.zip
packages_apps_Settings-b4bac9841a13c1ad747da3bc981993f0d6d67fd0.tar.gz
packages_apps_Settings-b4bac9841a13c1ad747da3bc981993f0d6d67fd0.tar.bz2
Settings:Fix mImsi null cause ApnSettings crash
mImsi may be "null" in some case,if we use "" instead may cause crash in ApnSettings&com.android.phone. so fix it to use old way to set Apn in that "null" case. Change-Id: I0119e9a3f58c688e0e271ae62f50484ad8a29da9
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/ApnSettings.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 0459a13..4bb836a 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -164,9 +164,6 @@ public class ApnSettings extends SettingsPreferenceFragment implements
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
mImsi = activity.getIntent().getStringExtra(EXTRA_IMSI);
- if (mImsi == null) {
- mImsi = "";
- }
mUm = (UserManager) getSystemService(Context.USER_SERVICE);
@@ -419,7 +416,7 @@ public class ApnSettings extends SettingsPreferenceFragment implements
ContentValues values = new ContentValues();
values.put(APN_ID, mSelectedKey);
- if (TelephonyManager.getDefault().getPhoneCount() > 1) {
+ if (TelephonyManager.getDefault().getPhoneCount() > 1 && mImsi != null) {
Uri qUri = Uri.withAppendedPath(PREFERRED_MSIM_APN_URI,
String.valueOf(mSubscriptionInfo.getSubscriptionId()));
qUri = Uri.withAppendedPath(qUri, mImsi);
@@ -433,7 +430,7 @@ public class ApnSettings extends SettingsPreferenceFragment implements
String key = null;
Uri uri;
- if (TelephonyManager.getDefault().getPhoneCount() > 1) {
+ if (TelephonyManager.getDefault().getPhoneCount() > 1 && mImsi != null) {
uri = Uri.withAppendedPath(PREFERRED_MSIM_APN_URI,
String.valueOf(mSubscriptionInfo.getSubscriptionId()));
uri = Uri.withAppendedPath(uri, mImsi);