summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJinsuk Kim <jinsukkim@google.com>2014-07-25 13:02:51 +0900
committerJinsuk Kim <jinsukkim@google.com>2014-07-28 06:57:04 +0900
commitf4eb72d53b4c5bc2286841006ad473ad4448bcf8 (patch)
treebd8f4d1bb47c7f499414d91b59a56f4fe41ee839 /services
parent8c688ada2dc256a746429b10b2e7a47a52e9b02f (diff)
downloadframeworks_base-f4eb72d53b4c5bc2286841006ad473ad4448bcf8.zip
frameworks_base-f4eb72d53b4c5bc2286841006ad473ad4448bcf8.tar.gz
frameworks_base-f4eb72d53b4c5bc2286841006ad473ad4448bcf8.tar.bz2
Add MHL getPortInfo
Allows MHL support flag to be put into port information Bug: 16215362 Change-Id: I1873c8e60b02f47a97509576fc40d57efb056817
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiControlService.java41
1 files changed, 21 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 3532213..6d54a74 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -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,30 +344,30 @@ 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();
- }
-
- ArraySet<Integer> mhlSupportedPorts = new ArraySet<Integer>(mhlPortInfo.length);
- for (HdmiPortInfo info : mhlPortInfo) {
- if (info.isMhlSupported()) {
- mhlSupportedPorts.add(info.getId());
+ 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()) {
+ mhlSupportedPorts.add(info.getId());
+ }
}
- }
- // Build HDMI port info list with CEC port info plus MHL supported flag.
- ArrayList<HdmiPortInfo> result = new ArrayList<>(cecPortInfo.length);
- for (HdmiPortInfo info : cecPortInfo) {
- if (mhlSupportedPorts.contains(info.getId())) {
- result.add(new HdmiPortInfo(info.getId(), info.getType(), info.getAddress(),
- info.isCecSupported(), true, info.isArcSupported()));
- } else {
- result.add(info);
+ // Build HDMI port info list with CEC port info plus MHL supported flag.
+ ArrayList<HdmiPortInfo> result = new ArrayList<>(cecPortInfo.length);
+ for (HdmiPortInfo info : cecPortInfo) {
+ if (mhlSupportedPorts.contains(info.getId())) {
+ result.add(new HdmiPortInfo(info.getId(), info.getType(), info.getAddress(),
+ info.isCecSupported(), true, info.isArcSupported()));
+ } else {
+ result.add(info);
+ }
}
+ mPortInfo = Collections.unmodifiableList(result);
}
- mPortInfo = Collections.unmodifiableList(result);
}
/**