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

am: bc243b5f49

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

Change-Id: I9fc34e61c83c89c65dd8f401904a46f383a7bdb4
This commit is contained in:
Adrian Roos
2016-04-29 16:07:10 +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);
}
}