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

am: 764adf0369

* commit '764adf0369965aeec8c25b6ea78ff9c91edd60bf':
  A11y: Show title if ticker is not available

Change-Id: I825c85ba5c552814047bdd26a9dfde5c659a0f67
This commit is contained in:
Adrian Roos
2016-04-29 16:12:06 +00:00
committed by android-build-merger

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);
}
}