Map META+L to lock the device

Cherry picked Ia928468318ba26ec19e4bb7aaf19c0f5a095d616 to master due to b/286408867.

Code was merged via `-s ours` and is missing even though the sha exists on the target branch. Cherry pick is required to bring in the code.

Manually remove the "Merged in" directive to allow for downstream propagation.

Fixes: 246657706
Test: META+L -> lock and go to the lockscreen
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:19fa8890c7f0c926ea70116b825ba0bf8047c744)
Change-Id: I0c4cd811ed6b1bab5dba18156727ce3702058552
This commit is contained in:
Tracy Zhou
2023-06-07 03:59:12 +00:00
committed by Brian Egizi
parent 83a57e5452
commit 1d62ef33f4

View File

@@ -3085,6 +3085,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return key_consumed;
}
break;
case KeyEvent.KEYCODE_L:
if (down && event.isMetaPressed() && repeatCount == 0) {
lockNow(null /* options */);
return key_consumed;
}
break;
case KeyEvent.KEYCODE_N:
if (down && event.isMetaPressed()) {
if (event.isCtrlPressed()) {