Skip to content

Commit 4841e29

Browse files
author
Steven Ross
committed
Fixes 5446301
If the user is making an emergency call, don't bring up Facelock Has the side effect of not bringing up Facelock if they cancel dialing Change-Id: I5d23e89b7f687f260670d41f1cc55ebf2a135181
1 parent 83b740a commit 4841e29

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
128128

129129

130130
private boolean mRequiresSim;
131+
private volatile boolean mEmergencyCall;
131132

132133

133134
/**
@@ -268,6 +269,7 @@ public LockPatternKeyguardView(
268269
mUpdateMonitor = updateMonitor;
269270
mLockPatternUtils = lockPatternUtils;
270271
mWindowController = controller;
272+
mEmergencyCall = false;
271273

272274
mUpdateMonitor.registerInfoCallback(this);
273275

@@ -322,6 +324,7 @@ public void recreateMe(Configuration config) {
322324
}
323325

324326
public void takeEmergencyCallAction() {
327+
mEmergencyCall = true;
325328
// FaceLock must be stopped if it is running when emergency call is pressed
326329
stopAndUnbindFromFaceLock();
327330

@@ -506,6 +509,7 @@ public void reset() {
506509
public void onScreenTurnedOff() {
507510
mScreenOn = false;
508511
mForgotPattern = false;
512+
mEmergencyCall = false;
509513
if (mMode == Mode.LockScreen) {
510514
((KeyguardScreen) mLockScreen).onPause();
511515
} else {
@@ -550,6 +554,7 @@ public void onScreenTurnedOn() {
550554
*/
551555
@Override
552556
public void onWindowFocusChanged (boolean hasWindowFocus) {
557+
if(DEBUG) Log.d(TAG, hasWindowFocus ? "focused" : "unfocused");
553558
boolean runFaceLock = false;
554559
//Make sure to start facelock iff the screen is both on and focused
555560
synchronized(mFaceLockStartupLock) {
@@ -560,7 +565,11 @@ public void onWindowFocusChanged (boolean hasWindowFocus) {
560565
stopAndUnbindFromFaceLock();
561566
mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW);
562567
} else if (runFaceLock) {
563-
activateFaceLockIfAble();
568+
//Don't activate facelock while the user is calling 911!
569+
if(mEmergencyCall) mEmergencyCall = false;
570+
else {
571+
activateFaceLockIfAble();
572+
}
564573
}
565574
}
566575

@@ -640,6 +649,7 @@ public void onClockVisibilityChanged() {}
640649
//We need to stop faceunlock when a phonecall comes in
641650
@Override
642651
public void onPhoneStateChanged(int phoneState) {
652+
if (DEBUG) Log.d(TAG, "phone state: " + phoneState);
643653
if(phoneState == TelephonyManager.CALL_STATE_RINGING) {
644654
stopAndUnbindFromFaceLock();
645655
mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW);

0 commit comments

Comments
 (0)