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

Commit 9c32210d authored by LuK1337's avatar LuK1337
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 2ddc752d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@
         true will use SystemClock.elapsedRealtimeNanos() to set timestamp. -->
    <bool name="config_useSystemClockforRotationSensor">false</bool>

    <!-- Whether to post reset runnable for all clients. Needed for some older
         vendor fingerprint HAL implementations. -->
    <bool name="config_fingerprintPostResetRunnableForAllClients">false</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
@@ -30,6 +30,9 @@
    <!-- Rotation sensor -->
    <java-symbol type="bool" name="config_useSystemClockforRotationSensor" />

    <!-- Post reset runnable for all clients -->
    <java-symbol type="bool" name="config_fingerprintPostResetRunnableForAllClients" />

    <!-- Package Manager -->
    <java-symbol type="array" name="config_deviceDisabledComponents" />
    <java-symbol type="array" name="config_globallyDisabledComponents" />
+7 −0
Original line number Diff line number Diff line
@@ -84,6 +84,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<>();
@@ -647,6 +648,8 @@ public abstract class BiometricServiceBase extends SystemService
        mPowerManager = mContext.getSystemService(PowerManager.class);
        mUserManager = UserManager.get(mContext);
        mMetricsLogger = new MetricsLogger();
        mPostResetRunnableForAllClients = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_fingerprintPostResetRunnableForAllClients);
    }

    @Override
@@ -1046,6 +1049,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);