Skip to content

Commit bfbd58d

Browse files
Uriel RodriguezAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug 7338736. Only starting FUL if the screen is on" into jb-mr1-dev
2 parents 1016b28 + 94c7b14 commit bfbd58d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.android.internal.policy.impl.keyguard;
1717

1818
import android.content.Context;
19+
import android.os.PowerManager;
1920
import android.telephony.TelephonyManager;
2021
import android.util.AttributeSet;
2122
import android.util.Log;
@@ -29,7 +30,7 @@
2930

3031
public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecurityView {
3132

32-
private static final String TAG = "KeyguardFaceUnlockView";
33+
private static final String TAG = "FULKeyguardFaceUnlockView";
3334
private static final boolean DEBUG = false;
3435
private KeyguardSecurityCallback mKeyguardSecurityCallback;
3536
private LockPatternUtils mLockPatternUtils;
@@ -139,11 +140,14 @@ private void maybeStartBiometricUnlock() {
139140
final boolean backupIsTimedOut = (
140141
monitor.getFailedUnlockAttempts() >=
141142
LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT);
142-
// TODO: These max attempts checks are also checked in KeyguardSecurityModel so they
143-
// might not be necessary here anymore.
143+
PowerManager powerManager = (PowerManager) mContext.getSystemService(
144+
Context.POWER_SERVICE);
145+
// TODO: Some of these conditions are handled in KeyguardSecurityModel and may not be
146+
// necessary here.
144147
if (monitor.getPhoneState() != TelephonyManager.CALL_STATE_RINGING
145148
&& !monitor.getMaxBiometricUnlockAttemptsReached()
146-
&& !backupIsTimedOut) {
149+
&& !backupIsTimedOut
150+
&& powerManager.isScreenOn()) {
147151
mBiometricUnlock.start();
148152
} else {
149153
mBiometricUnlock.stopAndShowBackup();

0 commit comments

Comments
 (0)