Add checkbox to let user wipe eSIM data together with FDR
This CL add a check box for eSIM enabled devices to reset eSIM data during factory reset of the phone. Bug: 67500470 Test: make RunSettingsRoboTests Change-Id: I5a81d43f23ae55f8549a5b807fdf41f36c9d3acd
This commit is contained in:
@@ -33,6 +33,7 @@ import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
@@ -93,6 +94,32 @@ public class MasterClearTest {
|
||||
when(mScrollView.getChildCount()).thenReturn(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testShowFinalConfirmation_eraseEsimChecked() {
|
||||
ActivityForTest testActivity = new ActivityForTest();
|
||||
when(mMasterClear.getActivity()).thenReturn(testActivity);
|
||||
|
||||
mMasterClear.mEsimStorage = mContentView.findViewById(R.id.erase_esim);
|
||||
mMasterClear.mExternalStorage = 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 = mContentView.findViewById(R.id.erase_esim);
|
||||
mMasterClear.mExternalStorage = 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 testShowWipeEuicc_euiccDisabled() {
|
||||
prepareEuiccState(
|
||||
|
Reference in New Issue
Block a user