Loading src/com/android/settings/ResetNetwork.java +28 −5 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.settings; import android.app.Activity; import android.app.settings.SettingsEnums; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.os.Bundle; import android.provider.Settings; Loading Loading @@ -66,7 +69,7 @@ import java.util.Optional; * prompt, followed by a keyguard pattern trace if the user has defined one, followed by a final * strongly-worded "THIS WILL RESET EVERYTHING" prompt. If at any time the phone is allowed to go * to sleep, is locked, et cetera, then the confirmation sequence is abandoned. * * <p> * This is the initial screen. */ public class ResetNetwork extends InstrumentedFragment { Loading @@ -81,8 +84,20 @@ public class ResetNetwork extends InstrumentedFragment { private View mContentView; private Spinner mSubscriptionSpinner; private Button mInitiateButton; @VisibleForTesting View mEsimContainer; @VisibleForTesting CheckBox mEsimCheckbox; @VisibleForTesting View mEsimContainer; @VisibleForTesting CheckBox mEsimCheckbox; private BroadcastReceiver mDefaultSubChangeReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction() != SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED) { return; } establishInitialState(getActiveSubscriptionInfoList()); } }; @Override public void onCreate(@Nullable Bundle savedInstanceState) { Loading @@ -97,6 +112,7 @@ public class ResetNetwork extends InstrumentedFragment { /** * Keyguard validation is run using the standard {@link ConfirmLockPattern} * component as a subactivity * * @param request the request code to be returned once confirmation finishes * @return true if confirmation launched */ Loading Loading @@ -215,7 +231,6 @@ public class ResetNetwork extends InstrumentedFragment { } int selectedIndex = 0; int size = mSubscriptions.size(); List<String> subscriptionNames = new ArrayList<>(); for (SubscriptionInfo record : mSubscriptions) { if (record.getSubscriptionId() == defaultSubscription) { Loading Loading @@ -281,6 +296,8 @@ public class ResetNetwork extends InstrumentedFragment { @Override public void onResume() { super.onResume(); getContext().registerReceiver(mDefaultSubChangeReceiver, new IntentFilter(SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)); if (mContentView == null) { return; Loading @@ -297,6 +314,12 @@ public class ResetNetwork extends InstrumentedFragment { establishInitialState(updatedSubscriptions); } @Override public void onPause() { super.onPause(); getContext().unregisterReceiver(mDefaultSubChangeReceiver); } private boolean showEuiccSettings(Context context) { if (!SubscriptionUtil.isSimHardwareVisible(context)) { return false; Loading Loading
src/com/android/settings/ResetNetwork.java +28 −5 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.settings; import android.app.Activity; import android.app.settings.SettingsEnums; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.os.Bundle; import android.provider.Settings; Loading Loading @@ -66,7 +69,7 @@ import java.util.Optional; * prompt, followed by a keyguard pattern trace if the user has defined one, followed by a final * strongly-worded "THIS WILL RESET EVERYTHING" prompt. If at any time the phone is allowed to go * to sleep, is locked, et cetera, then the confirmation sequence is abandoned. * * <p> * This is the initial screen. */ public class ResetNetwork extends InstrumentedFragment { Loading @@ -81,8 +84,20 @@ public class ResetNetwork extends InstrumentedFragment { private View mContentView; private Spinner mSubscriptionSpinner; private Button mInitiateButton; @VisibleForTesting View mEsimContainer; @VisibleForTesting CheckBox mEsimCheckbox; @VisibleForTesting View mEsimContainer; @VisibleForTesting CheckBox mEsimCheckbox; private BroadcastReceiver mDefaultSubChangeReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction() != SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED) { return; } establishInitialState(getActiveSubscriptionInfoList()); } }; @Override public void onCreate(@Nullable Bundle savedInstanceState) { Loading @@ -97,6 +112,7 @@ public class ResetNetwork extends InstrumentedFragment { /** * Keyguard validation is run using the standard {@link ConfirmLockPattern} * component as a subactivity * * @param request the request code to be returned once confirmation finishes * @return true if confirmation launched */ Loading Loading @@ -215,7 +231,6 @@ public class ResetNetwork extends InstrumentedFragment { } int selectedIndex = 0; int size = mSubscriptions.size(); List<String> subscriptionNames = new ArrayList<>(); for (SubscriptionInfo record : mSubscriptions) { if (record.getSubscriptionId() == defaultSubscription) { Loading Loading @@ -281,6 +296,8 @@ public class ResetNetwork extends InstrumentedFragment { @Override public void onResume() { super.onResume(); getContext().registerReceiver(mDefaultSubChangeReceiver, new IntentFilter(SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)); if (mContentView == null) { return; Loading @@ -297,6 +314,12 @@ public class ResetNetwork extends InstrumentedFragment { establishInitialState(updatedSubscriptions); } @Override public void onPause() { super.onPause(); getContext().unregisterReceiver(mDefaultSubChangeReceiver); } private boolean showEuiccSettings(Context context) { if (!SubscriptionUtil.isSimHardwareVisible(context)) { return false; Loading