summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DataUsageSummary.java
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2014-07-23 11:02:46 +0100
committerZoltan Szatmary-Ban <szatmz@google.com>2014-08-07 14:15:14 +0100
commitebb36ec9207c9519f6ae6a1aa39909279aa1d0e9 (patch)
tree7c85ef5e23b7eebad8d9eef33d5b13878f113d74 /src/com/android/settings/DataUsageSummary.java
parentf34c3501948190acf44defefba8eb161ec6dc07b (diff)
downloadpackages_apps_Settings-ebb36ec9207c9519f6ae6a1aa39909279aa1d0e9.zip
packages_apps_Settings-ebb36ec9207c9519f6ae6a1aa39909279aa1d0e9.tar.gz
packages_apps_Settings-ebb36ec9207c9519f6ae6a1aa39909279aa1d0e9.tar.bz2
Badge texts correctly for accessibility in Settings
If an app is a managed profile's app then its label should read correctly by TalkBack. Affected screens: Data Usage, Location, Battery. Bug:16053981 Change-Id: I393c0ebf56917032d619b1e39b4bf141ee236981
Diffstat (limited to 'src/com/android/settings/DataUsageSummary.java')
-rw-r--r--src/com/android/settings/DataUsageSummary.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index c8691e1..ec52128 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -819,14 +819,21 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
View title = null;
if (detail.detailLabels != null) {
- for (CharSequence label : detail.detailLabels) {
+ final int n = detail.detailLabels.length;
+ for (int i = 0; i < n; ++i) {
+ CharSequence label = detail.detailLabels[i];
+ CharSequence contentDescription = detail.detailContentDescriptions[i];
title = inflater.inflate(R.layout.data_usage_app_title, mAppTitles, false);
- ((TextView) title.findViewById(R.id.app_title)).setText(label);
+ TextView appTitle = (TextView) title.findViewById(R.id.app_title);
+ appTitle.setText(label);
+ appTitle.setContentDescription(contentDescription);
mAppTitles.addView(title);
}
} else {
title = inflater.inflate(R.layout.data_usage_app_title, mAppTitles, false);
- ((TextView) title.findViewById(R.id.app_title)).setText(detail.label);
+ TextView appTitle = (TextView) title.findViewById(R.id.app_title);
+ appTitle.setText(detail.label);
+ appTitle.setContentDescription(detail.contentDescription);
mAppTitles.addView(title);
}
@@ -2222,6 +2229,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
if (detail != null) {
icon.setImageDrawable(detail.icon);
title.setText(detail.label);
+ title.setContentDescription(detail.contentDescription);
} else {
icon.setImageDrawable(null);
title.setText(null);