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

Commit f29f63dc authored by codeworkx's avatar codeworkx Committed by Bruno Martins
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 bfcd52d3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
<!--
     Copyright (C) 2012-2015 The CyanogenMod Project
     Copyright (C) 2017 The LineageOS Project
     Copyright (C) 2017-2018 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -33,4 +33,7 @@

    <!-- Whether notify fingerprint client of successful cancelled authentication -->
    <bool name="config_notifyClientOnFingerprintCancelSuccess">false</bool>

    <!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
    <bool name="config_cleanupUnusedFingerprints">true</bool>
</resources>
+4 −1
Original line number Diff line number Diff line
<!--
     Copyright (C) 2012-2015 The CyanogenMod Project
     Copyright (C) 2017 The LineageOS Project
     Copyright (C) 2017-2018 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -33,4 +33,7 @@

    <!-- Whether notify fingerprint client of successful cancelled authentication -->
    <java-symbol type="bool" name="config_notifyClientOnFingerprintCancelSuccess" />

    <!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
    <java-symbol type="bool" name="config_cleanupUnusedFingerprints" />
</resources>
+4 −2
Original line number Diff line number Diff line
@@ -101,7 +101,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
public class FingerprintService extends SystemService implements IHwBinder.DeathRecipient {
    static final String TAG = "FingerprintService";
    static final boolean DEBUG = true;
    private static final boolean CLEANUP_UNUSED_FP = true;
    private static final String FP_DATA_DIR = "fpdata";
    private static final int MSG_USER_SWITCHING = 10;
    private static final String ACTION_LOCKOUT_RESET =
@@ -147,6 +146,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
    private ClientMonitor mPendingClient;
    private PerformanceStats mPerformanceStats;
    private final boolean mNotifyClient;
    private final boolean mCleanupUnusedFingerprints;

    private IBinder mToken = new Binder(); // used for internal FingerprintService enumeration
    private ArrayList<UserFingerprint> mUnknownFingerprints = new ArrayList<>(); // hw fingerprints
@@ -264,6 +264,8 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
                .getService();
        mNotifyClient = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_notifyClientOnFingerprintCancelSuccess);
        mCleanupUnusedFingerprints = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_cleanupUnusedFingerprints);
    }

    @Override
@@ -336,7 +338,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
     * @param userId
     */
    private void doFingerprintCleanupForUser(int userId) {
        if (CLEANUP_UNUSED_FP) {
        if (mCleanupUnusedFingerprints) {
            enumerateUser(userId);
        }
    }