Skip to content

Commit cafd387

Browse files
author
Danielle Millett
committed
Moved setting the flag to suppress face unlock during a phone call
Moved the check to suppress face unlock if a call is in progress from onScreenTurnedOff() to initializeBiometricUnlockView(). onScreenTurnedOff() is only called if the screen was turned off while on lockscreen and we actually want to be doing this every time the screen is turned off. Put a check around it to only do it when the screen is off, so that for orientation changes, or on first boot it doesn't override the current flag value. This fixes the following 2 bugs: Bug 6460309: When making a phone call, after the user hangs up and it goes to lockscreen we don't want face unlock to show. In the case where a user makes an outgoing call and the phone goes to sleep by itself during the phone call, when the call is ended face unlock was popping up because it never went through onScreenTurnedOff(). There is a flag to make sure face unlock doesn't come up immediately after booting the phone, which is done by not showing face unlock the first time lockscreen is constructed. But there are a few cases where lockscreen doesn't come up immediately after boot: 1. When the device is factory reset, it goes through the wizard instead of lockscreen. 2. In userdebug if the lock type is set to none. In both of these cases, if face unlock is set up, it doesn't show up on the first time. Setting the phone flag in initializeBiometricUnlockView overrides the initial setting, which is what we want because if the screen has turned off, it isn't the initial lockscreen after boot. Change-Id: Iacafc515f2b594e12c853308c40cd48f3fb83e63
1 parent 70334ac commit cafd387

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,6 @@ public void onScreenTurnedOff() {
532532
if (DEBUG) Log.d(TAG, "screen off");
533533
mScreenOn = false;
534534
mForgotPattern = false;
535-
if (mBiometricUnlock != null) {
536-
mSuppressBiometricUnlock =
537-
mUpdateMonitor.getPhoneState() != TelephonyManager.CALL_STATE_IDLE
538-
|| mHasDialog;
539-
}
540535

541536
// Emulate activity life-cycle for both lock and unlock screen.
542537
if (mLockScreen != null) {
@@ -991,6 +986,17 @@ private void initializeBiometricUnlockView(View view) {
991986
restartBiometricUnlock = mBiometricUnlock.stop();
992987
}
993988

989+
// Prevents biometric unlock from coming up immediately after a phone call or if there
990+
// is a dialog on top of lockscreen. It is only updated if the screen is off because if the
991+
// screen is on it's either because of an orientation change, or when it first boots.
992+
// In both those cases, we don't want to override the current value of
993+
// mSuppressBiometricUnlock and instead want to use the previous value.
994+
if (!mScreenOn) {
995+
mSuppressBiometricUnlock =
996+
mUpdateMonitor.getPhoneState() != TelephonyManager.CALL_STATE_IDLE
997+
|| mHasDialog;
998+
}
999+
9941000
// If the biometric unlock is not being used, we don't bother constructing it. Then we can
9951001
// simply check if it is null when deciding whether we should make calls to it.
9961002
mBiometricUnlock = null;

0 commit comments

Comments
 (0)