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

Commit 62b6f79e authored by Roman Birg's avatar Roman Birg Committed by Steve Kondik
Browse files

Keyguard: allow keyguard to be dismissed via intent



Change-Id: I16dcba63d849da8c6026ecaad8de778868cfd8ee
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent d4da0af7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -135,6 +135,9 @@ public class KeyguardViewMediator extends SystemUI {
    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;
@@ -576,6 +579,8 @@ public class KeyguardViewMediator extends SystemUI {
        mShowKeyguardWakeLock.setReferenceCounted(false);
        mProfileManager = ProfileManager.getInstance(mContext);
        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(mContext);

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