packages/apps/Settings
Revisão | 71d15cf24b6b01e6e652da7aec9d4eba13f8af52 (tree) |
---|---|
Hora | 2016-10-08 21:26:32 |
Autor | Zhao Wei Liew <zhaoweiliew@gmai...> |
Commiter | Steve Kondik |
Revert "Settings: Display percentage power"
CM has its own customisations for battery icons and percentage.
Revert the unnecessary CAF patch.
This reverts commit 7140288c7f8037e0c3153517d4a0601a333365ae.
Change-Id: Id4c34a4cc4400490a8a82ebd5a3654232377650e
@@ -3143,6 +3143,4 @@ | ||
3143 | 3143 | <string name="profiles_settings_title">情景模式</string> |
3144 | 3144 | |
3145 | 3145 | <string name="mbn_version">MBN 版本</string> |
3146 | - <string name="show_battery_percentage">显示电池电量百分比</string> | |
3147 | - <string name="show_battery_percentage_summary">在状态栏中显示电池电量百分比</string> | |
3148 | 3146 | </resources> |
@@ -33,7 +33,4 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | 33 | |
34 | 34 | <!-- Whether to show_kernel version name --> |
35 | 35 | <bool name="def_hide_kernel_version_name">false</bool> |
36 | - <!-- Whether to show a preference item for battery percentage | |
37 | - in ("Battery") for India RJIL --> | |
38 | - <bool name="config_show_battery_percentage">false</bool> | |
39 | 36 | </resources> |
@@ -7594,7 +7594,4 @@ | ||
7594 | 7594 | <string name="lte_data_service_enabled">LTE data service enabled </string> |
7595 | 7595 | <string name="turn_off_wifi_dialog_title">Turn off Wi-Fi</string> |
7596 | 7596 | <string name="turn_off_wifi_dialog_text">Wi-Fi is turned off when Mobile HotSpot is active. To turn on Wi-Fi, please turn off Mobile HotSpot.</string> |
7597 | - <string name="show_battery_percentage">Show battery percentage</string> | |
7598 | - <string name="show_battery_percentage_summary">Show battery level percentage inside the status bar</string> | |
7599 | - | |
7600 | 7597 | </resources> |
@@ -23,12 +23,6 @@ | ||
23 | 23 | android:title="@string/battery_saver" |
24 | 24 | android:fragment="com.android.settings.fuelgauge.BatterySaverSettings" /> |
25 | 25 | |
26 | - <SwitchPreference | |
27 | - android:key="battery_pct" | |
28 | - android:title="@string/show_battery_percentage" | |
29 | - android:summary="@string/show_battery_percentage_summary" | |
30 | - android:persistent="false" /> | |
31 | - | |
32 | 26 | <com.android.settings.fuelgauge.BatteryHistoryPreference |
33 | 27 | android:key="battery_history" /> |
34 | 28 |
@@ -28,8 +28,6 @@ import android.os.Process; | ||
28 | 28 | import android.os.UserHandle; |
29 | 29 | import android.support.v7.preference.Preference; |
30 | 30 | import android.support.v7.preference.PreferenceGroup; |
31 | -import android.support.v14.preference.SwitchPreference; | |
32 | -import android.provider.Settings; | |
33 | 31 | import android.text.TextUtils; |
34 | 32 | import android.util.SparseArray; |
35 | 33 | import android.util.TypedValue; |
@@ -58,7 +56,6 @@ import java.util.List; | ||
58 | 56 | */ |
59 | 57 | public class PowerUsageSummary extends PowerUsageBase { |
60 | 58 | |
61 | - public static final String SHOW_PERCENT_SETTING = "status_bar_show_battery_percent"; | |
62 | 59 | private static final boolean DEBUG = false; |
63 | 60 | |
64 | 61 | private static final boolean USE_FAKE_DATA = false; |
@@ -67,7 +64,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
67 | 64 | |
68 | 65 | private static final String KEY_APP_LIST = "app_list"; |
69 | 66 | private static final String KEY_BATTERY_HISTORY = "battery_history"; |
70 | - private static final String KEY_BATTERY_PCT = "battery_pct"; | |
71 | 67 | |
72 | 68 | private static final int MENU_STATS_TYPE = Menu.FIRST; |
73 | 69 | private static final int MENU_HIGH_POWER_APPS = Menu.FIRST + 3; |
@@ -75,10 +71,8 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
75 | 71 | |
76 | 72 | private BatteryHistoryPreference mHistPref; |
77 | 73 | private PreferenceGroup mAppListGroup; |
78 | - private SwitchPreference mBatteryPct; | |
79 | 74 | |
80 | 75 | private int mStatsType = BatteryStats.STATS_SINCE_CHARGED; |
81 | - private boolean isShowBatteryPct; | |
82 | 76 | |
83 | 77 | private static final int MIN_POWER_THRESHOLD_MILLI_AMP = 5; |
84 | 78 | private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 10; |
@@ -93,11 +87,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
93 | 87 | addPreferencesFromResource(R.xml.power_usage_summary); |
94 | 88 | mHistPref = (BatteryHistoryPreference) findPreference(KEY_BATTERY_HISTORY); |
95 | 89 | mAppListGroup = (PreferenceGroup) findPreference(KEY_APP_LIST); |
96 | - mBatteryPct = (SwitchPreference) findPreference(KEY_BATTERY_PCT); | |
97 | - isShowBatteryPct = getResources().getBoolean(R.bool.config_show_battery_percentage); | |
98 | - if (!isShowBatteryPct) { | |
99 | - getPreferenceScreen().removePreference(mBatteryPct); | |
100 | - } | |
101 | 90 | } |
102 | 91 | |
103 | 92 | @Override |
@@ -108,9 +97,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
108 | 97 | @Override |
109 | 98 | public void onResume() { |
110 | 99 | super.onResume(); |
111 | - if (isShowBatteryPct) { | |
112 | - updateBatteryPct(); | |
113 | - } | |
114 | 100 | refreshStats(); |
115 | 101 | } |
116 | 102 |
@@ -493,24 +479,4 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
493 | 479 | return new SummaryProvider(activity, summaryLoader); |
494 | 480 | } |
495 | 481 | }; |
496 | - | |
497 | - private void updateBatteryPct() { | |
498 | - if (mBatteryPct != null) { | |
499 | - mBatteryPct.setChecked( | |
500 | - Settings.System.getInt(getContext().getContentResolver(), | |
501 | - SHOW_PERCENT_SETTING, 0) != 0); | |
502 | - mBatteryPct.setOnPreferenceChangeListener(mBatteryPctChange); | |
503 | - } | |
504 | - } | |
505 | - | |
506 | - private final Preference.OnPreferenceChangeListener mBatteryPctChange = | |
507 | - new Preference.OnPreferenceChangeListener() { | |
508 | - @Override | |
509 | - public boolean onPreferenceChange(Preference preference, Object newValue) { | |
510 | - final boolean v = (Boolean) newValue; | |
511 | - Settings.System.putInt(getContext().getContentResolver(), | |
512 | - SHOW_PERCENT_SETTING, v ? 1 : 0); | |
513 | - return true; | |
514 | - } | |
515 | - }; | |
516 | 482 | } |