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

Commit f4eb72d5 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

Add MHL getPortInfo

Allows MHL support flag to be put into port information

Bug: 16215362
Change-Id: I1873c8e60b02f47a97509576fc40d57efb056817
parent 8c688ada
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -161,4 +161,15 @@ public final class HdmiPortInfo implements Parcelable {
        dest.writeInt(mArcSupported ? 1 : 0);
        dest.writeInt(mMhlSupported ? 1 : 0);
    }

    @Override
    public String toString() {
        StringBuffer s = new StringBuffer();
        s.append("port_id: ").append(mId).append(", ");
        s.append("address: ").append(mAddress).append(", ");
        s.append("cec: ").append(mCecSupported).append(", ");
        s.append("arc: ").append(mArcSupported).append(", ");
        s.append("mhl: ").append(mMhlSupported);
        return s.toString();
    }
}
+21 −20
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import com.android.server.hdmi.HdmiCecLocalDevice.PendingActionClearedCallback;
import libcore.util.EmptyArray;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@@ -343,12 +344,11 @@ public final class HdmiControlService extends SystemService {
            mPortInfoMap.put(info.getId(), info);
        }

        HdmiPortInfo[] mhlPortInfo = new HdmiPortInfo[0];
        if (mMhlController != null) {
            // TODO: Implement plumbing logic to get MHL port information.
            // mhlPortInfo = mMhlController.getPortInfos();
        }

        if (mMhlController == null) {
            mPortInfo = Collections.unmodifiableList(Arrays.asList(cecPortInfo));
            return;
        } else {
            HdmiPortInfo[] mhlPortInfo = mMhlController.getPortInfos();
            ArraySet<Integer> mhlSupportedPorts = new ArraySet<Integer>(mhlPortInfo.length);
            for (HdmiPortInfo info : mhlPortInfo) {
                if (info.isMhlSupported()) {
@@ -368,6 +368,7 @@ public final class HdmiControlService extends SystemService {
            }
            mPortInfo = Collections.unmodifiableList(result);
        }
    }

    /**
     * Returns HDMI port information for the given port id.