Only Dispatch Stylus Key Events to System UI on Key Down

Test: manual

Fixes: b/254604589
Change-Id: Iaa82292f289f51f84d6b01ce4cb7a69fabd8dd4e
This commit is contained in:
Marcello Galhardo
2023-01-13 11:17:06 +00:00
parent b51e6c4811
commit 74cf5d39cb

View File

@@ -4316,7 +4316,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case KeyEvent.KEYCODE_STYLUS_BUTTON_SECONDARY:
case KeyEvent.KEYCODE_STYLUS_BUTTON_TERTIARY:
case KeyEvent.KEYCODE_STYLUS_BUTTON_TAIL: {
if (!mStylusButtonsDisabled) {
if (down && !mStylusButtonsDisabled) {
sendSystemKeyToStatusBarAsync(keyCode);
}
result &= ~ACTION_PASS_TO_USER;