Merge changes from topic "qpr.biometric.2panels" into tm-qpr-dev am: c8f45f75eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19764093 Change-Id: I3b0053910613af42ecc91b8a416b131c662c1837 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -134,6 +134,9 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
||||
setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
|
||||
setDescriptionText(R.string.security_settings_fingerprint_enroll_find_sensor_message);
|
||||
}
|
||||
if (savedInstanceState != null) {
|
||||
mNextClicked = savedInstanceState.getBoolean(SAVED_STATE_IS_NEXT_CLICKED, mNextClicked);
|
||||
}
|
||||
|
||||
// This is an entry point for SetNewPasswordController, e.g.
|
||||
// adb shell am start -a android.app.action.SET_NEW_PASSWORD
|
||||
@@ -148,11 +151,19 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
||||
// it passed in.
|
||||
getIntent().putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
|
||||
|
||||
startLookingForFingerprint();
|
||||
// Do not start looking for fingerprint if this activity is re-created because it is
|
||||
// waiting for activity result from enrolling activity.
|
||||
if (!mNextClicked) {
|
||||
startLookingForFingerprint();
|
||||
}
|
||||
});
|
||||
} else if (mToken != null) {
|
||||
// HAT passed in from somewhere else, such as FingerprintEnrollIntroduction
|
||||
startLookingForFingerprint();
|
||||
// Do not start looking for fingerprint if this activity is re-created because it is
|
||||
// waiting for activity result from enrolling activity.
|
||||
if (!mNextClicked) {
|
||||
// HAT passed in from somewhere else, such as FingerprintEnrollIntroduction
|
||||
startLookingForFingerprint();
|
||||
}
|
||||
} else {
|
||||
// There's something wrong with the enrollment flow, this should never happen.
|
||||
throw new IllegalStateException("HAT and GkPwHandle both missing...");
|
||||
@@ -173,9 +184,6 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
||||
mAnimation = (FingerprintFindSensorAnimation) animationView;
|
||||
}
|
||||
}
|
||||
if (savedInstanceState != null) {
|
||||
mNextClicked = savedInstanceState.getBoolean(SAVED_STATE_IS_NEXT_CLICKED, mNextClicked);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -297,6 +305,7 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
||||
return;
|
||||
}
|
||||
}
|
||||
mSidecar.setListener(null);
|
||||
getSupportFragmentManager().beginTransaction().remove(mSidecar).
|
||||
commitAllowingStateLoss();
|
||||
mSidecar = null;
|
||||
|
@@ -50,6 +50,8 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
||||
static final String FINGERPRINT_SUGGESTION_ACTIVITY =
|
||||
"com.android.settings.SetupFingerprintSuggestionActivity";
|
||||
|
||||
private boolean mIsAddAnotherOrFinish;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -107,9 +109,23 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
||||
// Reset it to false every time activity back to fg because this flag is stateless between
|
||||
// different life cycle.
|
||||
mIsAddAnotherOrFinish = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNextButtonClick(View view) {
|
||||
updateFingerprintSuggestionEnableState();
|
||||
finishAndToNext();
|
||||
}
|
||||
|
||||
private void finishAndToNext() {
|
||||
mIsAddAnotherOrFinish = true;
|
||||
setResult(RESULT_FINISHED);
|
||||
if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
|
||||
postEnroll();
|
||||
@@ -145,20 +161,21 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
||||
}
|
||||
|
||||
private void onAddAnotherButtonClick(View view) {
|
||||
mIsAddAnotherOrFinish = true;
|
||||
startActivityForResult(getFingerprintEnrollingIntent(), BiometricUtils.REQUEST_ADD_ANOTHER);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldFinishWhenBackgrounded() {
|
||||
return !isFinishing() && super.shouldFinishWhenBackgrounded();
|
||||
return !mIsAddAnotherOrFinish && super.shouldFinishWhenBackgrounded();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
updateFingerprintSuggestionEnableState();
|
||||
if (requestCode == BiometricUtils.REQUEST_ADD_ANOTHER && resultCode != RESULT_CANCELED) {
|
||||
setResult(resultCode, data);
|
||||
finish();
|
||||
// If user cancel during "Add another", just use similar flow on "Next" button
|
||||
finishAndToNext();
|
||||
} else {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user