diff options
| author | 2024-10-30 17:39:59 +0000 | |
|---|---|---|
| committer | 2024-12-03 15:41:20 +0000 | |
| commit | ed4e0aa7843f0daf28c957cb4af0aedb78b29a86 (patch) | |
| tree | 4314f21f8e14095cf45be96547a5ba4c9ad00bb0 /ravenwood/scripts/extract-last-soong-commands.py | |
| parent | 8da65957d0198556b7b8eacdcb17610e791bae87 (diff) | |
Allow focused privileged windows to capture the power button event.
When 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: Ia21ebbda4a93ade5f4d5f73fe0f3bf659e36647a
Diffstat (limited to 'ravenwood/scripts/extract-last-soong-commands.py')
0 files changed, 0 insertions, 0 deletions