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

Commit 6f9bf171 authored by Bill Lin's avatar Bill Lin Committed by Automerger Merge Worker
Browse files

Merge "Fix regression of pressing power key cancel sfps enrollment" into...

Merge "Fix regression of pressing power key cancel sfps enrollment" into tm-qpr-dev am: b9263732 am: 37785c81

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19880527



Change-Id: Id4de390f6bf0276795ca1f73759a2172e25ef7e7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e65c21a7 37785c81
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -203,7 +203,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
        // 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.
        if (!mIsOrientationChanged) {
        // 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;
+10 −0
Original line number Diff line number Diff line
@@ -222,6 +222,16 @@ public class FingerprintEnrollEnrollingTest {
        );
    }

    @Test
    public void fingerprintSfpsEnrollment_loseFocus_shouldNotCancel() {
        initializeActivityFor(FingerprintSensorProperties.TYPE_POWER_BUTTON);

        mActivity.onEnrollmentProgressChange(1, 1);
        mActivity.onWindowFocusChanged(true);

        verify(mActivity, never()).onCancelEnrollment(anyInt());
    }

    private void initializeActivityFor(int sensorType) {
        final List<ComponentInfoInternal> componentInfo = new ArrayList<>();
        final FingerprintSensorPropertiesInternal prop =