Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +10 −24 Original line number Diff line number Diff line Loading @@ -539,7 +539,6 @@ public class KeyguardIndicationController implements StateListener { protected class BaseKeyguardCallback extends KeyguardUpdateMonitorCallback { public static final int HIDE_DELAY_MS = 5000; private int mLastSuccessiveErrorMessage = -1; @Override public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { Loading Loading @@ -577,20 +576,14 @@ public class KeyguardIndicationController implements StateListener { if (!updateMonitor.isUnlockingWithBiometricAllowed()) { return; } animatePadlockError(); if (mStatusBarKeyguardViewManager.isBouncerShowing()) { mStatusBarKeyguardViewManager.showBouncerMessage(helpString, mInitialTextColorState); } else if (updateMonitor.isScreenOn()) { mLockIcon.setTransientBiometricsError(true); showTransientIndication(helpString); hideTransientIndicationDelayed(TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG); mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG), TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); } // Help messages indicate that there was actually a try since the last error, so those // are not two successive error messages anymore. mLastSuccessiveErrorMessage = -1; } @Override Loading @@ -600,15 +593,9 @@ public class KeyguardIndicationController implements StateListener { if (shouldSuppressBiometricError(msgId, biometricSourceType, updateMonitor)) { return; } animatePadlockError(); if (mStatusBarKeyguardViewManager.isBouncerShowing()) { // When swiping up right after receiving a biometric error, the bouncer calls // authenticate leading to the same message being shown again on the bouncer. // We want to avoid this, as it may confuse the user when the message is too // generic. if (mLastSuccessiveErrorMessage != msgId) { mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState); } mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState); } else if (updateMonitor.isScreenOn()) { showTransientIndication(errString); // We want to keep this message around in case the screen was off Loading @@ -616,7 +603,13 @@ public class KeyguardIndicationController implements StateListener { } else { mMessageToShowOnScreenOn = errString; } mLastSuccessiveErrorMessage = msgId; } private void animatePadlockError() { mLockIcon.setTransientBiometricsError(true); mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG); mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG), TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); } private boolean shouldSuppressBiometricError(int msgId, Loading Loading @@ -670,16 +663,9 @@ public class KeyguardIndicationController implements StateListener { @Override public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType) { super.onBiometricAuthenticated(userId, biometricSourceType); mLastSuccessiveErrorMessage = -1; mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT); } @Override public void onBiometricAuthFailed(BiometricSourceType biometricSourceType) { super.onBiometricAuthFailed(biometricSourceType); mLastSuccessiveErrorMessage = -1; } @Override public void onUserUnlocked() { if (mVisible) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +10 −24 Original line number Diff line number Diff line Loading @@ -539,7 +539,6 @@ public class KeyguardIndicationController implements StateListener { protected class BaseKeyguardCallback extends KeyguardUpdateMonitorCallback { public static final int HIDE_DELAY_MS = 5000; private int mLastSuccessiveErrorMessage = -1; @Override public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { Loading Loading @@ -577,20 +576,14 @@ public class KeyguardIndicationController implements StateListener { if (!updateMonitor.isUnlockingWithBiometricAllowed()) { return; } animatePadlockError(); if (mStatusBarKeyguardViewManager.isBouncerShowing()) { mStatusBarKeyguardViewManager.showBouncerMessage(helpString, mInitialTextColorState); } else if (updateMonitor.isScreenOn()) { mLockIcon.setTransientBiometricsError(true); showTransientIndication(helpString); hideTransientIndicationDelayed(TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG); mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG), TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); } // Help messages indicate that there was actually a try since the last error, so those // are not two successive error messages anymore. mLastSuccessiveErrorMessage = -1; } @Override Loading @@ -600,15 +593,9 @@ public class KeyguardIndicationController implements StateListener { if (shouldSuppressBiometricError(msgId, biometricSourceType, updateMonitor)) { return; } animatePadlockError(); if (mStatusBarKeyguardViewManager.isBouncerShowing()) { // When swiping up right after receiving a biometric error, the bouncer calls // authenticate leading to the same message being shown again on the bouncer. // We want to avoid this, as it may confuse the user when the message is too // generic. if (mLastSuccessiveErrorMessage != msgId) { mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState); } mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState); } else if (updateMonitor.isScreenOn()) { showTransientIndication(errString); // We want to keep this message around in case the screen was off Loading @@ -616,7 +603,13 @@ public class KeyguardIndicationController implements StateListener { } else { mMessageToShowOnScreenOn = errString; } mLastSuccessiveErrorMessage = msgId; } private void animatePadlockError() { mLockIcon.setTransientBiometricsError(true); mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG); mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG), TRANSIENT_BIOMETRIC_ERROR_TIMEOUT); } private boolean shouldSuppressBiometricError(int msgId, Loading Loading @@ -670,16 +663,9 @@ public class KeyguardIndicationController implements StateListener { @Override public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType) { super.onBiometricAuthenticated(userId, biometricSourceType); mLastSuccessiveErrorMessage = -1; mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT); } @Override public void onBiometricAuthFailed(BiometricSourceType biometricSourceType) { super.onBiometricAuthFailed(biometricSourceType); mLastSuccessiveErrorMessage = -1; } @Override public void onUserUnlocked() { if (mVisible) { Loading