diff options
Diffstat (limited to 'src/com/android/settings/DataUsageSummary.java')
-rw-r--r-- | src/com/android/settings/DataUsageSummary.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java index f7a0618..17c6d88 100644 --- a/src/com/android/settings/DataUsageSummary.java +++ b/src/com/android/settings/DataUsageSummary.java @@ -818,14 +818,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); } @@ -1786,10 +1793,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable public static void show(DataUsageSummary parent) { if (!parent.isAdded()) return; + final NetworkPolicy policy = parent.mPolicyEditor.getPolicy(parent.mTemplate); + if (policy == null) return; + final Resources res = parent.getResources(); final CharSequence message; - final long minLimitBytes = (long) ( - parent.mPolicyEditor.getPolicy(parent.mTemplate).warningBytes * 1.2f); + final long minLimitBytes = (long) (policy.warningBytes * 1.2f); final long limitBytes; // TODO: customize default limits based on network template @@ -2224,6 +2233,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); |