Merge "Add basic documentation about cec key handling" into rvc-dev
diff --git a/services/core/java/com/android/server/hdmi/README.md b/services/core/java/com/android/server/hdmi/README.md
new file mode 100644
index 0000000..2b510b5
--- /dev/null
+++ b/services/core/java/com/android/server/hdmi/README.md
@@ -0,0 +1,7 @@
+# Package com.android.server.hdmi
+
+HDMI service for Android with focus on CEC
+
+## Links
+
+* [CEC Key Handling](cec_key_handling.md)
diff --git a/services/core/java/com/android/server/hdmi/cec_key_handling.md b/services/core/java/com/android/server/hdmi/cec_key_handling.md
new file mode 100644
index 0000000..d150dd3
--- /dev/null
+++ b/services/core/java/com/android/server/hdmi/cec_key_handling.md
@@ -0,0 +1,36 @@
+# CEC Key Handling
+
+The mapping of CEC key codes to Android key codes are at
+[HdmiCecKeycode](HdmiCecKeycode.java)
+
+# Android TV
+
+Android TV requires special handling of some keys.
+
+The general action for key handling is described in the table
+
+| 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 TV power state | Toggle the TV power state |
+| TV_POWER | Toggle the device power state | Toggle the TV power state | Toggle the TV power state |
+| 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 |
+
+Special cases and flags for each key are described below
+
+## POWER
+
+### TV Panel
+
+TODO
+
+### OTT
+
+TODO
+
+### Soundbar
+
+TODO
+
+