|
16 | 16 | package com.android.internal.policy.impl.keyguard; |
17 | 17 |
|
18 | 18 | import android.content.Context; |
| 19 | +import android.os.PowerManager; |
19 | 20 | import android.telephony.TelephonyManager; |
20 | 21 | import android.util.AttributeSet; |
21 | 22 | import android.util.Log; |
|
29 | 30 |
|
30 | 31 | public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecurityView { |
31 | 32 |
|
32 | | - private static final String TAG = "KeyguardFaceUnlockView"; |
| 33 | + private static final String TAG = "FULKeyguardFaceUnlockView"; |
33 | 34 | private static final boolean DEBUG = false; |
34 | 35 | private KeyguardSecurityCallback mKeyguardSecurityCallback; |
35 | 36 | private LockPatternUtils mLockPatternUtils; |
@@ -139,11 +140,14 @@ private void maybeStartBiometricUnlock() { |
139 | 140 | final boolean backupIsTimedOut = ( |
140 | 141 | monitor.getFailedUnlockAttempts() >= |
141 | 142 | 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. |
144 | 147 | if (monitor.getPhoneState() != TelephonyManager.CALL_STATE_RINGING |
145 | 148 | && !monitor.getMaxBiometricUnlockAttemptsReached() |
146 | | - && !backupIsTimedOut) { |
| 149 | + && !backupIsTimedOut |
| 150 | + && powerManager.isScreenOn()) { |
147 | 151 | mBiometricUnlock.start(); |
148 | 152 | } else { |
149 | 153 | mBiometricUnlock.stopAndShowBackup(); |
|
0 commit comments