summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/fuelgauge
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-04-23 15:35:36 -0700
committerAmith Yamasani <yamasani@google.com>2012-04-23 15:35:36 -0700
commitb0b37ae21c172491bc170659b5f429601858ddc1 (patch)
treec48b8e9320be5e696c330331b7cddbde6ba93b03 /src/com/android/settings/fuelgauge
parentc1da7b105ae6f224a78fa7c8e151faf16e88a55c (diff)
downloadpackages_apps_settings-b0b37ae21c172491bc170659b5f429601858ddc1.zip
packages_apps_settings-b0b37ae21c172491bc170659b5f429601858ddc1.tar.gz
packages_apps_settings-b0b37ae21c172491bc170659b5f429601858ddc1.tar.bz2
Help menus for several screens.
Bug: 5144896 Change-Id: Ib2f5146f6f62f2a33261bb165c3bf1bf13b22f38
Diffstat (limited to 'src/com/android/settings/fuelgauge')
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index b813ec6..fa2b02d 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.SensorManager;
+import android.net.Uri;
import android.os.BatteryStats;
import android.os.BatteryStats.Uid;
import android.os.Bundle;
@@ -37,6 +38,7 @@ import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.telephony.SignalStrength;
+import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
@@ -72,6 +74,7 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
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 BatteryStatsImpl sStatsXfer;
@@ -318,6 +321,16 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
.setAlphabeticShortcut('r');
refresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM |
MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ 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);
+ Intent helpIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(helpUrl));
+ helpIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ help.setIntent(helpIntent);
+ help.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ }
}
@Override