Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fac873d3 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "Keyguard: allow keyguard to be dismissed via intent" into cm-11.0

parents 9c5c269c 99193055
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -114,6 +114,9 @@ public class KeyguardViewMediator {
    private static final String DELAYED_KEYGUARD_ACTION =
        "com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD";

    private static final String DISMISS_KEYGUARD_SECURELY_ACTION =
            "com.android.keyguard.action.DISMISS_KEYGUARD_SECURELY";

    // used for handler messages
    private static final int SHOW = 2;
    private static final int HIDE = 3;
@@ -510,6 +513,8 @@ public class KeyguardViewMediator {
        mShowKeyguardWakeLock.setReferenceCounted(false);

        mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(DELAYED_KEYGUARD_ACTION));
        mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(DISMISS_KEYGUARD_SECURELY_ACTION),
                android.Manifest.permission.CONTROL_KEYGUARD, null);

        mKeyguardDisplayManager = new KeyguardDisplayManager(context);

@@ -1090,6 +1095,10 @@ public class KeyguardViewMediator {
                        doKeyguardLocked(null);
                    }
                }
            } else if (DISMISS_KEYGUARD_SECURELY_ACTION.equals(intent.getAction())) {
                synchronized (KeyguardViewMediator.this) {
                    dismiss();
                }
            }
        }
    };