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
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 938ed23..fbe5fed 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 @@
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);