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

Commit d9071dea authored by Lucas Silva's avatar Lucas Silva
Browse files

Add master toggle to enable/disable screen savers

The new control toggles the Settings.Secure.SCREENSAVER_ENABLED setting,
which controls if a screen saver is enabled. Also removed the "Never"
option from the WhenToDream picker, since this is now controlled via the
toggle.

Test: locally on device
Bug: 222360260
Change-Id: Ibcf52b5e2d1ad0c295f32c4c18bfc89082d074ce
parent 3ccdcd43
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@

<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_enabled="false" android:color="?androidprv:attr/colorSurface"
          android:alpha="?android:attr/disabledAlpha"/>
    <item android:state_selected="true" android:color="?androidprv:attr/colorAccentPrimary"/>
    <item android:color="?androidprv:attr/colorSurface"/>
</selector>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@

<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_enabled="false" android:color="?android:attr/textColorPrimary"
          android:alpha="?android:attr/disabledAlpha"/>
    <item android:state_selected="true" android:color="?androidprv:attr/textColorOnAccent"/>
    <item android:color="?android:attr/textColorPrimary"/>
</selector>
 No newline at end of file
+0 −2
Original line number Diff line number Diff line
@@ -1220,14 +1220,12 @@
        <item>@string/screensaver_settings_summary_sleep</item>
        <item>@string/screensaver_settings_summary_dock</item>
        <item>@string/screensaver_settings_summary_either_long</item>
        <item>@string/screensaver_settings_summary_never</item>
    </string-array>

    <string-array name="when_to_start_screensaver_values" translatable="false">
        <item>while_charging_only</item>
        <item>while_docked_only</item>
        <item>either_charging_or_docked</item>
        <item>never</item>
    </string-array>

    <string-array name="zen_mode_contacts_messages_entries" translatable="false">
+2 −0
Original line number Diff line number Diff line
@@ -3168,6 +3168,8 @@
    <string name="style_suggestion_summary">Try different styles, wallpapers, and more</string>
    <!-- Display settings screen, trigger for screen saver options -->
    <string name="screensaver_settings_title">Screen saver</string>
    <!-- The title for the toggle which disables/enables screen savers [CHAR_LIMIT=30] -->
    <string name="screensaver_settings_toggle_title">Use screen saver</string>
    <!-- Display settings screen, summary fragment for screen saver options, activated when docked or asleep and charging -->
    <string name="screensaver_settings_summary_either_long">While charging or docked</string>
    <!-- Dream settings screen, dialog option, activated when docked or asleep and charging -->
+27 −18
Original line number Diff line number Diff line
@@ -19,6 +19,14 @@
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/screensaver_settings_title">

    <com.android.settingslib.widget.MainSwitchPreference
        android:key="dream_main_settings_switch"
        android:title="@string/screensaver_settings_toggle_title"
        settings:controller="com.android.settings.dream.DreamMainSwitchPreferenceController"
        settings:searchable="false"/>

    <PreferenceCategory
        android:key="dream_main_category">
        <PreferenceCategory
            android:title="@string/dream_picker_category">
            <com.android.settingslib.widget.LayoutPreference
@@ -40,5 +48,6 @@
                android:title="@string/screensaver_settings_when_to_dream"
                android:fragment="com.android.settings.dream.WhenToDreamPicker"/>
        </PreferenceCategory>
    </PreferenceCategory>

</PreferenceScreen>
Loading