summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josep del Rio <joseprio@google.com> 2023-12-14 19:36:53 +0000
committer Josep del Rio <joseprio@google.com> 2023-12-14 19:36:53 +0000
commit820f029ec49e03268c7f56ec0d815568dbc90b01 (patch)
treee94452479cf6d2ebb01b22210c60422e2bdfc279
parentb3248dd8e560e01b53bf4683129c5f801354526b (diff)
Only mark unhandled events as handled when an action was made
The fix for b/304684672 was incomplete; while it would only do an action when there was no modifiers, the event was still marked as handled as it follow the same pattern as SysRQ; however, in both cases, the event should not be marked as handled if no action was made, so this CL will address it. Bug: 304684672 Test: Flashed on device, confirmed Alt+Esc dispatches a fallback when not handled Change-Id: I9acf2c6c9daaabab16d9e4793fbd66a03beb7e6d
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 938ed2329ffd..fbe5fed6ab7a 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -4007,15 +4007,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case KeyEvent.KEYCODE_SYSRQ:
if (down && repeatCount == 0) {
interceptScreenshotChord(SCREENSHOT_KEY_OTHER, 0 /*pressDelay*/);
+ return true;
}
- return true;
+ break;
case KeyEvent.KEYCODE_ESCAPE:
if (down
&& KeyEvent.metaStateHasNoModifiers(metaState)
&& repeatCount == 0) {
mContext.closeSystemDialogs();
+ return true;
}
- return true;
+ break;
case KeyEvent.KEYCODE_STEM_PRIMARY:
handleUnhandledSystemKey(event);
sendSystemKeyToStatusBarAsync(event);