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

Commit d3e7b649 authored by Chandru S's avatar Chandru S
Browse files

Clear the previous biometric message only after the next face acquisition starts again.

Bug: 340398696
Test: verified manually,
  1. Enroll face auth
  2. Disable camera using privacy toggle
  3. Go to lockscreen
  4. The error message should be displayed only once and should not flash again and again
Flag: NONE bugfix
Change-Id: I8bc5bb2577e896f23634b6857b652394a9a34b51
parent 941e4e94
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.adaptiveauth.Flags.enableAdaptiveAuth;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;
import static android.app.admin.DevicePolicyResources.Strings.SystemUi.KEYGUARD_MANAGEMENT_DISCLOSURE;
import static android.app.admin.DevicePolicyResources.Strings.SystemUi.KEYGUARD_NAMED_MANAGEMENT_DISCLOSURE;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DARK;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT;
import static android.hardware.biometrics.BiometricSourceType.FACE;
@@ -1296,6 +1297,12 @@ public class KeyguardIndicationController {
        @Override
        public void onBiometricAcquired(BiometricSourceType biometricSourceType, int acquireInfo) {
            if (biometricSourceType == FACE) {
                if (acquireInfo == FACE_ACQUIRED_START) {
                    // Let's hide any previous messages when authentication starts, otherwise
                    // multiple auth attempts would overlap.
                    hideBiometricMessage();
                    mBiometricErrorMessageToShowOnScreenOn = null;
                }
                mFaceAcquiredMessageDeferral.processFrame(acquireInfo);
            }
        }
@@ -1485,13 +1492,6 @@ public class KeyguardIndicationController {
        @Override
        public void onBiometricRunningStateChanged(boolean running,
                BiometricSourceType biometricSourceType) {
            if (running && biometricSourceType == FACE) {
                // Let's hide any previous messages when authentication starts, otherwise
                // multiple auth attempts would overlap.
                hideBiometricMessage();
                mBiometricErrorMessageToShowOnScreenOn = null;
            }

            if (!running && biometricSourceType == FACE) {
                showTrustAgentErrorMessage(mTrustAgentErrorMessage);
            }