Revert "Cherish: Smart Pixels [2/2]"

This reverts commit 524e9baaaf.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Hưng Phan
2023-03-20 01:34:36 +07:00
parent a57d28d4a0
commit 9cad4320b3
6 changed files with 0 additions and 190 deletions

View File

@@ -510,51 +510,6 @@
<item>1800000</item> <item>1800000</item>
</string-array> </string-array>
<!-- Smart Pixels -->
<string-array name="smart_pixels_percent_strings" translatable="false">
<item>12</item>
<item>25</item>
<item>38</item>
<item>50</item>
<item>62</item>
<item>75</item>
<item>88</item>
</string-array>
<string-array name="smart_pixels_percent_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="smart_pixels_shift_times" translatable="false">
<item>@string/custom_timeout_summary_15secs</item>
<item>@string/custom_timeout_summary_30secs</item>
<item>@string/custom_timeout_summary_1min</item>
<item>@string/custom_timeout_summary_2mins</item>
<item>@string/custom_timeout_summary_5mins</item>
<item>@string/custom_timeout_summary_10mins</item>
<item>@string/custom_timeout_summary_20mins</item>
<item>@string/custom_timeout_summary_30mins</item>
<item>@string/custom_timeout_summary_1hour</item>
</string-array>
<string-array name="smart_pixels_shift_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</string-array>
<!-- Ambient light --> <!-- Ambient light -->
<string-array name="pulse_ambient_light_color_mode_entries"> <string-array name="pulse_ambient_light_color_mode_entries">
<item>@string/pulse_ambient_light_color_mode_notification</item> <item>@string/pulse_ambient_light_color_mode_notification</item>

View File

@@ -736,18 +736,6 @@
<string name="click_partial_screenshot_title">Click to partial screenshot</string> <string name="click_partial_screenshot_title">Click to partial screenshot</string>
<string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string> <string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string>
<!-- Smart Pixels -->
<string name="smart_pixels_warning_text">Smart pixels is a power saving feature. Depending on how many pixels you decide to turn off, you could see improvement in battery life. Note that in some cases it can result in unresponsive areas on touch screen</string>
<string name="smart_pixels_title">Smart Pixels</string>
<string name="smart_pixels_summary">Save battery by shutting off extra pixels</string>
<string name="smart_pixels_enable_title">Enable Smart Pixels</string>
<string name="smart_pixels_enable_summary">Shut off pixels to reduce power consumption</string>
<string name="smart_pixels_on_power_save_title">Auto-enable on battery saver</string>
<string name="smart_pixels_on_power_save_summary">Enable Smart Pixels when battery saver is enabled</string>
<string name="smart_pixels_percent">Percent of pixels to disable</string>
<string name="smart_pixels_shift_title">Burn-in protection</string>
<string name="smart_pixels_shift_summary">Prevents burn-in on OLED devices by shifting pixels every so often</string>
<!-- Ambient edge lighting --> <!-- Ambient edge lighting -->
<string name="pulse_ambient_light_category">Screen edge lighting</string> <string name="pulse_ambient_light_category">Screen edge lighting</string>

View File

@@ -45,13 +45,6 @@
android:fragment="com.cherish.settings.security.applock.AppLockSettingsFragment" android:fragment="com.cherish.settings.security.applock.AppLockSettingsFragment"
settings:controller="com.cherish.settings.security.applock.AppLockSettingsPreferenceController" /> settings:controller="com.cherish.settings.security.applock.AppLockSettingsPreferenceController" />
<!-- Smart Pixels -->
<Preference
android:key="smart_pixels"
android:title="@string/smart_pixels_title"
android:summary="@string/smart_pixels_summary"
android:fragment="com.cherish.settings.fragments.SmartPixels" />
<!-- Unlock FPS for specific games --> <!-- Unlock FPS for specific games -->
<SwitchPreference <SwitchPreference
android:key="use_games_spoof" android:key="use_games_spoof"

