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

Commit b54d2f38 authored by codeworkx's avatar codeworkx Committed by Louis Popi
Browse files

FingerprintService: add overlay to prevent cleanup of unused fingerprints

Restores Oreo behaviour.

Usage: Set config_cleanupUnusedFingerprints overlay to false

Change-Id: Id032fae5c6ae70ce57a60c6f5d3dbe0a6cd33258
parent a93c9fb6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
         vendor fingerprint HAL implementations. -->
    <bool name="config_fingerprintPostResetRunnableForAllClients">false</bool>

    <!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
    <bool name="config_cleanupUnusedFingerprints">true</bool>

    <!-- The list of components which should be automatically disabled for a specific device.
         Note: this MUST not be used to randomly disable components, ask for approval first! -->
    <string-array name="config_deviceDisabledComponents" translatable="false">
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
    <!-- Post reset runnable for all clients -->
    <java-symbol type="bool" name="config_fingerprintPostResetRunnableForAllClients" />

    <!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
    <java-symbol type="bool" name="config_cleanupUnusedFingerprints" />

    <!-- Package Manager -->
    <java-symbol type="array" name="config_deviceDisabledComponents" />
    <java-symbol type="array" name="config_globallyDisabledComponents" />
+4 −2
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ public abstract class BiometricServiceBase extends SystemService

    protected static final boolean DEBUG = true;

    private static final boolean CLEANUP_UNKNOWN_TEMPLATES = true;
    private static final String KEY_LOCKOUT_RESET_USER = "lockout_reset_user";
    private static final int MSG_USER_SWITCHING = 10;
    private static final long CANCEL_TIMEOUT_LIMIT = 3000; // max wait for onCancel() from HAL,in ms
@@ -85,6 +84,7 @@ public abstract class BiometricServiceBase extends SystemService
    private final UserManager mUserManager;
    private final MetricsLogger mMetricsLogger;
    private final boolean mPostResetRunnableForAllClients;
    private final boolean mCleanupUnusedFingerprints;
    private final BiometricTaskStackListener mTaskStackListener = new BiometricTaskStackListener();
    private final ResetClientStateRunnable mResetClientState = new ResetClientStateRunnable();
    private final ArrayList<LockoutResetMonitor> mLockoutMonitors = new ArrayList<>();
@@ -650,6 +650,8 @@ public abstract class BiometricServiceBase extends SystemService
        mMetricsLogger = new MetricsLogger();
        mPostResetRunnableForAllClients = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_fingerprintPostResetRunnableForAllClients);
        mCleanupUnusedFingerprints = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_cleanupUnusedFingerprints);
    }

    @Override
@@ -1211,7 +1213,7 @@ public abstract class BiometricServiceBase extends SystemService
     * @param userId
     */
    protected void doTemplateCleanupForUser(int userId) {
        if (CLEANUP_UNKNOWN_TEMPLATES) {
        if (mCleanupUnusedFingerprints) {
            enumerateUser(userId);
        }
    }