Loading core/java/android/hardware/hdmi/HdmiControlManager.java +62 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,68 @@ public final class HdmiControlManager { } } /** * Controls whether volume control commands via HDMI CEC are enabled. * * <p>When disabled: * <ul> * <li>the device will not send any HDMI CEC audio messages * <li>received HDMI CEC audio messages are responded to with {@code <Feature Abort>} * </ul> * * <p>Effects on different device types: * <table> * <tr><th>HDMI CEC device type</th><th>enabled</th><th>disabled</th></tr> * <tr> * <td>TV (type: 0)</td> * <td>Per CEC specification.</td> * <td>TV changes system volume. TV no longer reacts to incoming volume changes via * {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio Status>} * .</td> * </tr> * <tr> * <td>Playback device (type: 4)</td> * <td>Device sends volume commands to TV/Audio system via {@code <User Control * Pressed>}</td><td>Device does not send volume commands via {@code <User Control * Pressed>}.</td> * </tr> * <tr> * <td>Audio device (type: 5)</td> * <td>Full "System Audio Control" capabilities.</td> * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} * volume commands. Audio device no longer reports volume changes via {@code <Report * Audio Status>}.</td> * </tr> * </table> * * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. * * @param isHdmiCecVolumeControlEnabled target state of HDMI CEC volume control. * @see Settings.Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled) { try { mService.setHdmiCecVolumeControlEnabled(isHdmiCecVolumeControlEnabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns whether volume changes via HDMI CEC are enabled. * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public boolean isHdmiCecVolumeControlEnabled() { try { return mService.isHdmiCecVolumeControlEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets whether the system is in system audio mode. * Loading core/java/android/hardware/hdmi/IHdmiControlService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ interface IHdmiControlService { void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data); void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener); void setStandbyMode(boolean isStandbyModeOn); void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled); boolean isHdmiCecVolumeControlEnabled(); void reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute); void setSystemAudioModeOnForAudioOnlySource(); } core/java/android/provider/Settings.java +37 −0 Original line number Diff line number Diff line Loading @@ -9614,6 +9614,43 @@ public final class Settings { */ public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; /** * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 = * true). * * <p>Effects on different device types: * <table> * <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr> * <tr> * <td>TV (type: 0)</td> * <td>Per CEC specification.</td> * <td>TV changes system volume. TV no longer reacts to incoming volume changes * via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio * Status>}.</td> * </tr> * <tr> * <td>Playback device (type: 4)</td> * <td>Device sends volume commands to TV/Audio system via {@code <User Control * Pressed>}</td> * <td>Device does not send volume commands via {@code <User Control Pressed>}.</td> * </tr> * <tr> * <td>Audio device (type: 5)</td> * <td>Full "System Audio Control" capabilities.</td> * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} * volume commands. Audio device no longer reports volume changes via {@code * <Report Audio Status>}.</td> * </tr> * </table> * * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. * * @hide * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean) */ public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED = "hdmi_control_volume_control_enabled"; /** * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will Loading core/tests/hdmitests/src/android/hardware/hdmi/HdmiAudioSystemClientTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -354,6 +354,15 @@ public class HdmiAudioSystemClientTest { @Override public void askRemoteDeviceToBecomeActiveSource(int physicalAddress) { } @Override public void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled) { } @Override public boolean isHdmiCecVolumeControlEnabled() { return true; } } } packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,7 @@ public class SettingsBackupTest { Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED, Settings.Global.HDMI_CONTROL_ENABLED, Settings.Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED, Settings.Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, Settings.Global.HIDDEN_API_POLICY, Loading Loading
core/java/android/hardware/hdmi/HdmiControlManager.java +62 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,68 @@ public final class HdmiControlManager { } } /** * Controls whether volume control commands via HDMI CEC are enabled. * * <p>When disabled: * <ul> * <li>the device will not send any HDMI CEC audio messages * <li>received HDMI CEC audio messages are responded to with {@code <Feature Abort>} * </ul> * * <p>Effects on different device types: * <table> * <tr><th>HDMI CEC device type</th><th>enabled</th><th>disabled</th></tr> * <tr> * <td>TV (type: 0)</td> * <td>Per CEC specification.</td> * <td>TV changes system volume. TV no longer reacts to incoming volume changes via * {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio Status>} * .</td> * </tr> * <tr> * <td>Playback device (type: 4)</td> * <td>Device sends volume commands to TV/Audio system via {@code <User Control * Pressed>}</td><td>Device does not send volume commands via {@code <User Control * Pressed>}.</td> * </tr> * <tr> * <td>Audio device (type: 5)</td> * <td>Full "System Audio Control" capabilities.</td> * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} * volume commands. Audio device no longer reports volume changes via {@code <Report * Audio Status>}.</td> * </tr> * </table> * * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. * * @param isHdmiCecVolumeControlEnabled target state of HDMI CEC volume control. * @see Settings.Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled) { try { mService.setHdmiCecVolumeControlEnabled(isHdmiCecVolumeControlEnabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns whether volume changes via HDMI CEC are enabled. * @hide */ @RequiresPermission(android.Manifest.permission.HDMI_CEC) public boolean isHdmiCecVolumeControlEnabled() { try { return mService.isHdmiCecVolumeControlEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets whether the system is in system audio mode. * Loading
core/java/android/hardware/hdmi/IHdmiControlService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ interface IHdmiControlService { void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data); void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener); void setStandbyMode(boolean isStandbyModeOn); void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled); boolean isHdmiCecVolumeControlEnabled(); void reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute); void setSystemAudioModeOnForAudioOnlySource(); }
core/java/android/provider/Settings.java +37 −0 Original line number Diff line number Diff line Loading @@ -9614,6 +9614,43 @@ public final class Settings { */ public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; /** * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 = * true). * * <p>Effects on different device types: * <table> * <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr> * <tr> * <td>TV (type: 0)</td> * <td>Per CEC specification.</td> * <td>TV changes system volume. TV no longer reacts to incoming volume changes * via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio * Status>}.</td> * </tr> * <tr> * <td>Playback device (type: 4)</td> * <td>Device sends volume commands to TV/Audio system via {@code <User Control * Pressed>}</td> * <td>Device does not send volume commands via {@code <User Control Pressed>}.</td> * </tr> * <tr> * <td>Audio device (type: 5)</td> * <td>Full "System Audio Control" capabilities.</td> * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} * volume commands. Audio device no longer reports volume changes via {@code * <Report Audio Status>}.</td> * </tr> * </table> * * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. * * @hide * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean) */ public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED = "hdmi_control_volume_control_enabled"; /** * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will Loading
core/tests/hdmitests/src/android/hardware/hdmi/HdmiAudioSystemClientTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -354,6 +354,15 @@ public class HdmiAudioSystemClientTest { @Override public void askRemoteDeviceToBecomeActiveSource(int physicalAddress) { } @Override public void setHdmiCecVolumeControlEnabled(boolean isHdmiCecVolumeControlEnabled) { } @Override public boolean isHdmiCecVolumeControlEnabled() { return true; } } }
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,7 @@ public class SettingsBackupTest { Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED, Settings.Global.HDMI_CONTROL_ENABLED, Settings.Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED, Settings.Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, Settings.Global.HIDDEN_API_POLICY, Loading