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

Commit 78bc5bff authored by Austin Delgado's avatar Austin Delgado Committed by Android (Google) Code Review
Browse files

Merge "Reset setIgnoreDisplayTouches on UdfpsOverlay show/hide" into main

parents bc1e21e3 7144bd90
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.util.Slog;

import com.android.server.biometrics.log.BiometricContext;
import com.android.server.biometrics.log.BiometricLogger;
import com.android.server.biometrics.sensors.fingerprint.aidl.AidlSession;

import java.util.function.Supplier;

@@ -202,6 +203,16 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement
        }
    }

    // TODO(b/317414324): Deprecate setIgnoreDisplayTouches
    protected final void resetIgnoreDisplayTouches() {
        final AidlSession session = (AidlSession) getFreshDaemon();
        try {
            session.getSession().setIgnoreDisplayTouches(false);
        } catch (RemoteException e) {
            Slog.e(TAG, "Remote exception when resetting setIgnoreDisplayTouches");
        }
    }

    @Override
    public boolean isInterruptable() {
        return true;
+7 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ public class FingerprintAuthenticationClient
        handleLockout(authenticated);
        if (authenticated) {
            mState = STATE_STOPPED;
            resetIgnoreDisplayTouches();
            mSensorOverlays.hide(getSensorId());
            if (sidefpsControllerRefactor()) {
                mAuthenticationStateListeners.onAuthenticationStopped();
@@ -268,6 +269,7 @@ public class FingerprintAuthenticationClient
                // Send the error, but do not invoke the FinishCallback yet. Since lockout is not
                // controlled by the HAL, the framework must stop the sensor before finishing the
                // client.
                resetIgnoreDisplayTouches();
                mSensorOverlays.hide(getSensorId());
                if (sidefpsControllerRefactor()) {
                    mAuthenticationStateListeners.onAuthenticationStopped();
@@ -298,6 +300,7 @@ public class FingerprintAuthenticationClient
            BiometricNotificationUtils.showBadCalibrationNotification(getContext());
        }

        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
@@ -306,6 +309,7 @@ public class FingerprintAuthenticationClient

    @Override
    protected void startHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.show(getSensorId(), getRequestReason(), this);
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStarted(getRequestReason());
@@ -419,6 +423,7 @@ public class FingerprintAuthenticationClient

    @Override
    protected void stopHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
@@ -518,6 +523,7 @@ public class FingerprintAuthenticationClient
            Slog.e(TAG, "Remote exception", e);
        }

        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
@@ -548,6 +554,7 @@ public class FingerprintAuthenticationClient
            Slog.e(TAG, "Remote exception", e);
        }

        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
+2 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public class FingerprintDetectClient extends AcquisitionClient<AidlSession>

    @Override
    protected void stopHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        unsubscribeBiometricContext();

@@ -102,6 +103,7 @@ public class FingerprintDetectClient extends AcquisitionClient<AidlSession>

    @Override
    protected void startHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.show(getSensorId(), BiometricRequestConstants.REASON_AUTH_KEYGUARD,
                this);

+4 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ public class FingerprintEnrollClient extends EnrollClient<AidlSession> implement
                controller -> controller.onEnrollmentProgress(getSensorId(), remaining));

        if (remaining == 0) {
            resetIgnoreDisplayTouches();
            mSensorOverlays.hide(getSensorId());
            if (sidefpsControllerRefactor()) {
                mAuthenticationStateListeners.onAuthenticationStopped();
@@ -178,6 +179,7 @@ public class FingerprintEnrollClient extends EnrollClient<AidlSession> implement
    @Override
    public void onError(int errorCode, int vendorCode) {
        super.onError(errorCode, vendorCode);
        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
@@ -192,6 +194,7 @@ public class FingerprintEnrollClient extends EnrollClient<AidlSession> implement

    @Override
    protected void startHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.show(getSensorId(), getRequestReasonFromEnrollReason(mEnrollReason),
                this);
        if (sidefpsControllerRefactor()) {
@@ -273,6 +276,7 @@ public class FingerprintEnrollClient extends EnrollClient<AidlSession> implement

    @Override
    protected void stopHalOperation() {
        resetIgnoreDisplayTouches();
        mSensorOverlays.hide(getSensorId());
        if (sidefpsControllerRefactor()) {
            mAuthenticationStateListeners.onAuthenticationStopped();
+1 −0
Original line number Diff line number Diff line
@@ -472,6 +472,7 @@ public class FingerprintAuthenticationClientTest {

        verify(mUdfpsOverlayController).hideUdfpsOverlay(anyInt());
        verify(mSideFpsController).hide(anyInt());
        verify(mHal, times(2)).setIgnoreDisplayTouches(false);
    }

    @Test
Loading