summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/hdmi
diff options
context:
space:
mode:
authorJungshik Jang <jayjang@google.com>2014-08-12 22:01:23 +0900
committerJungshik Jang <jayjang@google.com>2014-08-18 11:16:47 +0900
commit4612a6e1116f1196e6aa64b5a6e3757ea48f94ac (patch)
tree6c058a180bf2ed73ee0d9796f088b8e22c1425d5 /services/core/java/com/android/server/hdmi
parent98f4c16a7beba90abffa89d0b32b8ee56a31073d (diff)
downloadframeworks_base-4612a6e1116f1196e6aa64b5a6e3757ea48f94ac.zip
frameworks_base-4612a6e1116f1196e6aa64b5a6e3757ea48f94ac.tar.gz
frameworks_base-4612a6e1116f1196e6aa64b5a6e3757ea48f94ac.tar.bz2
Implement MHL send key action.
This class introduces two classes, MhlSendKeyAction and HdmiMhlKeycode. - MhlSendKeyAction is a feature action that manages MHL message for RCP, Remote Control Pass Through. - HdmiMhlKeycode is a collection of MHL keycode including keycode mapping between MHL and Android keycode. Bug: 16966459 Change-Id: Ib3f7229c71b66837cd0d239e5af1940dfccee7df
Diffstat (limited to 'services/core/java/com/android/server/hdmi')
-rw-r--r--services/core/java/com/android/server/hdmi/Constants.java5
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecKeycode.java2
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiControlService.java19
3 files changed, 20 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/hdmi/Constants.java b/services/core/java/com/android/server/hdmi/Constants.java
index 2407253..ae7472d 100644
--- a/services/core/java/com/android/server/hdmi/Constants.java
+++ b/services/core/java/com/android/server/hdmi/Constants.java
@@ -276,5 +276,10 @@ final class Constants {
// values which denotes the device type in HDMI Spec 1.4.
static final String PROPERTY_DEVICE_TYPE = "ro.hdmi.device_type";
+ // MHL RCPE messages
+ static final int MHL_RCPE_NO_ERROR = 0x00;
+ static final int MHL_RCPE_INEFFECTIVE_KEYCODE = 0x01;
+ static final int MHL_RCPE_RESPONDER_BUSY = 0x02;
+
private Constants() { /* cannot be instantiated */ }
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecKeycode.java b/services/core/java/com/android/server/hdmi/HdmiCecKeycode.java
index c0c8424..46b2b3e 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecKeycode.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecKeycode.java
@@ -21,7 +21,7 @@ import android.view.KeyEvent;
/**
* Helper class to translate android keycode to hdmi cec keycode and vice versa.
*/
-public class HdmiCecKeycode {
+final class HdmiCecKeycode {
public static final int UNSUPPORTED_KEYCODE = -1;
public static final int NO_PARAM = -1;
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 3ccdf07..14c066e 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -996,12 +996,21 @@ public final class HdmiControlService extends SystemService {
runOnServiceThread(new Runnable() {
@Override
public void run() {
- HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(deviceType);
- if (localDevice == null) {
- Slog.w(TAG, "Local device not available");
- return;
+ if (mMhlController != null) {
+ HdmiMhlLocalDevice device = mMhlController.getLocalDevice(mActivePortId);
+ if (device != null) {
+ device.sendKeyEvent(keyCode, isPressed);
+ return;
+ }
+ }
+ if (mCecController != null) {
+ HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(deviceType);
+ if (localDevice == null) {
+ Slog.w(TAG, "Local device not available");
+ return;
+ }
+ localDevice.sendKeyEvent(keyCode, isPressed);
}
- localDevice.sendKeyEvent(keyCode, isPressed);
}
});
}