diff options
author | John Spurlock <jspurlock@google.com> | 2014-06-04 19:11:22 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-06-10 17:26:47 -0400 |
commit | c7f8e8ce69e80ea495472aade5f8569c6583c5e8 (patch) | |
tree | 7572c6cdf84b6e29365e921ede0d6c9720399d2f /src/com/android/settings/fuelgauge/PowerUsageSummary.java | |
parent | 2eae7a40229b132bed632df0879e4056a7c5a107 (diff) | |
download | packages_apps_Settings-c7f8e8ce69e80ea495472aade5f8569c6583c5e8.zip packages_apps_Settings-c7f8e8ce69e80ea495472aade5f8569c6583c5e8.tar.gz packages_apps_Settings-c7f8e8ce69e80ea495472aade5f8569c6583c5e8.tar.bz2 |
Settings: Battery saver settings sub-page.
New battery saver settings page, accessed via
the power usage settings overflow menu.
The settings page has a master switch to toggle
battery saver mode, feature disclosure text,
and a preference to configure the automatic
trigger level.
Remove developer checkbox now that this option
has a real home.
NO_SQ: multi project change
Bug:13329308
Change-Id: Iac54238f3406439711b44a3c17f220ac5e370a37
Diffstat (limited to 'src/com/android/settings/fuelgauge/PowerUsageSummary.java')
-rw-r--r-- | src/com/android/settings/fuelgauge/PowerUsageSummary.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java index e4e2b0a..1159a2c 100644 --- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java +++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java @@ -60,7 +60,8 @@ public class PowerUsageSummary extends PreferenceFragment { private static final int MENU_STATS_TYPE = Menu.FIRST; private static final int MENU_STATS_REFRESH = Menu.FIRST + 1; - private static final int MENU_HELP = Menu.FIRST + 2; + private static final int MENU_BATTERY_SAVER = Menu.FIRST + 2; + private static final int MENU_HELP = Menu.FIRST + 3; private UserManager mUm; @@ -180,6 +181,9 @@ public class PowerUsageSummary extends PreferenceFragment { refresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); + MenuItem batterySaver = menu.add(0, MENU_BATTERY_SAVER, 0, R.string.battery_saver); + batterySaver.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + String helpUrl; if (!TextUtils.isEmpty(helpUrl = getResources().getString(R.string.help_url_battery))) { final MenuItem help = menu.add(0, MENU_HELP, 0, R.string.help_label); @@ -203,6 +207,11 @@ public class PowerUsageSummary extends PreferenceFragment { refreshStats(); mHandler.removeMessages(MSG_REFRESH_STATS); return true; + case MENU_BATTERY_SAVER: + final SettingsActivity sa = (SettingsActivity) getActivity(); + sa.startPreferencePanel(BatterySaverSettings.class.getName(), null, + R.string.battery_saver, null, null, 0); + return true; default: return false; } |