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

Commit bae425ef authored by Michal Olech's avatar Michal Olech
Browse files

[CEC Configuration] Switch HDMI_CEC_ENABLED to Shared Preferences

Bug: 181203672
Test: manual test
Change-Id: I74808d8e9e1034d4fe5eadccc15ccbc353e09975
parent ef86923d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1422,7 +1422,8 @@ public final class HdmiControlManager {
         * Called when HDMI Control (CEC) is enabled/disabled.
         *
         * @param isCecEnabled status of HDMI Control
         * {@link android.provider.Settings.Global#HDMI_CONTROL_ENABLED}: {@code true} if enabled.
         * {@link android.hardware.hdmi.HdmiControlManager#CEC_SETTING_NAME_HDMI_CEC_ENABLED}:
         * {@code HDMI_CEC_CONTROL_ENABLED} if enabled.
         * @param isCecAvailable status of CEC support of the connected display (the TV).
         * {@code true} if supported.
         *
+0 −8
Original line number Diff line number Diff line
@@ -11049,14 +11049,6 @@ public final class Settings {
        @Deprecated
        public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
        /**
        * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
        * sent or processed. (0 = false, 1 = true)
        * @hide
        */
        @Readable
        public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
        /**
         * Whether TV will also turn off other CEC devices when it goes to standby mode.
         * (0 = false, 1 = true)
+0 −3
Original line number Diff line number Diff line
@@ -801,9 +801,6 @@ class SettingsProtoDumpUtil {
        p.end(gpuToken);

        final long hdmiToken = p.start(GlobalSettingsProto.HDMI);
        dumpSetting(s, p,
                Settings.Global.HDMI_CONTROL_ENABLED,
                GlobalSettingsProto.Hdmi.CONTROL_ENABLED);
        dumpSetting(s, p,
                Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED,
                GlobalSettingsProto.Hdmi.CONTROL_AUTO_DEVICE_OFF_ENABLED);
+0 −1
Original line number Diff line number Diff line
@@ -300,7 +300,6 @@ public class SettingsBackupTest {
                    Settings.Global.GNSS_SATELLITE_BLOCKLIST,
                    Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS,
                    Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED,
                    Settings.Global.HDMI_CONTROL_ENABLED,
                    Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED,
                    Settings.Global.HIDDEN_API_POLICY,
                    Settings.Global.FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT,
+2 −6
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ public class HdmiCecConfig {
    private int getStorage(@NonNull Setting setting) {
        switch (setting.getName()) {
            case HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED:
                return STORAGE_GLOBAL_SETTINGS;
                return STORAGE_SHARED_PREFS;
            case HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_VERSION:
                return STORAGE_SHARED_PREFS;
            case HdmiControlManager.CEC_SETTING_NAME_ROUTING_CONTROL:
@@ -559,7 +559,7 @@ public class HdmiCecConfig {
    private String getStorageKey(@NonNull Setting setting) {
        switch (setting.getName()) {
            case HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED:
                return Global.HDMI_CONTROL_ENABLED;
                return setting.getName();
            case HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_VERSION:
                return setting.getName();
            case HdmiControlManager.CEC_SETTING_NAME_ROUTING_CONTROL:
@@ -631,9 +631,6 @@ public class HdmiCecConfig {

    private void notifyGlobalSettingChanged(String setting) {
        switch (setting) {
            case Global.HDMI_CONTROL_ENABLED:
                notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED);
                break;
            case Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED:
                notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_TV_SEND_STANDBY_ON_SLEEP);
                break;
@@ -677,7 +674,6 @@ public class HdmiCecConfig {
        mSettingsObserver = new SettingsObserver(handler);
        ContentResolver resolver = mContext.getContentResolver();
        String[] settings = new String[] {
                Global.HDMI_CONTROL_ENABLED,
                Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED,
        };
        for (String setting: settings) {
Loading