View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018-2022 crDroid Android Project
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/smart_pixels_title" >
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="smart_pixels_enable"
android:title="@string/smart_pixels_enable_title"
android:summary="@string/smart_pixels_enable_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="smart_pixels_pattern"
android:entries="@array/smart_pixels_percent_strings"
android:entryValues="@array/smart_pixels_percent_values"
android:defaultValue="5"
android:dependency="smart_pixels_enable"
android:title="@string/smart_pixels_percent"
android:dialogTitle="@string/smart_pixels_percent" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="smart_pixels_on_power_save"
android:title="@string/smart_pixels_on_power_save_title"
android:summary="@string/smart_pixels_on_power_save_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="smart_pixels_shift_timeout"
android:entries="@array/smart_pixels_shift_times"
android:entryValues="@array/smart_pixels_shift_values"
android:defaultValue="4"
android:title="@string/smart_pixels_shift_title"
android:summary="@string/smart_pixels_shift_summary"
android:dialogTitle="@string/smart_pixels_shift_title" />
<com.android.settingslib.widget.FooterPreference
android:key="smart_pixels_footer"
android:selectable="false"
settings:searchable="false" />
</PreferenceScreen>

View File

@@ -40,7 +40,6 @@ import com.android.settingslib.search.SearchIndexable;
import android.provider.SearchIndexableResource; import android.provider.SearchIndexableResource;
import com.cherish.settings.fragments.SmartCharging; import com.cherish.settings.fragments.SmartCharging;
import com.cherish.settings.fragments.SmartPixels;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -54,12 +53,10 @@ public class MiscSettings extends SettingsPreferenceFragment implements
private static final String SYS_PHOTOS_SPOOF = "persist.sys.pixelprops.gphotos"; private static final String SYS_PHOTOS_SPOOF = "persist.sys.pixelprops.gphotos";
private static final String SMART_CHARGING = "smart_charging"; private static final String SMART_CHARGING = "smart_charging";
private static final String SMART_PIXELS = "smart_pixels";
private SwitchPreference mGamesSpoof; private SwitchPreference mGamesSpoof;
private SwitchPreference mPhotosSpoof; private SwitchPreference mPhotosSpoof;
private Preference mSmartCharging; private Preference mSmartCharging;
private Preference mSmartPixels;
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
@@ -84,12 +81,6 @@ public class MiscSettings extends SettingsPreferenceFragment implements
com.android.internal.R.bool.config_smartChargingAvailable); com.android.internal.R.bool.config_smartChargingAvailable);
if (!mSmartChargingSupported) if (!mSmartChargingSupported)
prefScreen.removePreference(mSmartCharging); prefScreen.removePreference(mSmartCharging);
mSmartPixels = (Preference) prefScreen.findPreference(SMART_PIXELS);
boolean mSmartPixelsSupported = getResources().getBoolean(
com.android.internal.R.bool.config_supportSmartPixels);
if (!mSmartPixelsSupported)
prefScreen.removePreference(mSmartPixels);
} }
@@ -121,12 +112,8 @@ public class MiscSettings extends SettingsPreferenceFragment implements
boolean mSmartChargingSupported = context.getResources().getBoolean( boolean mSmartChargingSupported = context.getResources().getBoolean(
com.android.internal.R.bool.config_smartChargingAvailable); com.android.internal.R.bool.config_smartChargingAvailable);
boolean mSmartPixelsSupported = context.getResources().getBoolean(
com.android.internal.R.bool.config_supportSmartPixels);
if (!mSmartChargingSupported) if (!mSmartChargingSupported)
keys.add(SMART_CHARGING); keys.add(SMART_CHARGING);
if (!mSmartPixelsSupported)
keys.add(SMART_PIXELS);
return keys; return keys;
} }

View File

@@ -1,57 +0,0 @@
/*
* Copyright (C) 2018-2022 crDroid Android Project
*
* 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.
*/
package com.cherish.settings.fragments;
import android.content.Context;
import android.content.ContentResolver;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.Settings;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
public class SmartPixels extends SettingsPreferenceFragment {
private static final String TAG = "SmartPixels";
private static final String SMART_PIXELS_FOOTER = "smart_pixels_footer";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.cherish_settings_smart_pixels);
findPreference(SMART_PIXELS_FOOTER).setTitle(R.string.smart_pixels_warning_text);
}
@Override
public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
}
}