Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -16103,6 +16103,7 @@ package android.hardware.hdmi { method public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient(); method public android.hardware.hdmi.HdmiTvClient getTvClient(); method public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener); method public void setStandbyMode(boolean); field public static final java.lang.String ACTION_OSD_MESSAGE = "android.hardware.hdmi.action.OSD_MESSAGE"; field public static final int AVR_VOLUME_MUTED = 101; // 0x65 field public static final int CLEAR_TIMER_STATUS_CEC_DISABLE = 162; // 0xa2 core/java/android/hardware/hdmi/HdmiControlManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,20 @@ public final class HdmiControlManager { return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV); } /** * Controls standby mode of the system. It will also try to turn on/off the connected devices if * necessary. * * @param isStandbyModeOn target status of the system's standby mode */ public void setStandbyMode(boolean isStandbyModeOn) { try { mService.setStandbyMode(isStandbyModeOn); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Listener used to get hotplug event from HDMI port. */ Loading core/java/android/hardware/hdmi/IHdmiControlService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -71,4 +71,5 @@ interface IHdmiControlService { void clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource); void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data); void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener); void setStandbyMode(boolean isStandbyModeOn); } services/core/java/com/android/server/hdmi/HdmiControlService.java +34 −0 Original line number Diff line number Diff line Loading @@ -1658,6 +1658,17 @@ public final class HdmiControlService extends SystemService { HdmiControlService.this.addHdmiMhlVendorCommandListener(listener); } @Override public void setStandbyMode(final boolean isStandbyModeOn) { enforceAccessPermission(); runOnServiceThread(new Runnable() { @Override public void run() { HdmiControlService.this.setStandbyMode(isStandbyModeOn); } }); } @Override protected void dump(FileDescriptor fd, final PrintWriter writer, String[] args) { getContext().enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); Loading Loading @@ -2203,6 +2214,29 @@ public final class HdmiControlService extends SystemService { } } void setStandbyMode(boolean isStandbyModeOn) { assertRunOnServiceThread(); if (isPowerOnOrTransient() && isStandbyModeOn) { mPowerManager.goToSleep(SystemClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_HDMI, 0); if (playback() != null) { playback().sendStandby(0 /* unused */); } } else if (isPowerStandbyOrTransient() && !isStandbyModeOn) { mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.server.hdmi:WAKE"); if (playback() != null) { oneTouchPlay(new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { if (result != HdmiControlManager.RESULT_SUCCESS) { Slog.w(TAG, "Failed to complete 'one touch play'. result=" + result); } } }); } } } boolean isProhibitMode() { synchronized (mLock) { return mProhibitMode; Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -16103,6 +16103,7 @@ package android.hardware.hdmi { method public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient(); method public android.hardware.hdmi.HdmiTvClient getTvClient(); method public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener); method public void setStandbyMode(boolean); field public static final java.lang.String ACTION_OSD_MESSAGE = "android.hardware.hdmi.action.OSD_MESSAGE"; field public static final int AVR_VOLUME_MUTED = 101; // 0x65 field public static final int CLEAR_TIMER_STATUS_CEC_DISABLE = 162; // 0xa2
core/java/android/hardware/hdmi/HdmiControlManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,20 @@ public final class HdmiControlManager { return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV); } /** * Controls standby mode of the system. It will also try to turn on/off the connected devices if * necessary. * * @param isStandbyModeOn target status of the system's standby mode */ public void setStandbyMode(boolean isStandbyModeOn) { try { mService.setStandbyMode(isStandbyModeOn); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Listener used to get hotplug event from HDMI port. */ Loading
core/java/android/hardware/hdmi/IHdmiControlService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -71,4 +71,5 @@ interface IHdmiControlService { void clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource); void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data); void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener); void setStandbyMode(boolean isStandbyModeOn); }
services/core/java/com/android/server/hdmi/HdmiControlService.java +34 −0 Original line number Diff line number Diff line Loading @@ -1658,6 +1658,17 @@ public final class HdmiControlService extends SystemService { HdmiControlService.this.addHdmiMhlVendorCommandListener(listener); } @Override public void setStandbyMode(final boolean isStandbyModeOn) { enforceAccessPermission(); runOnServiceThread(new Runnable() { @Override public void run() { HdmiControlService.this.setStandbyMode(isStandbyModeOn); } }); } @Override protected void dump(FileDescriptor fd, final PrintWriter writer, String[] args) { getContext().enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); Loading Loading @@ -2203,6 +2214,29 @@ public final class HdmiControlService extends SystemService { } } void setStandbyMode(boolean isStandbyModeOn) { assertRunOnServiceThread(); if (isPowerOnOrTransient() && isStandbyModeOn) { mPowerManager.goToSleep(SystemClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_HDMI, 0); if (playback() != null) { playback().sendStandby(0 /* unused */); } } else if (isPowerStandbyOrTransient() && !isStandbyModeOn) { mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.server.hdmi:WAKE"); if (playback() != null) { oneTouchPlay(new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { if (result != HdmiControlManager.RESULT_SUCCESS) { Slog.w(TAG, "Failed to complete 'one touch play'. result=" + result); } } }); } } } boolean isProhibitMode() { synchronized (mLock) { return mProhibitMode; Loading