Skip to content

Commit 94d2f36

Browse files
Steven RossAndroid (Google) Code Review
authored andcommitted
Merge "Killing Facelock when a phonecall comes in"
2 parents 5a144de + dce0bb6 commit 94d2f36

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
* {@link com.android.internal.policy.impl.KeyguardViewManager}
7777
* via its {@link com.android.internal.policy.impl.KeyguardViewCallback}, as appropriate.
7878
*/
79-
public class LockPatternKeyguardView extends KeyguardViewBase implements Handler.Callback {
79+
public class LockPatternKeyguardView extends KeyguardViewBase implements Handler.Callback,
80+
KeyguardUpdateMonitor.InfoCallback {
8081

8182
private static final int TRANSPORT_USERACTIVITY_TIMEOUT = 10000;
8283

@@ -266,6 +267,8 @@ public LockPatternKeyguardView(
266267
mLockPatternUtils = lockPatternUtils;
267268
mWindowController = controller;
268269

270+
mUpdateMonitor.registerInfoCallback(this);
271+
269272
mKeyguardScreenCallback = new KeyguardScreenCallback() {
270273

271274
public void goToLockScreen() {
@@ -588,6 +591,25 @@ protected void onConfigurationChanged(Configuration newConfig) {
588591
post(mRecreateRunnable);
589592
}
590593

594+
//Ignore these events; they are implemented only because they come from the same interface
595+
@Override
596+
public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel)
597+
{}
598+
@Override
599+
public void onTimeChanged() {}
600+
@Override
601+
public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) {}
602+
@Override
603+
public void onRingerModeChanged(int state) {}
604+
@Override
605+
public void onClockVisibilityChanged() {}
606+
607+
//We need to stop faceunlock when a phonecall comes in
608+
@Override
609+
public void onPhoneStateChanged(int phoneState) {
610+
if(phoneState == TelephonyManager.CALL_STATE_RINGING) stopAndUnbindFromFaceLock();
611+
}
612+
591613
@Override
592614
protected boolean dispatchHoverEvent(MotionEvent event) {
593615
// Do not let the screen to get locked while the user is disabled and touch

0 commit comments

Comments
 (0)