Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f77643be authored by Bill Lin's avatar Bill Lin Committed by Android (Google) Code Review
Browse files

Merge "Remove onWindowFocusChange solution from FPS enrollment" into udc-dev

parents 32614f2b 61935548
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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);