Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 200bbee3 authored by Paul Colta's avatar Paul Colta
Browse files

HDMICEC: Expose HdmiControlManager#getPortInfo API

Introduce the API HdmiControlManager#getPortInfo.
Deprecate HdmiSwitchClient#getPortInfo.

Bug: 237067393
Test: m && atest android.hardware.hdmi.cts.HdmiControlManagerTest
Change-Id: I7a3c16f862c8ffdfd0bc69637469761728be7a8a
parent bcc31bca
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -4085,6 +4085,7 @@ package android.hardware.hdmi {
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getHdmiCecVolumeControlEnabled();
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getHdmiCecVolumeControlEnabled();
    method public int getPhysicalAddress();
    method public int getPhysicalAddress();
    method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient();
    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 getPowerControlMode();
    method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public String getPowerStateChangeOnActiveSourceLost();
    method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public String getPowerStateChangeOnActiveSourceLost();
    method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getRoutingControl();
    method @NonNull @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getRoutingControl();
@@ -4388,7 +4389,7 @@ package android.hardware.hdmi {
  public class HdmiSwitchClient extends android.hardware.hdmi.HdmiClient {
  public class HdmiSwitchClient extends android.hardware.hdmi.HdmiClient {
    method public int getDeviceType();
    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 android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
    method public void selectPort(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
    method public void selectPort(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
  }
  }
+16 −0
Original line number Original line Diff line number Diff line
@@ -1290,6 +1290,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
     * Power off the target device by sending CEC commands. Note that this device can't be the
     * current device itself.
     * current device itself.
+3 −0
Original line number Original line Diff line number Diff line
@@ -184,7 +184,10 @@ public class HdmiSwitchClient extends HdmiClient {
     * <p>This returns an empty list when the current device does not have HDMI input.
     * <p>This returns an empty list when the current device does not have HDMI input.
     *
     *
     * @return a list of {@link HdmiPortInfo}
     * @return a list of {@link HdmiPortInfo}
     *
     * @deprecated Please use {@link HdmiControlManager#getPortInfo()} instead.
     */
     */
    @Deprecated
    @NonNull
    @NonNull
    public List<HdmiPortInfo> getPortInfo() {
    public List<HdmiPortInfo> getPortInfo() {
        try {
        try {