diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2014-07-28 23:02:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-24 16:04:26 +0000 |
commit | cfcdf1270127d9a333cda2b91646713d1f41c6ac (patch) | |
tree | fdfbf2ef9ac3c5978f2a6bebaef1a45afd3db398 /services | |
parent | 62dc1768d6a2fcbed9e5dc4b26ecc4ccd22122fd (diff) | |
parent | f4eb72d53b4c5bc2286841006ad473ad4448bcf8 (diff) | |
download | frameworks_base-cfcdf1270127d9a333cda2b91646713d1f41c6ac.zip frameworks_base-cfcdf1270127d9a333cda2b91646713d1f41c6ac.tar.gz frameworks_base-cfcdf1270127d9a333cda2b91646713d1f41c6ac.tar.bz2 |
Merge "Add MHL getPortInfo" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiControlService.java | 41 |
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 37c297b..2272283 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); } /** |