summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-08-07 22:01:22 +0100
committerKenny Guy <kennyguy@google.com>2014-08-07 22:01:22 +0100
commitcc2cbaf4212e121a6b9cf0de160af2f78572f233 (patch)
treef130d769c2df0ee85b3f2218be51b60bc7463427
parentec08228ea9a3713fbfac05fe211fc931992788a2 (diff)
downloadpackages_apps_Settings-cc2cbaf4212e121a6b9cf0de160af2f78572f233.zip
packages_apps_Settings-cc2cbaf4212e121a6b9cf0de160af2f78572f233.tar.gz
packages_apps_Settings-cc2cbaf4212e121a6b9cf0de160af2f78572f233.tar.bz2
Move over to CharSequence version of badging method.
Bug: 16484455 Change-Id: Ie5ee010efc439219cb71fd4241fdb798a5f4ea12
-rw-r--r--src/com/android/settings/fuelgauge/PowerGaugePreference.java4
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java4
-rw-r--r--src/com/android/settings/location/RecentLocationApps.java8
3 files changed, 7 insertions, 9 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerGaugePreference.java b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
index 8157b5d..a558533 100644
--- a/src/com/android/settings/fuelgauge/PowerGaugePreference.java
+++ b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
@@ -34,9 +34,9 @@ public class PowerGaugePreference extends Preference {
private BatteryEntry mInfo;
private int mProgress;
private CharSequence mProgressText;
- private final String mContentDescription;
+ private final CharSequence mContentDescription;
- public PowerGaugePreference(Context context, Drawable icon, String contentDescription,
+ public PowerGaugePreference(Context context, Drawable icon, CharSequence contentDescription,
BatteryEntry info) {
super(context);
setLayoutResource(R.layout.preference_app_percentage);
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index e6534eb..55967e2 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -297,9 +297,7 @@ public class PowerUsageSummary extends PreferenceFragment {
final BatteryEntry entry = new BatteryEntry(getActivity(), mHandler, mUm, sipper);
final Drawable badgedIcon = mUm.getBadgedDrawableForUser(entry.getIcon(),
userHandle);
- // TODO: type of this will be replaced by CharSequence (see
- // https://b.corp.google.com/issue?id=16401636 )
- final String contentDescription = mUm.getBadgedLabelForUser(entry.getLabel(),
+ final CharSequence contentDescription = mUm.getBadgedLabelForUser(entry.getLabel(),
userHandle);
final PowerGaugePreference pref = new PowerGaugePreference(getActivity(),
badgedIcon, contentDescription, entry);
diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java
index 5506181..13d282d 100644
--- a/src/com/android/settings/location/RecentLocationApps.java
+++ b/src/com/android/settings/location/RecentLocationApps.java
@@ -82,9 +82,9 @@ public class RecentLocationApps {
* them for accessibility purposes.
*/
private static class AccessiblePreference extends Preference {
- public String mContentDescription;
+ public CharSequence mContentDescription;
- public AccessiblePreference(Context context, String contentDescription) {
+ public AccessiblePreference(Context context, CharSequence contentDescription) {
super(context);
mContentDescription = contentDescription;
}
@@ -103,7 +103,7 @@ public class RecentLocationApps {
Drawable icon,
CharSequence label,
boolean isHighBattery,
- String contentDescription,
+ CharSequence contentDescription,
Preference.OnPreferenceClickListener listener) {
AccessiblePreference pref = new AccessiblePreference(mActivity, contentDescription);
pref.setIcon(icon);
@@ -209,7 +209,7 @@ public class RecentLocationApps {
Drawable appIcon = mPackageManager.getApplicationIcon(appInfo);
Drawable icon = um.getBadgedDrawableForUser(appIcon, userHandle);
CharSequence appLabel = mPackageManager.getApplicationLabel(appInfo);
- String badgedAppLabel = um.getBadgedLabelForUser(appLabel.toString(), userHandle);
+ CharSequence badgedAppLabel = um.getBadgedLabelForUser(appLabel.toString(), userHandle);
preference = createRecentLocationEntry(icon,
appLabel, highBattery, badgedAppLabel,
new PackageEntryClickedListener(packageName));