diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2014-08-13 10:48:30 +0900 |
---|---|---|
committer | Jinsuk Kim <jinsukkim@google.com> | 2014-08-14 10:52:23 +0900 |
commit | 8960d1b1552729e3dfd33deee951ac75933ad8e5 (patch) | |
tree | 65e50bfa3ec65a6f04929821d34b3f8635806c6f /media | |
parent | 0d79310e25a316194b63337975177c6e734f2be4 (diff) | |
download | frameworks_base-8960d1b1552729e3dfd33deee951ac75933ad8e5.zip frameworks_base-8960d1b1552729e3dfd33deee951ac75933ad8e5.tar.gz frameworks_base-8960d1b1552729e3dfd33deee951ac75933ad8e5.tar.bz2 |
CEC: Replace the usage of logical address with id for HdmiDeviceInfo
Introduced 'id' of HdmiDeviceInfo to replace the direct use of logical address
as id. This accomodates the identification of MHL device with ease. Also updated
TIF to use id instead of logical address.
Bug: 16986744
Change-Id: Ifa827fb5e5fcf1d2f612f0845accbfe5c03734aa
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/tv/ITvInputServiceCallback.aidl | 2 | ||||
-rw-r--r-- | media/java/android/media/tv/TvInputInfo.java | 6 | ||||
-rw-r--r-- | media/java/android/media/tv/TvInputService.java | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/media/java/android/media/tv/ITvInputServiceCallback.aidl b/media/java/android/media/tv/ITvInputServiceCallback.aidl index de5d56f..74ab562 100644 --- a/media/java/android/media/tv/ITvInputServiceCallback.aidl +++ b/media/java/android/media/tv/ITvInputServiceCallback.aidl @@ -25,6 +25,6 @@ import android.media.tv.TvInputInfo; */ oneway interface ITvInputServiceCallback { void addHardwareTvInput(in int deviceId, in TvInputInfo inputInfo); - void addHdmiTvInput(in int logicalAddress, in TvInputInfo inputInfo); + void addHdmiTvInput(in int id, in TvInputInfo inputInfo); void removeTvInput(in String inputId); } diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java index e735e4e..cdf2cee 100644 --- a/media/java/android/media/tv/TvInputInfo.java +++ b/media/java/android/media/tv/TvInputInfo.java @@ -112,7 +112,7 @@ public final class TvInputInfo implements Parcelable { private static final String PREFIX_HDMI_DEVICE = "HDMI"; private static final String PREFIX_HARDWARE_DEVICE = "HW"; private static final int LENGTH_HDMI_PHYSICAL_ADDRESS = 4; - private static final int LENGTH_HDMI_LOGICAL_ADDRESS = 2; + private static final int LENGTH_HDMI_DEVICE_ID = 2; private final ResolveInfo mService; private final String mId; @@ -536,9 +536,9 @@ public final class TvInputInfo implements Parcelable { ComponentName name, HdmiDeviceInfo deviceInfo) { // Example of the format : "/HDMI%04X%02X" String format = String.format("%s%s%%0%sX%%0%sX", DELIMITER_INFO_IN_ID, PREFIX_HDMI_DEVICE, - LENGTH_HDMI_PHYSICAL_ADDRESS, LENGTH_HDMI_LOGICAL_ADDRESS); + LENGTH_HDMI_PHYSICAL_ADDRESS, LENGTH_HDMI_DEVICE_ID); return name.flattenToShortString() + String.format(format, - deviceInfo.getPhysicalAddress(), deviceInfo.getLogicalAddress()); + deviceInfo.getPhysicalAddress(), deviceInfo.getId()); } /** diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index 8783648..8ffe6cc 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -213,7 +213,7 @@ public abstract class TvInputService extends Service { } /** - * Returns the input ID for {@code logicalAddress} if it is handled by this service; otherwise, + * Returns the input ID for {@code deviceInfo} if it is handled by this service; otherwise, * return {@code null}. Override to modify default behavior of ignoring all HDMI logical input * device. * @@ -1178,11 +1178,11 @@ public abstract class TvInputService extends Service { mCallbacks.finishBroadcast(); } - private void broadcastAddHdmiTvInput(int logicalAddress, TvInputInfo inputInfo) { + private void broadcastAddHdmiTvInput(int id, TvInputInfo inputInfo) { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; ++i) { try { - mCallbacks.getBroadcastItem(i).addHdmiTvInput(logicalAddress, inputInfo); + mCallbacks.getBroadcastItem(i).addHdmiTvInput(id, inputInfo); } catch (RemoteException e) { Log.e(TAG, "Error while broadcasting.", e); } @@ -1289,7 +1289,7 @@ public abstract class TvInputService extends Service { HdmiDeviceInfo deviceInfo = (HdmiDeviceInfo) msg.obj; TvInputInfo inputInfo = onHdmiDeviceAdded(deviceInfo); if (inputInfo != null) { - broadcastAddHdmiTvInput(deviceInfo.getLogicalAddress(), inputInfo); + broadcastAddHdmiTvInput(deviceInfo.getId(), inputInfo); } return; } |