Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4bac984 authored by xiaognol's avatar xiaognol Committed by Gerrit Code Review
Browse files

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
parent 6817e26d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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);