From f6d61c64fb173aa7a1415870d5fdfe730eaa4160 Mon Sep 17 00:00:00 2001 From: Brian Colonna Date: Wed, 18 Apr 2012 22:42:42 -0400 Subject: [PATCH] Fix: refreshBatteryInfo was uncovering backup The onRefreshBatteryInfo() function hides the biometric sensor area so the biometric sensor isn't shown when the screen turns on during a plug/unplug. However, sometimes the function is called when there is no plug/unplug. This fix makes it only hide the biometric sensor area (thus exposing the backup lock) on plug/unplug. Note that this does not fix b/5465535 although it may help reduce its frequency. Change-Id: Iccff382c23d71257593dc1595ed8fec57adaf5bd --- .../policy/impl/LockPatternKeyguardView.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index 10c338108f9c2..679158d974b8c 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -667,20 +667,21 @@ public class LockPatternKeyguardView extends KeyguardViewBase { InfoCallbackImpl mInfoCallback = new InfoCallbackImpl() { - /** - * When somebody plugs in or unplugs the device, we don't want to display the biometric - * unlock. - */ @Override public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel) { - mSupressBiometricUnlock |= mPluggedIn != pluggedIn; - mPluggedIn = pluggedIn; - // If it's already running, don't close it down: the unplug didn't start it - if (!mBiometricUnlock.isRunning()) { + // When someone plugs in or unplugs the device, we hide the biometric sensor area and + // suppress its startup for the next onScreenTurnedOn(). Since plugging/unplugging + // causes the screen to turn on, the biometric unlock would start if it wasn't + // suppressed. + // + // However, if the biometric unlock is already running, we do not want to interrupt it. + if (mPluggedIn != pluggedIn && !mBiometricUnlock.isRunning()) { mBiometricUnlock.stop(); mBiometricUnlock.hide(); + mSupressBiometricUnlock = true; } + mPluggedIn = pluggedIn; } @Override