diff --git a/res/layout/master_clear.xml b/res/layout/master_clear.xml index 4423e106270..ec2aaeaaf49 100644 --- a/res/layout/master_clear.xml +++ b/res/layout/master_clear.xml @@ -45,6 +45,13 @@ android:visibility="gone" android:textSize="18sp" android:text="@string/master_clear_desc_also_erases_external" /> + + - - - - - - - "This will erase all data from your tablet\u2019s internal storage, including:\n\nYour Google account\nSystem and app data and settings\nDownloaded apps" - "This will erase all data from your phone\u2019s internal storage, including:\n\nYour Google account\nSystem and app data and settings\nDownloaded apps" + "This will erase all data from your phone\u2019s internal storage, including:\n\nYour Google account\nSystem and app data and settings\nDownloaded apps" "\n\nYou are currently signed into the following accounts:\n" "\n\nThere are other users present on this device.\n" "Music\nPhotos\nOther user data" + + "Carriers on eSIM" + + "\n\nThis will not cancel your mobile service plan. "\n\nTo clear music, pictures, and other user data, the USB storage needs to be erased." diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java index 1bdd6f432fd..96ce17e3ffa 100644 --- a/src/com/android/settings/MasterClear.java +++ b/src/com/android/settings/MasterClear.java @@ -81,8 +81,6 @@ public class MasterClear extends OptionsMenuFragment { private Button mInitiateButton; private View mExternalStorageContainer; @VisibleForTesting CheckBox mExternalStorage; - private View mEsimStorageContainer; - @VisibleForTesting CheckBox mEsimStorage; private ScrollView mScrollView; private final OnGlobalLayoutListener mOnGlobalLayoutListener = new OnGlobalLayoutListener() { @@ -126,7 +124,8 @@ public class MasterClear extends OptionsMenuFragment { void showFinalConfirmation() { Bundle args = new Bundle(); args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked()); - args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked()); + // TODO: Offer the user a choice to wipe eSIMs when it is technically feasible to do so. + args.putBoolean(ERASE_ESIMS_EXTRA, true); ((SettingsActivity) getActivity()).startPreferencePanel( this, MasterClearConfirm.class.getName(), args, R.string.master_clear_confirm_title, null, null, 0); @@ -175,8 +174,6 @@ public class MasterClear extends OptionsMenuFragment { mInitiateButton.setOnClickListener(mInitiateListener); mExternalStorageContainer = mContentView.findViewById(R.id.erase_external_container); mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external); - mEsimStorageContainer = mContentView.findViewById(R.id.erase_esim_container); - mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim); mScrollView = (ScrollView) mContentView.findViewById(R.id.master_clear_scrollview); /* @@ -211,15 +208,11 @@ public class MasterClear extends OptionsMenuFragment { } if (showWipeEuicc()) { - mEsimStorageContainer.setOnClickListener(new View.OnClickListener() { + final View esimAlsoErased = mContentView.findViewById(R.id.also_erases_esim); + esimAlsoErased.setVisibility(View.VISIBLE); - @Override - public void onClick(View v) { - mEsimStorage.toggle(); - } - }); - } else { - mEsimStorageContainer.setVisibility(View.GONE); + final View noCancelMobilePlan = mContentView.findViewById(R.id.no_cancel_mobile_plan); + noCancelMobilePlan.setVisibility(View.VISIBLE); } final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE); @@ -245,9 +238,9 @@ public class MasterClear extends OptionsMenuFragment { } /** - * Whether to show the checkbox to wipe the eUICC. + * Whether to show strings indicating that the eUICC will be wiped. * - * We show the checkbox on any device which supports eUICC as long as the eUICC was ever + * We show the strings on any device which supports eUICC as long as the eUICC was ever * provisioned (that is, at least one profile was ever downloaded onto it). */ @VisibleForTesting diff --git a/tests/robotests/src/com/android/settings/MasterClearTest.java b/tests/robotests/src/com/android/settings/MasterClearTest.java index edad39164cd..b50165467bd 100644 --- a/tests/robotests/src/com/android/settings/MasterClearTest.java +++ b/tests/robotests/src/com/android/settings/MasterClearTest.java @@ -122,32 +122,6 @@ public class MasterClearTest { cr, android.provider.Settings.Global.EUICC_PROVISIONED, isEuiccProvisioned ? 1 : 0); } - @Test - public void testShowFinalConfirmation_EraseEsimChecked() { - ActivityForTest testActivity = new ActivityForTest(); - when(mMasterClear.getActivity()).thenReturn(testActivity); - - mMasterClear.mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim); - mMasterClear.mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external); - mMasterClear.mEsimStorage.setChecked(true); - mMasterClear.showFinalConfirmation(); - assertThat(testActivity.getArgs().getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false)) - .isTrue(); - } - - @Test - public void testShowFinalConfirmation_EraseEsimUnchecked() { - ActivityForTest testActivity = new ActivityForTest(); - when(mMasterClear.getActivity()).thenReturn(testActivity); - - mMasterClear.mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim); - mMasterClear.mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external); - mMasterClear.mEsimStorage.setChecked(false); - mMasterClear.showFinalConfirmation(); - assertThat(testActivity.getArgs().getBoolean(MasterClear.ERASE_ESIMS_EXTRA, true)) - .isFalse(); - } - @Test public void testHasReachedBottom_NotScrollDown_returnFalse() { initScrollView(100, 0, 200);
We show the checkbox on any device which supports eUICC as long as the eUICC was ever + *
We show the strings on any device which supports eUICC as long as the eUICC was ever * provisioned (that is, at least one profile was ever downloaded onto it). */ @VisibleForTesting diff --git a/tests/robotests/src/com/android/settings/MasterClearTest.java b/tests/robotests/src/com/android/settings/MasterClearTest.java index edad39164cd..b50165467bd 100644 --- a/tests/robotests/src/com/android/settings/MasterClearTest.java +++ b/tests/robotests/src/com/android/settings/MasterClearTest.java @@ -122,32 +122,6 @@ public class MasterClearTest { cr, android.provider.Settings.Global.EUICC_PROVISIONED, isEuiccProvisioned ? 1 : 0); } - @Test - public void testShowFinalConfirmation_EraseEsimChecked() { - ActivityForTest testActivity = new ActivityForTest(); - when(mMasterClear.getActivity()).thenReturn(testActivity); - - mMasterClear.mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim); - mMasterClear.mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external); - mMasterClear.mEsimStorage.setChecked(true); - mMasterClear.showFinalConfirmation(); - assertThat(testActivity.getArgs().getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false)) - .isTrue(); - } - - @Test - public void testShowFinalConfirmation_EraseEsimUnchecked() { - ActivityForTest testActivity = new ActivityForTest(); - when(mMasterClear.getActivity()).thenReturn(testActivity); - - mMasterClear.mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim); - mMasterClear.mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external); - mMasterClear.mEsimStorage.setChecked(false); - mMasterClear.showFinalConfirmation(); - assertThat(testActivity.getArgs().getBoolean(MasterClear.ERASE_ESIMS_EXTRA, true)) - .isFalse(); - } - @Test public void testHasReachedBottom_NotScrollDown_returnFalse() { initScrollView(100, 0, 200);