AF/FR Fix onActivityResult condition.
Chase list bug. Accidentally bailed on true effectively. Manual tested by going to Settings > System > Erase All Data And then hitting then successfully wiping and reseting. Test: make RunSettingsRoboTests -j40 Bug: 72324059 Change-Id: Ib2a155820811f0ec62a45c1312475c24646ede76
This commit is contained in:
@@ -75,7 +75,7 @@ import java.util.List;
|
|||||||
public class MasterClear extends InstrumentedPreferenceFragment {
|
public class MasterClear extends InstrumentedPreferenceFragment {
|
||||||
private static final String TAG = "MasterClear";
|
private static final String TAG = "MasterClear";
|
||||||
|
|
||||||
private static final int KEYGUARD_REQUEST = 55;
|
@VisibleForTesting static final int KEYGUARD_REQUEST = 55;
|
||||||
@VisibleForTesting static final int CREDENTIAL_CONFIRM_REQUEST = 56;
|
@VisibleForTesting static final int CREDENTIAL_CONFIRM_REQUEST = 56;
|
||||||
|
|
||||||
private static final String KEY_SHOW_ESIM_RESET_CHECKBOX
|
private static final String KEY_SHOW_ESIM_RESET_CHECKBOX
|
||||||
@@ -118,11 +118,16 @@ public class MasterClear extends InstrumentedPreferenceFragment {
|
|||||||
request, res.getText(R.string.master_clear_title));
|
request, res.getText(R.string.master_clear_title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
boolean isValidRequestCode(int requestCode) {
|
||||||
|
return !((requestCode != KEYGUARD_REQUEST) && (requestCode != CREDENTIAL_CONFIRM_REQUEST));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
if (requestCode != KEYGUARD_REQUEST || requestCode != CREDENTIAL_CONFIRM_REQUEST) {
|
if (!isValidRequestCode(requestCode)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -270,6 +270,13 @@ public class MasterClearTest {
|
|||||||
assertThat(mMasterClear.tryShowAccountConfirmation()).isTrue();
|
assertThat(mMasterClear.tryShowAccountConfirmation()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIsValidRequestCode() {
|
||||||
|
assertThat(mMasterClear.isValidRequestCode(MasterClear.KEYGUARD_REQUEST)).isTrue();
|
||||||
|
assertThat(mMasterClear.isValidRequestCode(MasterClear.CREDENTIAL_CONFIRM_REQUEST)).isTrue();
|
||||||
|
assertThat(mMasterClear.isValidRequestCode(0)).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
private void initScrollView(int height, int scrollY, int childBottom) {
|
private void initScrollView(int height, int scrollY, int childBottom) {
|
||||||
when(mScrollView.getHeight()).thenReturn(height);
|
when(mScrollView.getHeight()).thenReturn(height);
|
||||||
when(mScrollView.getScrollY()).thenReturn(scrollY);
|
when(mScrollView.getScrollY()).thenReturn(scrollY);
|
||||||
|
Reference in New Issue
Block a user