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

Commit 06e13bdb authored by Michal Olech's avatar Michal Olech
Browse files

[CEC Configuration] Switch VOLUME_CONTROL_MODE to Shared Preferences

Test: manual test
Change-Id: I708caafc54df8f3c6393b485abdc8e5b02f1ca51
Bug: 175381065
parent c833d21b
Loading
Loading
Loading
Loading
+0 −38
Original line number Diff line number Diff line
@@ -11049,44 +11049,6 @@ public final class Settings {
        @Readable
        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)
         */
        @Readable
        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
+0 −1
Original line number Diff line number Diff line
@@ -303,7 +303,6 @@ public class SettingsBackupTest {
                    Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED,
                    Settings.Global.HDMI_CONTROL_ENABLED,
                    Settings.Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP,
                    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,
+2 −6
Original line number Diff line number Diff line
@@ -526,7 +526,7 @@ public class HdmiCecConfig {
            case HdmiControlManager.CEC_SETTING_NAME_POWER_CONTROL_MODE:
                return STORAGE_GLOBAL_SETTINGS;
            case HdmiControlManager.CEC_SETTING_NAME_VOLUME_CONTROL_MODE:
                return STORAGE_GLOBAL_SETTINGS;
                return STORAGE_SHARED_PREFS;
            case HdmiControlManager.CEC_SETTING_NAME_POWER_STATE_CHANGE_ON_ACTIVE_SOURCE_LOST:
                return STORAGE_SHARED_PREFS;
            case HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_CONTROL:
@@ -567,7 +567,7 @@ public class HdmiCecConfig {
            case HdmiControlManager.CEC_SETTING_NAME_POWER_CONTROL_MODE:
                return Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP;
            case HdmiControlManager.CEC_SETTING_NAME_VOLUME_CONTROL_MODE:
                return Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED;
                return setting.getName();
            case HdmiControlManager.CEC_SETTING_NAME_POWER_STATE_CHANGE_ON_ACTIVE_SOURCE_LOST:
                return setting.getName();
            case HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_CONTROL:
@@ -637,9 +637,6 @@ public class HdmiCecConfig {
            case Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP:
                notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_POWER_CONTROL_MODE);
                break;
            case Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED:
                notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_VOLUME_CONTROL_MODE);
                break;
            case Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED:
                notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_TV_WAKE_ON_ONE_TOUCH_PLAY);
                break;
@@ -688,7 +685,6 @@ public class HdmiCecConfig {
        String[] settings = new String[] {
                Global.HDMI_CONTROL_ENABLED,
                Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP,
                Global.HDMI_CONTROL_VOLUME_CONTROL_ENABLED,
                Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED,
                Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED,
        };