Merge "Remove onWindowFocusChange solution from FPS enrollment" into udc-dev
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.settings.biometrics.fingerprint;
|
||||
|
||||
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_USER_CANCELED;
|
||||
import static android.text.Layout.HYPHENATION_FREQUENCY_NONE;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -191,7 +190,6 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
private boolean mRestoring;
|
||||
private Vibrator mVibrator;
|
||||
private boolean mIsSetupWizard;
|
||||
private boolean mIsOrientationChanged;
|
||||
@VisibleForTesting
|
||||
boolean mIsCanceled;
|
||||
private AccessibilityManager mAccessibilityManager;
|
||||
@@ -224,25 +222,6 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
return defaultDensity == currentDensity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
if (hasFocus || mIsCanceled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// By UX design, we should ensure seamless enrollment CUJ even though user rotate device.
|
||||
// Do NOT cancel enrollment progress after rotating, adding mIsOrientationChanged
|
||||
// to judge if the focus changed was triggered by rotation, current WMS has triple callbacks
|
||||
// (true > false > true), we need to reset mIsOrientationChanged when !hasFocus callback.
|
||||
// Side fps do not have to synchronize udfpsController overlay state, we should bypass sfps
|
||||
// from onWindowFocusChanged() as long press sfps power key will prompt dialog to users.
|
||||
if (!mIsOrientationChanged && !mCanAssumeSfps) {
|
||||
onCancelEnrollment(FINGERPRINT_ERROR_USER_CANCELED);
|
||||
} else {
|
||||
mIsOrientationChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
|
||||
theme.applyStyle(R.style.SetupWizardPartnerResource, true);
|
||||
@@ -493,7 +472,6 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
mIsCanceled = savedInstanceState.getBoolean(KEY_STATE_CANCELED, false);
|
||||
mPreviousRotation = savedInstanceState.getInt(KEY_STATE_PREVIOUS_ROTATION,
|
||||
getDisplay().getRotation());
|
||||
mIsOrientationChanged = mPreviousRotation != getDisplay().getRotation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -537,7 +515,6 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
// before showErrorDialog() to prevent that another error dialog is triggered again.
|
||||
mIsCanceled = true;
|
||||
FingerprintErrorDialog.showErrorDialog(this, errorMsgId, mCanAssumeUdfps);
|
||||
mIsOrientationChanged = false;
|
||||
cancelEnrollment();
|
||||
stopIconAnimation();
|
||||
stopListenOrientationEvent();
|
||||
|
@@ -158,7 +158,7 @@ public class FingerprintEnrollEnrollingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fingerprintUdfpsOverlayEnrollment_loseFocus_shouldCancel() {
|
||||
public void fingerprintUdfpsOverlayEnrollment_loseFocus_shouldNotCancel() {
|
||||
initializeActivityFor(TYPE_UDFPS_OPTICAL);
|
||||
|
||||
mActivity.onEnrollmentProgressChange(1, 1);
|
||||
|
Reference in New Issue
Block a user