diff options
| author | Shubang Lu <shubang@google.com> | 2019-01-16 04:22:26 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-01-16 04:22:26 +0000 |
| commit | c2f2977c4b5944b85fcece5ba3663f33fe75325d (patch) | |
| tree | fa617d0c1b1a29ce54e367171ace2a4693667443 /core/java | |
| parent | be607448ccdc2e8c7b269b5ed2b9198cbfa58f91 (diff) | |
| parent | 47fe0b16865a0f529be5771ffccdba2c4d542c1c (diff) | |
Merge changes Idebffbec,Ief4435c7,I9f9a5f46,Iee495e71,I949587e1, ...
* changes:
Add Power Status query steps in Device Discovery Action.
Unmute when turning system audio mode on.
Make sure the device route to HOME when OneTouchPlay is triggered.
Add APIs to expose some cec control to other services.
Fix port id mismatch temporarily.
Add dump info of local active port and routing port.
Set routing feature enabled to default false and dump its status.
Add a thread safe copy of connected device list.
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/hardware/hdmi/HdmiControlManager.java | 68 | ||||
| -rw-r--r-- | core/java/android/hardware/hdmi/IHdmiControlService.aidl | 3 |
2 files changed, 71 insertions, 0 deletions
diff --git a/core/java/android/hardware/hdmi/HdmiControlManager.java b/core/java/android/hardware/hdmi/HdmiControlManager.java index be8009e6a966..a7734f544607 100644 --- a/core/java/android/hardware/hdmi/HdmiControlManager.java +++ b/core/java/android/hardware/hdmi/HdmiControlManager.java @@ -33,6 +33,8 @@ import android.os.SystemProperties; import android.util.ArrayMap; import android.util.Log; +import java.util.List; + /** * The {@link HdmiControlManager} class is used to send HDMI control messages * to attached CEC devices. @@ -404,6 +406,72 @@ public final class HdmiControlManager { } /** + * Get a snapshot of the real-time status of the remote devices. + * + * @return a list of {@link HdmiDeviceInfo} of the devices connected to the current device. + * + * TODO(b/110094868): unhide for Q + * @hide + */ + public List<HdmiDeviceInfo> getConnectedDevicesList() { + try { + return mService.getDeviceList(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Power off the target device. + * + * @param deviceInfo HdmiDeviceInfo of the device to be powered off + * + * TODO(b/110094868): unhide for Q + * @hide + */ + public void powerOffRemoteDevice(HdmiDeviceInfo deviceInfo) { + try { + mService.powerOffRemoteDevice( + deviceInfo.getLogicalAddress(), deviceInfo.getDevicePowerStatus()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Power on the target device. + * + * @param deviceInfo HdmiDeviceInfo of the device to be powered on + * + * TODO(b/110094868): unhide for Q + * @hide + */ + public void powerOnRemoteDevice(HdmiDeviceInfo deviceInfo) { + try { + mService.powerOnRemoteDevice( + deviceInfo.getLogicalAddress(), deviceInfo.getDevicePowerStatus()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Ask the target device to be the new Active Source. + * + * @param deviceInfo HdmiDeviceInfo of the target device + * + * TODO(b/110094868): unhide for Q + * @hide + */ + public void askRemoteDeviceToBecomeActiveSource(HdmiDeviceInfo deviceInfo) { + try { + mService.askRemoteDeviceToBecomeActiveSource(deviceInfo.getPhysicalAddress()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Controls standby mode of the system. It will also try to turn on/off the connected devices if * necessary. * diff --git a/core/java/android/hardware/hdmi/IHdmiControlService.aidl b/core/java/android/hardware/hdmi/IHdmiControlService.aidl index 66bb084d5482..1cd9920aa250 100644 --- a/core/java/android/hardware/hdmi/IHdmiControlService.aidl +++ b/core/java/android/hardware/hdmi/IHdmiControlService.aidl @@ -61,6 +61,9 @@ interface IHdmiControlService { void setInputChangeListener(IHdmiInputChangeListener listener); List<HdmiDeviceInfo> getInputDevices(); List<HdmiDeviceInfo> getDeviceList(); + void powerOffRemoteDevice(int logicalAddress, int powerStatus); + void powerOnRemoteDevice(int logicalAddress, int powerStatus); + void askRemoteDeviceToBecomeActiveSource(int physicalAddress); void sendVendorCommand(int deviceType, int targetAddress, in byte[] params, boolean hasVendorId); void addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType); |
