diff options
Diffstat (limited to 'core/java/android/app/Notification.java')
| -rw-r--r-- | core/java/android/app/Notification.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f8c9a9ecf4c8..e7058385898b 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -9435,11 +9435,16 @@ public class Notification implements Parcelable } private void bindCallerVerification(RemoteViews contentView, StandardTemplateParams p) { + String iconContentDescription = null; + boolean showDivider = true; if (mVerificationIcon != null) { contentView.setImageViewIcon(R.id.verification_icon, mVerificationIcon); contentView.setDrawableTint(R.id.verification_icon, false /* targetBackground */, mBuilder.getSecondaryTextColor(p), PorterDuff.Mode.SRC_ATOP); contentView.setViewVisibility(R.id.verification_icon, View.VISIBLE); + iconContentDescription = mBuilder.mContext.getString( + R.string.notification_verified_content_description); + showDivider = false; // the icon replaces the divider } else { contentView.setViewVisibility(R.id.verification_icon, View.GONE); } @@ -9447,8 +9452,17 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.verification_text, mVerificationText); mBuilder.setTextViewColorSecondary(contentView, R.id.verification_text, p); contentView.setViewVisibility(R.id.verification_text, View.VISIBLE); + iconContentDescription = null; // let the app's text take precedence } else { contentView.setViewVisibility(R.id.verification_text, View.GONE); + showDivider = false; // no divider if no text + } + contentView.setContentDescription(R.id.verification_icon, iconContentDescription); + if (showDivider) { + contentView.setViewVisibility(R.id.verification_divider, View.VISIBLE); + mBuilder.setTextViewColorSecondary(contentView, R.id.verification_divider, p); + } else { + contentView.setViewVisibility(R.id.verification_divider, View.GONE); } } |
