diff options
| author | Jinsuk Kim <jinsukkim@google.com> | 2014-10-20 10:00:04 +0900 |
|---|---|---|
| committer | Jinsuk Kim <jinsukkim@google.com> | 2014-10-20 11:32:47 +0900 |
| commit | bdf27fbf746bee11430c4db2ea6dfd026bae77fe (patch) | |
| tree | 1ec49e6871736b476e80e23252c3ec68cb7212f9 /core/java | |
| parent | 512c2330c652c56996bf3ef63ddad242752cebcd (diff) | |
CEC: add getDeviceList()
Returns the list of all the connected CEC device information. This is
different from getInputDevices() which returns devices of source type only.
For this, turned the local device address list to unmodifiable so that it can
be used by any threads.
Now respects the device type info passed through <Report Physical Address>
rather than always defaulting to the one from HdmiUtil.getTypeFromAddress().
This ensures future compatibility when a device of reserved logical address
comes with a specific type.
Bug: 18046603
Change-Id: I5f7d5e31706efba1ad5dcf4bcfd4ffc918d1d940
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/hardware/hdmi/HdmiTvClient.java | 18 | ||||
| -rw-r--r-- | core/java/android/hardware/hdmi/IHdmiControlService.aidl | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/hardware/hdmi/HdmiTvClient.java b/core/java/android/hardware/hdmi/HdmiTvClient.java index 9d92fd9c7fbd..683d04b3ef5d 100644 --- a/core/java/android/hardware/hdmi/HdmiTvClient.java +++ b/core/java/android/hardware/hdmi/HdmiTvClient.java @@ -22,6 +22,9 @@ import android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource; import android.os.RemoteException; import android.util.Log; +import java.util.Collections; +import java.util.List; + import libcore.util.EmptyArray; /** @@ -150,6 +153,21 @@ public final class HdmiTvClient extends HdmiClient { } /** + * Returns all the CEC devices connected to TV. + * + * @return list of {@link HdmiDeviceInfo} for connected CEC devices. + * Empty list is returned if there is none. + */ + public List<HdmiDeviceInfo> getDeviceList() { + try { + return mService.getDeviceList(); + } catch (RemoteException e) { + Log.e("TAG", "Failed to call getDeviceList():", e); + return Collections.<HdmiDeviceInfo>emptyList(); + } + } + + /** * Set system audio volume * * @param oldIndex current volume index diff --git a/core/java/android/hardware/hdmi/IHdmiControlService.aidl b/core/java/android/hardware/hdmi/IHdmiControlService.aidl index 4866a9a9b6e2..c1e924e59735 100644 --- a/core/java/android/hardware/hdmi/IHdmiControlService.aidl +++ b/core/java/android/hardware/hdmi/IHdmiControlService.aidl @@ -59,6 +59,7 @@ interface IHdmiControlService { void setSystemAudioMute(boolean mute); void setInputChangeListener(IHdmiInputChangeListener listener); List<HdmiDeviceInfo> getInputDevices(); + List<HdmiDeviceInfo> getDeviceList(); void sendVendorCommand(int deviceType, int targetAddress, in byte[] params, boolean hasVendorId); void addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType); |
