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

Commit b213804b authored by tomhsu's avatar tomhsu Committed by Tom Hsu
Browse files

Fix crash due to UserManager is null.

 - Instance of UserManager get from onCraete, so  we can not use this
   onAttach.

Flag: EXEMPT bug fix
Fix: 289232540
Test: Manual test
Change-Id: Ieb62d8289db0dbcd5a16280aa66f3b3de8936e26
parent 0373a46e
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -202,12 +202,6 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (isUiRestricted()) {
            Log.d(LOG_TAG, "Mobile network page is disallowed.");
            finish();
            return;
        }

        if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            Log.d(LOG_TAG, "Invalid subId, get the default subscription to show.");
            SubscriptionInfo info = SubscriptionUtil.getSubscriptionOrDefault(context, mSubId);
@@ -346,6 +340,11 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
                setTelephonyAvailabilityStatus(getPreferenceControllersAsList());

        super.onCreate(icicle);
        if (isUiRestricted()) {
            Log.d(LOG_TAG, "Mobile network page is disallowed.");
            finish();
            return;
        }
        final Context context = getContext();
        mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
        mTelephonyManager = context.getSystemService(TelephonyManager.class)