Cherish: Introduce automated Sleep Mode [3/3]

Inspierd by Havoc-OS

https://github.com/Havoc-OS/android_packages_apps_ConfigCenter/commit/f8f0c586

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
SKULSHADY
2021-08-07 08:52:07 +09:00
committed by Hưng Phan
parent 9bc17d726b
commit 2ee9aec4f9
6 changed files with 580 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 Havoc-OS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/sleep_mode_title">
<DropDownPreference
android:key="sleep_mode_auto_mode"
android:title="@string/night_display_auto_mode_title"
android:entries="@array/sleep_mode_auto_mode_entries"
android:entryValues="@array/sleep_mode_auto_mode_values"
android:persistent="false" />
<Preference
android:key="sleep_mode_auto_since"
android:title="@string/night_display_start_time_title" />
<Preference
android:key="sleep_mode_auto_till"
android:title="@string/night_display_end_time_title" />
<PreferenceCategory
android:key="sleep_mode_toggles"
android:title="@string/sleep_mode_toggles_title">
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_wifi_toggle"
android:title="@string/sleep_mode_wifi_toggle_title"
android:summary="@string/sleep_mode_wifi_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_bluetooth_toggle"
android:title="@string/sleep_mode_bluetooth_toggle_title"
android:summary="@string/sleep_mode_bluetooth_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_cellular_toggle"
android:title="@string/sleep_mode_cellular_toggle_title"
android:summary="@string/sleep_mode_cellular_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_location_toggle"
android:title="@string/sleep_mode_location_toggle_title"
android:summary="@string/sleep_mode_location_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_sensors_toggle"
android:title="@string/sleep_mode_sensors_toggle_title"
android:summary="@string/sleep_mode_sensors_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_aod_toggle"
android:title="@string/sleep_mode_aod_toggle_title"
android:summary="@string/sleep_mode_aod_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sleep_mode_aggressive_toggle"
android:title="@string/sleep_mode_aggressive_toggle_title"
android:summary="@string/sleep_mode_aggressive_toggle_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SecureSettingListPreference
android:key="sleep_mode_ringer_mode"
android:title="@string/gaming_mode_ringer_title"
android:entries="@array/gaming_mode_ringer_entries"
android:entryValues="@array/gaming_mode_ringer_values"
android:defaultValue="0"
android:summary="%s" />
</PreferenceCategory>
<com.android.settingslib.widget.LayoutPreference
android:key="sleep_mode_button"
android:title="@string/sleep_mode_title"
android:selectable="false"
android:layout="@layout/sleep_mode_activation_button"
settings:allowDividerAbove="true"
settings:allowDividerBelow="true" />
<com.android.settingslib.widget.FooterPreference
android:key="sleep_mode_footer"
android:title="@string/sleep_mode_display_text"
android:selectable="false"
settings:searchable="false"/>
</PreferenceScreen>