Fix content description for notification icons
Change-Id: Icb4c6d8a77211d0c8922e28958609a332b19dfcc
Fixes: 27552350
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 870447a..6d76763e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -307,9 +307,9 @@
private void setContentDescription(Notification notification) {
if (notification != null) {
- CharSequence tickerText = notification.tickerText;
- if (!TextUtils.isEmpty(tickerText)) {
- setContentDescription(tickerText);
+ String d = contentDescForNotification(mContext, notification);
+ if (!TextUtils.isEmpty(d)) {
+ setContentDescription(d);
}
}
}
@@ -322,4 +322,12 @@
public String getSlot() {
return mSlot;
}
+
+
+ public static String contentDescForNotification(Context c, Notification n) {
+ Notification.Builder builder = Notification.Builder.recoverBuilder(c, n);
+ String appName = builder.loadHeaderAppName();
+ CharSequence ticker = n.tickerText;
+ return c.getString(R.string.accessibility_desc_notification_icon, appName, ticker);
+ }
}