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

Commit f984fa0a authored by LuK1337's avatar LuK1337 Committed by Bruno Martins
Browse files

biometrics: Allow posting reset runnable for all clients

 * After commit df755c8b, some devices fail to enumerate for
   unknown reason (likely a HAL issue). Add an overlay to
   restore old behavior and thus workaround this issue.

Change-Id: Ib0d00d5987aa7f68a5c7efa785859e8eb208651d
parent cf0a4677
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public abstract class BiometricServiceBase extends SystemService
    private final PowerManager mPowerManager;
    private final UserManager mUserManager;
    private final MetricsLogger mMetricsLogger;
    private final boolean mPostResetRunnableForAllClients;
    private final BiometricTaskStackListener mTaskStackListener = new BiometricTaskStackListener();
    private final ResetClientStateRunnable mResetClientState = new ResetClientStateRunnable();
    private final ArrayList<LockoutResetMonitor> mLockoutMonitors = new ArrayList<>();
@@ -662,6 +663,9 @@ public abstract class BiometricServiceBase extends SystemService
        mPowerManager = mContext.getSystemService(PowerManager.class);
        mUserManager = UserManager.get(mContext);
        mMetricsLogger = new MetricsLogger();
        mPostResetRunnableForAllClients = mContext.getResources().getBoolean(
                org.lineageos.platform.internal.R.bool
                        .config_fingerprintPostResetRunnableForAllClients);
    }

    @Override
@@ -1096,6 +1100,10 @@ public abstract class BiometricServiceBase extends SystemService
                            + "(" + newClient.getOwnerString() + ")"
                            + ", initiatedByClient = " + initiatedByClient);
                }
                if (mPostResetRunnableForAllClients) {
                    mHandler.removeCallbacks(mResetClientState);
                    mHandler.postDelayed(mResetClientState, CANCEL_TIMEOUT_LIMIT);
                }
            } else {
                currentClient.stop(initiatedByClient);