• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão71d15cf24b6b01e6e652da7aec9d4eba13f8af52 (tree)
Hora2016-10-08 21:26:32
AutorZhao Wei Liew <zhaoweiliew@gmai...>
CommiterSteve Kondik

Mensagem de Log

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

Mudança Sumário

Diff

--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -3143,6 +3143,4 @@
31433143 <string name="profiles_settings_title">情景模式</string>
31443144
31453145 <string name="mbn_version">MBN 版本</string>
3146- <string name="show_battery_percentage">显示电池电量百分比</string>
3147- <string name="show_battery_percentage_summary">在状态栏中显示电池电量百分比</string>
31483146 </resources>
--- a/res/values/customize.xml
+++ b/res/values/customize.xml
@@ -33,7 +33,4 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
3434 <!-- Whether to show_kernel version name -->
3535 <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>
3936 </resources>
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7594,7 +7594,4 @@
75947594 <string name="lte_data_service_enabled">LTE data service enabled </string>
75957595 <string name="turn_off_wifi_dialog_title">Turn off Wi-Fi</string>
75967596 <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-
76007597 </resources>
--- a/res/xml/power_usage_summary.xml
+++ b/res/xml/power_usage_summary.xml
@@ -23,12 +23,6 @@
2323 android:title="@string/battery_saver"
2424 android:fragment="com.android.settings.fuelgauge.BatterySaverSettings" />
2525
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-
3226 <com.android.settings.fuelgauge.BatteryHistoryPreference
3327 android:key="battery_history" />
3428
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -28,8 +28,6 @@ import android.os.Process;
2828 import android.os.UserHandle;
2929 import android.support.v7.preference.Preference;
3030 import android.support.v7.preference.PreferenceGroup;
31-import android.support.v14.preference.SwitchPreference;
32-import android.provider.Settings;
3331 import android.text.TextUtils;
3432 import android.util.SparseArray;
3533 import android.util.TypedValue;
@@ -58,7 +56,6 @@ import java.util.List;
5856 */
5957 public class PowerUsageSummary extends PowerUsageBase {
6058
61- public static final String SHOW_PERCENT_SETTING = "status_bar_show_battery_percent";
6259 private static final boolean DEBUG = false;
6360
6461 private static final boolean USE_FAKE_DATA = false;
@@ -67,7 +64,6 @@ public class PowerUsageSummary extends PowerUsageBase {
6764
6865 private static final String KEY_APP_LIST = "app_list";
6966 private static final String KEY_BATTERY_HISTORY = "battery_history";
70- private static final String KEY_BATTERY_PCT = "battery_pct";
7167
7268 private static final int MENU_STATS_TYPE = Menu.FIRST;
7369 private static final int MENU_HIGH_POWER_APPS = Menu.FIRST + 3;
@@ -75,10 +71,8 @@ public class PowerUsageSummary extends PowerUsageBase {
7571
7672 private BatteryHistoryPreference mHistPref;
7773 private PreferenceGroup mAppListGroup;
78- private SwitchPreference mBatteryPct;
7974
8075 private int mStatsType = BatteryStats.STATS_SINCE_CHARGED;
81- private boolean isShowBatteryPct;
8276
8377 private static final int MIN_POWER_THRESHOLD_MILLI_AMP = 5;
8478 private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 10;
@@ -93,11 +87,6 @@ public class PowerUsageSummary extends PowerUsageBase {
9387 addPreferencesFromResource(R.xml.power_usage_summary);
9488 mHistPref = (BatteryHistoryPreference) findPreference(KEY_BATTERY_HISTORY);
9589 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- }
10190 }
10291
10392 @Override
@@ -108,9 +97,6 @@ public class PowerUsageSummary extends PowerUsageBase {
10897 @Override
10998 public void onResume() {
11099 super.onResume();
111- if (isShowBatteryPct) {
112- updateBatteryPct();
113- }
114100 refreshStats();
115101 }
116102
@@ -493,24 +479,4 @@ public class PowerUsageSummary extends PowerUsageBase {
493479 return new SummaryProvider(activity, summaryLoader);
494480 }
495481 };
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- };
516482 }