Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfcab5ff authored by Nathalie Le Clair's avatar Nathalie Le Clair Committed by Android (Google) Code Review
Browse files

Merge "Update CEC key handling documentation" into sc-dev

parents 6451e3f3 b0d54c04
Loading
Loading
Loading
Loading
+14 −13
Original line number Original line Diff line number Diff line
# CEC Key Handling
# CEC Key Handling


The mapping of CEC key codes to Android key codes are at
The mapping of CEC keycodes to Android keycodes is done at [HdmiCecKeycode](HdmiCecKeycode.java).
[HdmiCecKeycode](HdmiCecKeycode.java)


# Android TV
# Android TV


Android TV requires special handling of some keys.
Android TV (ATV) requires special handling of some keys.


The general action for key handling is described in the table
The general action for key handling is described in the table below.


| Android Key | TV Panel                                               | OTT                        | Soundbar                                               |
| Android Key | TV Panel                                               | OTT                        | Soundbar                                               |
| ----------- | -----------------                                      | -------------------        | -------------------                                    |
| ----------- | -----------------                                      | -------------------        | -------------------                                    |
| general     | Send to active source                                  | handle on device           | handle on device                                       |
| POWER       | Toggle the device power state  | Toggle the OTT power state, TV power state follows | Toggle the soundbar power state, TV power state follows|
| POWER       | Toggle the device power state  | Toggle the OTT power state, TV power state follows | Toggle the soundbar power state, TV power state follows|
| TV_POWER    | Toggle the device power state  | Toggle the TV power state, OTT power state follows | Toggle the TV power state, soundbar power state follows|
| TV_POWER    | Toggle the device power state  | Toggle the TV power state, OTT power state follows | Toggle the TV power state, soundbar power state follows|
| HOME        | Turn on TV, Set active Source to TV, go to home screen | OTP, and go to home screen | OTP, and go to home screen                             |
| HOME        | Turn on TV, Set active Source to TV, go to home screen | OTP, and go to home screen | OTP, and go to home screen                             |
| volume keys | Handle on device or send to soundbar                   | Send to TV or soundbar     | Handle on device or send to TV                         |
| Volume keys | Handle on device or send to soundbar                   | Send to TV or soundbar     | Handle on device or send to TV                         |
| Other keys  | Forward to active source                               | Handle on device           | Handle on device                                       |


Special cases and flags for each key are described below
Special cases and flags per key are described below.


## POWER
## TV_POWER


### TV Panel
### TV Panel


TODO
For ATV TV panel devices, TV_POWER is an alias of POWER.


### OTT
### Source Devices (OTT and Soundbar)


TODO
For ATV source devices with POWER_CONTROL_MODE set to none or CEC control disabled, TV_POWER is an alias of POWER.


### Soundbar
For all other source devices, TV_POWER toggles the TV power state and makes the OTT power state follow.


TODO
### Other Devices

For any device that is not connected to a TV via HDMI and not an ATV device, TV_POWER is ignored.