diff options
| -rw-r--r-- | core/api/system-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/hardware/hdmi/HdmiControlManager.java | 16 | ||||
| -rw-r--r-- | core/java/android/hardware/hdmi/HdmiSwitchClient.java | 3 |
3 files changed, 21 insertions, 1 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 99be1a2ef304..fe66952ab3f9 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -4165,6 +4165,7 @@ package android.hardware.hdmi { method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getHdmiCecVolumeControlEnabled(); method public int getPhysicalAddress(); method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient(); + method @NonNull public java.util.List<android.hardware.hdmi.HdmiPortInfo> getPortInfo(); method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public String getPowerControlMode(); method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public String getPowerStateChangeOnActiveSourceLost(); method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getRoutingControl(); @@ -4468,7 +4469,7 @@ package android.hardware.hdmi { public class HdmiSwitchClient extends android.hardware.hdmi.HdmiClient { method public int getDeviceType(); - method @NonNull public java.util.List<android.hardware.hdmi.HdmiPortInfo> getPortInfo(); + method @Deprecated @NonNull public java.util.List<android.hardware.hdmi.HdmiPortInfo> getPortInfo(); method public void selectPort(int, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener); method public void selectPort(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener); } diff --git a/core/java/android/hardware/hdmi/HdmiControlManager.java b/core/java/android/hardware/hdmi/HdmiControlManager.java index 3e509e4d1c2f..cca8688a3a26 100644 --- a/core/java/android/hardware/hdmi/HdmiControlManager.java +++ b/core/java/android/hardware/hdmi/HdmiControlManager.java @@ -1291,6 +1291,22 @@ public final class HdmiControlManager { } /** + * Get the list of the HDMI ports configuration. + * + * <p>This returns an empty list when the current device does not have HDMI ports. + * + * @return a list of {@link HdmiPortInfo} + */ + @NonNull + public List<HdmiPortInfo> getPortInfo() { + try { + return mService.getPortInfo(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Power off the target device by sending CEC commands. Note that this device can't be the * current device itself. * diff --git a/core/java/android/hardware/hdmi/HdmiSwitchClient.java b/core/java/android/hardware/hdmi/HdmiSwitchClient.java index 0fb5894dc4d9..8aaeec3a98fe 100644 --- a/core/java/android/hardware/hdmi/HdmiSwitchClient.java +++ b/core/java/android/hardware/hdmi/HdmiSwitchClient.java @@ -184,7 +184,10 @@ public class HdmiSwitchClient extends HdmiClient { * <p>This returns an empty list when the current device does not have HDMI input. * * @return a list of {@link HdmiPortInfo} + * + * @deprecated Please use {@link HdmiControlManager#getPortInfo()} instead. */ + @Deprecated @NonNull public List<HdmiPortInfo> getPortInfo() { try { |