Merge "A11y: Show title if ticker is not available" into nyc-dev

This commit is contained in:
Adrian Roos
2016-04-29 15:59:42 +00:00
committed by Android (Google) Code Review

View File

@@ -327,7 +327,14 @@ public class StatusBarIconView extends AnimatedImageView {
public static String contentDescForNotification(Context c, Notification n) {
Notification.Builder builder = Notification.Builder.recoverBuilder(c, n);
String appName = builder.loadHeaderAppName();
CharSequence title = n.extras.getString(Notification.EXTRA_TITLE);
CharSequence ticker = n.tickerText;
return c.getString(R.string.accessibility_desc_notification_icon, appName, ticker);
CharSequence desc = !TextUtils.isEmpty(ticker) ? ticker
: !TextUtils.isEmpty(title) ? title : "";
return c.getString(R.string.accessibility_desc_notification_icon, appName, desc);
}
}