SystemUI: Restore 14 QPR1 FingerprintInteractiveToAuth handling

NOTE: This is modified to allow interactive to auth for all non-udfps
sensors.

Change-Id: I169435e755c68433955f5f6185c3fa74400fca64
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 9c61a8a..7343fe2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -2773,9 +2773,14 @@
                 && !strongerAuthRequired
                 && userDoesNotHaveTrust);
 
+        final boolean shouldListenFpsState = isUdfps
+                || mFingerprintInteractiveToAuthProvider == null
+                || !mFingerprintInteractiveToAuthProvider.isEnabled(user)
+                || (isDeviceInteractive() && !mGoingToSleep);
 
         boolean shouldListen = shouldListenKeyguardState && shouldListenUserState
-                && shouldListenBouncerState && shouldListenUdfpsState && !mBiometricPromptShowing;
+                && shouldListenBouncerState && shouldListenUdfpsState && !mBiometricPromptShowing
+                && shouldListenFpsState;
         logListenerModelData(
                 new KeyguardFingerprintListenModel(
                     System.currentTimeMillis(),
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.kt b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.kt
index 6e29fa5..95ec503 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.kt
@@ -36,4 +36,10 @@
      * @return Vendor extension if needed for authentication.
      */
     fun getVendorExtension(userId: Int): AuthenticateReason.Vendor?
+
+    /**
+     * @param userId the user Id.
+     * @return true if the InteractiveToAuthFeature is enabled, false if disabled.
+     */
+    fun isEnabled(userId: Int): Boolean
 }
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt
index cc0109d..06fba6f 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt
@@ -62,7 +62,7 @@
 
     override fun getVendorExtension(userId: Int): AuthenticateReason.Vendor? = null
 
-    private fun isEnabled(userId: Int): Boolean {
+    override fun isEnabled(userId: Int): Boolean {
         var value = Settings.Secure.getIntForUser(
             context.contentResolver,
             Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED,