diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java index acf674f3f7c..a5cdb954664 100644 --- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java +++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java @@ -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)