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

Unverified Commit db9faf13 authored by Quallenauge's avatar Quallenauge Committed by Michael Bestas
Browse files

Biometrics: Allow disabling of fingerprint cleanups

Don't schedule cleanups at all if the driver
doesn't support enumerate function.

Change-Id: If9e1b82bc551e2fd06218b1720f5986633c1ab55
parent 55afa891
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
    private final int mSensorId;
    private final boolean mIsPowerbuttonFps;

    private boolean mCleanup;

    private final class BiometricTaskStackListener extends TaskStackListener {
        @Override
        public void onTaskStackChanged() {
@@ -349,6 +351,9 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
            mCurrentUserId = UserHandle.USER_NULL;
        });

        mCleanup = context.getResources().getBoolean(
                org.lineageos.platform.internal.R.bool.config_cleanupUnusedFingerprints);

        try {
            ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
        } catch (RemoteException e) {
@@ -729,6 +734,9 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider

    private void scheduleInternalCleanup(int userId,
            @Nullable ClientMonitorCallback callback) {
        if (!mCleanup) {
            return;
        }
        mHandler.post(() -> {
            scheduleUpdateActiveUserWithoutHandler(userId);