Loading core/java/android/hardware/hdmi/HdmiControlManager.java +54 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,16 @@ public final class HdmiControlManager { * @hide */ public static final int TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_DREAM = 1; /** * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @IntDef(prefix = { "TV_BEHAVIOR_ON_STANDBY_MESSAGE_" }, value = { TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_SLEEP, TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_DREAM }) @Retention(RetentionPolicy.SOURCE) public @interface TvBehaviorOnStandbyMessage {} // -- Scope of CEC power control messages sent by a playback device. /** Loading Loading @@ -2415,6 +2425,50 @@ public final class HdmiControlManager { } } /** * Set the TV's behavior upon receiving a <Standby> message. * * <p>Sets whether the TV should go to sleep or go to dream. * * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setTvBehaviorOnStandbyMessage(@NonNull @TvBehaviorOnStandbyMessage int value) { if (mService == null) { Log.e(TAG, "setTvBehaviorOnStandbyMessage: HdmiControlService is not available"); throw new RuntimeException("HdmiControlService is not available"); } try { mService.setCecSettingIntValue(CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE, value); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Get the TV's behavior upon receiving a <Standby> message. * * <p>Reflects whether the TV will go to sleep or go to dream. * * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @NonNull @TvBehaviorOnStandbyMessage @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getTvBehaviorOnStandbyMessage() { if (mService == null) { Log.e(TAG, "getTvBehaviorOnStandbyMessage: HdmiControlService is not available"); throw new RuntimeException("HdmiControlService is not available"); } try { return mService.getCecSettingIntValue(CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Set the status of Power Control. * Loading Loading
core/java/android/hardware/hdmi/HdmiControlManager.java +54 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,16 @@ public final class HdmiControlManager { * @hide */ public static final int TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_DREAM = 1; /** * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @IntDef(prefix = { "TV_BEHAVIOR_ON_STANDBY_MESSAGE_" }, value = { TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_SLEEP, TV_BEHAVIOR_ON_STANDBY_MESSAGE_GO_TO_DREAM }) @Retention(RetentionPolicy.SOURCE) public @interface TvBehaviorOnStandbyMessage {} // -- Scope of CEC power control messages sent by a playback device. /** Loading Loading @@ -2415,6 +2425,50 @@ public final class HdmiControlManager { } } /** * Set the TV's behavior upon receiving a <Standby> message. * * <p>Sets whether the TV should go to sleep or go to dream. * * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setTvBehaviorOnStandbyMessage(@NonNull @TvBehaviorOnStandbyMessage int value) { if (mService == null) { Log.e(TAG, "setTvBehaviorOnStandbyMessage: HdmiControlService is not available"); throw new RuntimeException("HdmiControlService is not available"); } try { mService.setCecSettingIntValue(CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE, value); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Get the TV's behavior upon receiving a <Standby> message. * * <p>Reflects whether the TV will go to sleep or go to dream. * * @see HdmiControlManager#CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE * @hide */ @NonNull @TvBehaviorOnStandbyMessage @RequiresPermission(android.Manifest.permission.HDMI_CEC) public int getTvBehaviorOnStandbyMessage() { if (mService == null) { Log.e(TAG, "getTvBehaviorOnStandbyMessage: HdmiControlService is not available"); throw new RuntimeException("HdmiControlService is not available"); } try { return mService.getCecSettingIntValue(CEC_SETTING_NAME_TV_BEHAVIOR_ON_STANDBY_MESSAGE); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Set the status of Power Control. * Loading