diff options
| author | Nathalie Le Clair <lcnathalie@google.com> | 2020-11-06 10:19:42 +0100 |
|---|---|---|
| committer | Nathalie Le Clair <lcnathalie@google.com> | 2021-01-08 11:43:36 +0100 |
| commit | 22d11e197fe5a0ab1615460c4c97279cd6b7a4e2 (patch) | |
| tree | ab83528cc5819723bca31a3fb367c65dbbafd22e /core/java | |
| parent | eb197bf6a4fac20e6109273af8473c3238a7d867 (diff) | |
Implement KEYCODE_TV_POWER
For devices that are not Android TV devices and not connected to a TV via HDMI, KEYCODE_TV_POWER is ignored.
For the following Android TV devices, KEYCODE_TV_POWER is an alias of KEYCODE_POWER:
- Devices that don't support HDMI
- HDMI TV panel devices
- HDMI devices with POWER_CONTROL_MODE set to NONE
- HDMI devices with CEC control disabled
For all other HDMI devices, KEYCODE_TV_POWER is forwarded to the HDMI stack by calling toggleAndFollowTvPower(). For HDMI source devices, this results in
1. Toggling of the HDMI-connected TV power state over HDMI-CEC
2. The source device following the TV power state
Bug: 157402294
Test: adb shell input keyevent KEYCODE_TV_POWER, manually verified TV power toggle behavior on ADT3
Change-Id: I59cd3f2a5c2b7a551176ab40ef9c559ad502a974
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/KeyEvent.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index c87e51e35891..37f0a64df613 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -519,8 +519,13 @@ public class KeyEvent extends InputEvent implements Parcelable { /** Key code constant: Settings key. * Starts the system settings activity. */ public static final int KEYCODE_SETTINGS = 176; - /** Key code constant: TV power key. - * On TV remotes, toggles the power on a television screen. */ + /** + * Key code constant: TV power key. + * On HDMI TV panel devices and Android TV devices that don't support HDMI, toggles the power + * state of the device. + * On HDMI source devices, toggles the power state of the HDMI-connected TV via HDMI-CEC and + * makes the source device follow this power state. + */ public static final int KEYCODE_TV_POWER = 177; /** Key code constant: TV input key. * On TV remotes, switches the input on a television screen. */ |
