Implement some apis for TV Input Framework and HdmiControlService
- setInputChangeListener()
- getInputDevices()
Change-Id: I6f7d6d9c7094018e2b6b5ba37f63c8ee5df00e37
diff --git a/core/java/android/hardware/hdmi/HdmiCecDeviceInfo.java b/core/java/android/hardware/hdmi/HdmiCecDeviceInfo.java
index fbfcca0..e1bb780 100644
--- a/core/java/android/hardware/hdmi/HdmiCecDeviceInfo.java
+++ b/core/java/android/hardware/hdmi/HdmiCecDeviceInfo.java
@@ -105,6 +105,15 @@
}
/**
+ * Return {@code true} if the device is of a type that can be an input source.
+ */
+ public boolean isSourceType() {
+ return mDeviceType == HdmiCec.DEVICE_PLAYBACK
+ || mDeviceType == HdmiCec.DEVICE_RECORDER
+ || mDeviceType == HdmiCec.DEVICE_TUNER;
+ }
+
+ /**
* Return display (OSD) name of the device.
*/
public String getDisplayName() {
diff --git a/core/java/android/hardware/hdmi/IHdmiControlService.aidl b/core/java/android/hardware/hdmi/IHdmiControlService.aidl
index 6acd7b9..0e231cc 100644
--- a/core/java/android/hardware/hdmi/IHdmiControlService.aidl
+++ b/core/java/android/hardware/hdmi/IHdmiControlService.aidl
@@ -21,6 +21,7 @@
import android.hardware.hdmi.IHdmiControlCallback;
import android.hardware.hdmi.IHdmiDeviceEventListener;
import android.hardware.hdmi.IHdmiHotplugEventListener;
+import android.hardware.hdmi.IHdmiInputChangeListener;
import android.hardware.hdmi.IHdmiSystemAudioModeChangeListener;
import java.util.List;
@@ -53,4 +54,6 @@
void setOption(int option, int value);
oneway void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex);
oneway void setSystemAudioMute(boolean mute);
+ void setInputChangeListener(IHdmiInputChangeListener listener);
+ List<HdmiCecDeviceInfo> getInputDevices();
}