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

Commit 0b629b6a authored by Kevin Chyn's avatar Kevin Chyn Committed by android-build-merger
Browse files

Merge "ClientMonitor should only send cancel() once to fp daemon" into oc-dev am: d3d1c558

am: 69f082fc

Change-Id: Idc4175302e5fefb8656aea0dade652605420aa6e
parents a39fefc2 69f082fc
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@ public abstract class AuthenticationClient extends ClientMonitor {
    public static final int LOCKOUT_TIMED = 1;
    public static final int LOCKOUT_PERMANENT = 2;

    private boolean mAlreadyCancelled;

    public AuthenticationClient(Context context, long halDeviceId, IBinder token,
            IFingerprintServiceReceiver receiver, int targetUserId, int groupId, long opId,
            boolean restricted, String owner) {
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
    private String mOwner;
    private Context mContext;
    private long mHalDeviceId;
    protected boolean mAlreadyCancelled;

    /**
     * @param context context of FingerprintService
+5 −0
Original line number Diff line number Diff line
@@ -100,6 +100,10 @@ public abstract class EnrollClient extends ClientMonitor {

    @Override
    public int stop(boolean initiatedByClient) {
        if (mAlreadyCancelled) {
            Slog.w(TAG, "stopEnroll: already cancelled!");
            return 0;
        }
        IBiometricsFingerprint daemon = getFingerprintDaemon();
        if (daemon == null) {
            Slog.w(TAG, "stopEnrollment: no fingerprint HAL!");
@@ -117,6 +121,7 @@ public abstract class EnrollClient extends ClientMonitor {
        if (initiatedByClient) {
            onError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, 0 /* vendorCode */);
        }
        mAlreadyCancelled = true;
        return 0;
    }

+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ public abstract class EnumerateClient extends ClientMonitor {

    @Override
    public int stop(boolean initiatedByClient) {
        if (mAlreadyCancelled) {
            Slog.w(TAG, "stopEnumerate: already cancelled!");
            return 0;
        }
        IBiometricsFingerprint daemon = getFingerprintDaemon();
        if (daemon == null) {
            Slog.w(TAG, "stopEnumeration: no fingerprint HAL!");
@@ -77,6 +81,7 @@ public abstract class EnumerateClient extends ClientMonitor {
        if (initiatedByClient) {
            onError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, 0 /* vendorCode */);
        }
        mAlreadyCancelled = true;
        return 0; // success
    }

+5 −0
Original line number Diff line number Diff line
@@ -59,6 +59,10 @@ public abstract class RemovalClient extends ClientMonitor {

    @Override
    public int stop(boolean initiatedByClient) {
        if (mAlreadyCancelled) {
            Slog.w(TAG, "stopRemove: already cancelled!");
            return 0;
        }
        IBiometricsFingerprint daemon = getFingerprintDaemon();
        if (daemon == null) {
            Slog.w(TAG, "stopRemoval: no fingerprint HAL!");
@@ -75,6 +79,7 @@ public abstract class RemovalClient extends ClientMonitor {
            Slog.e(TAG, "stopRemoval failed", e);
            return ERROR_ESRCH;
        }
        mAlreadyCancelled = true;
        return 0; // success
    }