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

Commit f4732f21 authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge "Move synchronous generateChallenge to implementation-specific classes"

parents e3c1e22e 0b24037d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ public abstract class GenerateChallengeClient<T> extends ClientMonitor<T> {

    private static final String TAG = "GenerateChallengeClient";

    protected long mChallenge;

    public GenerateChallengeClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
            @NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
            @NonNull String owner, int sensorId) {
@@ -51,12 +49,5 @@ public abstract class GenerateChallengeClient<T> extends ClientMonitor<T> {
        super.start(callback);

        startHalOperation();
        try {
            getListener().onChallengeGenerated(getSensorId(), mChallenge);
            mCallback.onClientFinished(this, true /* success */);
        } catch (RemoteException e) {
            Slog.e(TAG, "Remote exception", e);
            mCallback.onClientFinished(this, false /* success */);
        }
    }
}
+8 −1
Original line number Diff line number Diff line
@@ -59,7 +59,14 @@ public class FaceGenerateChallengeClient extends GenerateChallengeClient<IBiomet
    @Override
    protected void startHalOperation() {
        try {
            mChallenge = getFreshDaemon().generateChallenge(CHALLENGE_TIMEOUT_SEC).value;
            final long challenge = getFreshDaemon().generateChallenge(CHALLENGE_TIMEOUT_SEC).value;
            try {
                getListener().onChallengeGenerated(getSensorId(), challenge);
                mCallback.onClientFinished(this, true /* success */);
            } catch (RemoteException e) {
                Slog.e(TAG, "Remote exception", e);
                mCallback.onClientFinished(this, false /* success */);
            }
        } catch (RemoteException e) {
            Slog.e(TAG, "generateChallenge failed", e);
        }
+8 −1
Original line number Diff line number Diff line
@@ -45,7 +45,14 @@ public class FingerprintGenerateChallengeClient
    @Override
    protected void startHalOperation() {
        try {
            mChallenge = getFreshDaemon().preEnroll();
            final long challenge = getFreshDaemon().preEnroll();
            try {
                getListener().onChallengeGenerated(getSensorId(), challenge);
                mCallback.onClientFinished(this, true /* success */);
            } catch (RemoteException e) {
                Slog.e(TAG, "Remote exception", e);
                mCallback.onClientFinished(this, false /* success */);
            }
        } catch (RemoteException e) {
            Slog.e(TAG, "preEnroll failed", e);
        }