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

Commit c390a897 authored by Joe Bolinger's avatar Joe Bolinger Committed by Automerger Merge Worker
Browse files

Merge changes from topic "presubmit-am-f2950471d1a747418b586b3c237b5a50" into...

Merge changes from topic "presubmit-am-f2950471d1a747418b586b3c237b5a50" into sc-v2-dev am: d9fa19e0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16681227

Change-Id: Icb1cddfd0d2a37af5e64c70ce085b6a9770c849c
parents 084c7daa d9fa19e0
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.hardware.biometrics.IBiometricService;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Slog;
@@ -232,17 +233,14 @@ public class BiometricScheduler {
     * Creates a new scheduler.
     *
     * @param tag for the specific instance of the scheduler. Should be unique.
     * @param handler handler for callbacks (all methods of this class must be called on the
     *                thread associated with this handler)
     * @param sensorType the sensorType that this scheduler is handling.
     * @param gestureAvailabilityDispatcher may be null if the sensor does not support gestures
     *                                      (such as fingerprint swipe).
     */
    public BiometricScheduler(@NonNull String tag,
            @NonNull Handler handler,
            @SensorType int sensorType,
            @Nullable GestureAvailabilityDispatcher gestureAvailabilityDispatcher) {
        this(tag, handler, sensorType, gestureAvailabilityDispatcher,
        this(tag, new Handler(Looper.getMainLooper()), sensorType, gestureAvailabilityDispatcher,
                IBiometricService.Stub.asInterface(
                        ServiceManager.getService(Context.BIOMETRIC_SERVICE)),
                LOG_NUM_RECENT_OPERATIONS, CoexCoordinator.getInstance());
@@ -376,8 +374,9 @@ public class BiometricScheduler {
        // send ERROR_CANCELED and skip the operation.
        if (clientMonitor.interruptsPrecedingClients()) {
            for (BiometricSchedulerOperation operation : mPendingOperations) {
                if (operation.markCanceling()) {
                    Slog.d(getTag(), "New client, marking pending op as canceling: " + operation);
                operation.markCanceling();
                }
            }
        }

+5 −3
Original line number Diff line number Diff line
@@ -225,12 +225,13 @@ public class BiometricSchedulerOperation {
        Slog.v(TAG, "Aborted: " + this);
    }

    /** Flags this operation as canceled, but does not cancel it until started. */
    public void markCanceling() {
    /** Flags this operation as canceled, if possible, but does not cancel it until started. */
    public boolean markCanceling() {
        if (mState == STATE_WAITING_IN_QUEUE && isInterruptable()) {
            mState = STATE_WAITING_IN_QUEUE_CANCELING;
            Slog.v(TAG, "Marked cancelling: " + this);
            return true;
        }
        return false;
    }

    /**
@@ -280,6 +281,7 @@ public class BiometricSchedulerOperation {
            @Override
            public void onClientFinished(@NonNull BaseClientMonitor clientMonitor,
                    boolean success) {
                Slog.d(TAG, "[Finished / destroy]: " + clientMonitor);
                mClientMonitor.destroy();
                mState = STATE_FINISHED;
            }
+3 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.hardware.biometrics.IBiometricService;
import android.os.Handler;
import android.os.Looper;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.util.Slog;
@@ -85,7 +86,7 @@ public class UserAwareBiometricScheduler extends BiometricScheduler {
    }

    @VisibleForTesting
    UserAwareBiometricScheduler(@NonNull String tag,
    public UserAwareBiometricScheduler(@NonNull String tag,
            @NonNull Handler handler,
            @SensorType int sensorType,
            @Nullable GestureAvailabilityDispatcher gestureAvailabilityDispatcher,
@@ -101,12 +102,11 @@ public class UserAwareBiometricScheduler extends BiometricScheduler {
    }

    public UserAwareBiometricScheduler(@NonNull String tag,
            @NonNull Handler handler,
            @SensorType int sensorType,
            @Nullable GestureAvailabilityDispatcher gestureAvailabilityDispatcher,
            @NonNull CurrentUserRetriever currentUserRetriever,
            @NonNull UserSwitchCallback userSwitchCallback) {
        this(tag, handler, sensorType, gestureAvailabilityDispatcher,
        this(tag, new Handler(Looper.getMainLooper()), sensorType, gestureAvailabilityDispatcher,
                IBiometricService.Stub.asInterface(
                        ServiceManager.getService(Context.BIOMETRIC_SERVICE)),
                currentUserRetriever, userSwitchCallback, CoexCoordinator.getInstance());
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ public class Sensor {
        mToken = new Binder();
        mHandler = handler;
        mSensorProperties = sensorProperties;
        mScheduler = new UserAwareBiometricScheduler(tag, mHandler,
        mScheduler = new UserAwareBiometricScheduler(tag,
                BiometricScheduler.SENSOR_TYPE_FACE, null /* gestureAvailabilityDispatcher */,
                () -> mCurrentSession != null ? mCurrentSession.mUserId : UserHandle.USER_NULL,
                new UserAwareBiometricScheduler.UserSwitchCallback() {
+3 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider {
            @NonNull LockoutResetDispatcher lockoutResetDispatcher) {
        final Handler handler = new Handler(Looper.getMainLooper());
        return new Face10(context, sensorProps, lockoutResetDispatcher, handler,
                new BiometricScheduler(TAG, handler, BiometricScheduler.SENSOR_TYPE_FACE,
                new BiometricScheduler(TAG, BiometricScheduler.SENSOR_TYPE_FACE,
                        null /* gestureAvailabilityTracker */));
    }

@@ -896,6 +896,8 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider {
                    boolean success) {
                if (success) {
                    mCurrentUserId = targetUserId;
                } else {
                    Slog.w(TAG, "Failed to change user, still: " + mCurrentUserId);
                }
            }
        });
Loading