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

Commit 9b46e8da authored by Diya Bera's avatar Diya Bera Committed by Android (Google) Code Review
Browse files

Merge "Biometric Scheduler Watchdog"

parents 4aafac05 b1941f80
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -768,6 +768,20 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        }
    }

    /**
     * Schedules a watchdog.
     *
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void scheduleWatchdog() {
        try {
            mService.scheduleWatchdog();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    private void cancelEnrollment(long requestId) {
        if (mService != null) {
            try {
+5 −0
Original line number Diff line number Diff line
@@ -172,4 +172,9 @@ interface IFaceService {

    // Registers BiometricStateListener.
    void registerBiometricStateListener(IBiometricStateListener listener);

    // Internal operation used to clear face biometric scheduler.
    // Ensures that the scheduler is not stuck.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void scheduleWatchdog();
}
+14 −0
Original line number Diff line number Diff line
@@ -1124,6 +1124,20 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        return BIOMETRIC_LOCKOUT_NONE;
    }

    /**
     * Schedules a watchdog.
     *
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void scheduleWatchdog() {
        try {
            mService.scheduleWatchdog();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     */
+5 −0
Original line number Diff line number Diff line
@@ -208,4 +208,9 @@ interface IFingerprintService {
    // Sends a power button pressed event to all listeners.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    oneway void onPowerPressed();

    // Internal operation used to clear fingerprint biometric scheduler.
    // Ensures that the scheduler is not stuck.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void scheduleWatchdog();
}
+13 −1
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
@@ -3796,4 +3795,17 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        }
        mListenModels.print(pw);
    }

    /**
     * Schedules a watchdog for the face and fingerprint BiometricScheduler.
     * Cancels all operations in the scheduler if it is hung for 10 seconds.
     */
    public void startBiometricWatchdog() {
        if (mFaceManager != null) {
            mFaceManager.scheduleWatchdog();
        }
        if (mFpm != null) {
            mFpm.scheduleWatchdog();
        }
    }
}
Loading