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

Unverified Commit add9f4dc 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 1d158d6e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -133,6 +133,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() {
@@ -357,6 +359,9 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
        mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
                BiometricsProtoEnums.MODALITY_FINGERPRINT, new BiometricNotificationImpl());

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

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

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