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

Commit cc8385bd 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 5a2643c6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -123,6 +123,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;
@@ -484,6 +487,8 @@ public class KeyguardViewMediator extends SystemUI {
        mShowKeyguardWakeLock.setReferenceCounted(false);
        mProfileManager = (ProfileManager) mContext.getSystemService(Context.PROFILE_SERVICE);
        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);

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