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

Commit 99193055 authored by Roman Birg's avatar Roman Birg
Browse files

Keyguard: allow keyguard to be dismissed via intent



Requires system permission "android.permission.CONTROL_KEYGUARD"

Change-Id: I9f8f5ca90a65b949d43fac33ce3e9e39ffdf9254
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent a9ff5a97
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();
                }
            }
        }
    };