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

Commit d3d1c558 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 95f4f14e 37368581
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
    }