diff options
| author | 2024-12-12 20:11:42 +0000 | |
|---|---|---|
| committer | 2024-12-20 20:09:33 +0000 | |
| commit | 22bbefccbc2245b1419f5feb45cb4c5afad16747 (patch) | |
| tree | b255dfd9ebed3a3087405a6cf959d29040e76d92 /libs/androidfw/BackupHelpers.cpp | |
| parent | 399ee78c43e6941ac95c94a46174eb72727a88f6 (diff) | |
Allow focused window to capture power button - try 3.
This is a combination of ag/30154729 + ag/30763741, which was originally
reverted due to b/382133936 (SysUI PowerMenuTest failing).
The tests are passing in combination with ag/30850517. ABTD results:
https://android-build.corp.google.com/abtd/run/L66200030008426443/
https://android-build.corp.google.com/abtd/run/L94300030008415110/
With this feature enabled, focused windows with the
OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW permission and the window
flag INPUT_FEATURE_RECEIVE_POWER_KEY_DOUBLE_PRESS set will receive KEYCODE_POWER KeyEvents.
The window can override the double-tap gesture default behavior (launching
camera) by handling the second onKeyDown event of a double tap. If the
app does not handle this event, or if the windw does not have the
permissions to receive KEYCODE_POWER, the default behavior of launching
camera is performed.
A double tap is defined as two consecutive KEYCODE_POWER key down events
within a 300 ms threshold.
Single, long-press and non double-press gestures behaviors will all be
default behavior, regardless of app handling the events or not.
Turning display on and off is unaffected, with the following exception:
In a privileged, focused window that doesn't handle the KEYCODE_POWER
event, there will be a 300 ms delay in turning off the screen.
More details at go/power-button-dd.
Bug: 357144512
Test: atest WmTests:PowerKeyGestureTests
Test: manual testing (single, long-press, double-press, 5x press of
power button on non-privileged windows and privileged windows that
handle and don't handle the KEYCODE_POWER KeyEvent.)
Flag: com.android.hardware.input.override_power_key_behavior_in_focused_window
Change-Id: Ieb09581ccae1b0b4d536e8f8105c7d24f5e8a40d
Diffstat (limited to 'libs/androidfw/BackupHelpers.cpp')
0 files changed, 0 insertions, 0 deletions