am ce7221ac: am 94a31604: Implement MHL send key action.
* commit 'ce7221ac51b892468d848e6f3384ca4a1993ba13': Implement MHL send key action.
This commit is contained in:
@@ -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 */ }
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user