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
diff --git a/services/core/java/com/android/server/tv/TvInputHardwareManager.java b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
index c916507..1a08559 100644
--- a/services/core/java/com/android/server/tv/TvInputHardwareManager.java
+++ b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
@@ -284,7 +284,7 @@
return -1;
}
- public void addHdmiTvInput(int logicalAddress, TvInputInfo info) {
+ public void addHdmiTvInput(int id, TvInputInfo info) {
if (info.getType() != TvInputInfo.TYPE_HDMI) {
throw new IllegalArgumentException("info (" + info + ") has non-HDMI type.");
}
@@ -294,13 +294,13 @@
if (parentIndex < 0) {
throw new IllegalArgumentException("info (" + info + ") has invalid parentId.");
}
- String oldInputId = mHdmiInputIdMap.get(logicalAddress);
+ String oldInputId = mHdmiInputIdMap.get(id);
if (oldInputId != null) {
Slog.w(TAG, "Trying to override previous registration: old = "
- + mInputMap.get(oldInputId) + ":" + logicalAddress + ", new = "
- + info + ":" + logicalAddress);
+ + mInputMap.get(oldInputId) + ":" + id + ", new = "
+ + info + ":" + id);
}
- mHdmiInputIdMap.put(logicalAddress, info.getId());
+ mHdmiInputIdMap.put(id, info.getId());
mInputMap.put(info.getId(), info);
}
}