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

Commit 69a0feac authored by Aaron Echols's avatar Aaron Echols Committed by Steve Kondik
Browse files

settings: add volume rocker resource

Some devices, such as the LG G-Slate v909 (PMU), don't support
Volume Rocker Wake. This commit will add a new boolean resource
(config_volumeRockerWake) to allow disabling the feature easily
for devices that do not support it.

Change-Id: I42c3d8d5bad9ae2244521fc50264c774d2edfb20
parent 2ecc462b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -28,4 +28,9 @@
    <!-- Ad-hoc network support. Some devices (unpatched bcmdhd) have broken
         ad-hoc support and so we should hide ad-hoc network on those devices -->
    <bool name="config_show_adhoc_network">true</bool>

    <!-- Volume Rocker Wake Support. Some devices do not support (PMU) this.
         Setting to false will disable Volume Rocker Wake support -->
    <bool name="config_show_volumeRockerWake">true</bool>

</resources>
+9 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
    private static final String KEY_ELECTRON_BEAM_ANIMATION_ON = "electron_beam_animation_on";
    private static final String KEY_ELECTRON_BEAM_ANIMATION_OFF = "electron_beam_animation_off";
    private static final String KEY_ELECTRON_BEAM_CATEGORY_ANIMATION = "category_animation_options";
    private static final String KEY_WAKEUP_CATEGORY = "category_wakeup_options";
    private static final String KEY_VOLUME_WAKE = "pref_volume_wake";

    private static final String ROTATION_ANGLE_0 = "0";
@@ -151,10 +152,16 @@ public class DisplaySettings extends SettingsPreferenceFragment implements

        mVolumeWake = (CheckBoxPreference) findPreference(KEY_VOLUME_WAKE);
        if (mVolumeWake != null) {
            if (!getResources().getBoolean(R.bool.config_show_volumeRockerWake)) {
                getPreferenceScreen().removePreference(mVolumeWake);
                getPreferenceScreen().removePreference((PreferenceCategory) findPreference(KEY_WAKEUP_CATEGORY));
            } else {
                mVolumeWake.setChecked(Settings.System.getInt(resolver,
                        Settings.System.VOLUME_WAKE_SCREEN, 0) == 1);
            }

        }

    }

    private void updateDisplayRotationPreferenceDescription() {