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

Commit 4612a6e1 authored by Jungshik Jang's avatar Jungshik Jang
Browse files

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
parent 98f4c16a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 */ }
}
+1 −1
Original line number Diff line number Diff line
@@ -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;

+14 −5
Original line number Diff line number Diff line
@@ -996,6 +996,14 @@ public final class HdmiControlService extends SystemService {
            runOnServiceThread(new Runnable() {
                @Override
                public void run() {
                    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");
@@ -1003,6 +1011,7 @@ public final class HdmiControlService extends SystemService {
                        }
                        localDevice.sendKeyEvent(keyCode, isPressed);
                    }
                }
            });
        }