From 726294ff05e11c4a2302edf1a04adab9b2469f8e Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Thu, 25 Feb 2021 16:53:52 -0500 Subject: [PATCH] Fixes Copyright date & incorrect a11y announcement Fixes: 180118819 Test: Manual Change-Id: I8a89ece2db075ceb33861109d1634442a670233e --- core/java/android/app/Notification.java | 14 ++++++++++++++ .../notification_template_conversation_header.xml | 15 ++++++++++++++- core/res/res/values/strings.xml | 3 +++ core/res/res/values/symbols.xml | 2 ++ .../policy/InflatedSmartReplyViewHolder.kt | 2 +- 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f8c9a9ecf4c83..e7058385898be 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); } } diff --git a/core/res/res/layout/notification_template_conversation_header.xml b/core/res/res/layout/notification_template_conversation_header.xml index 302a388cf1b21..e01d8035fe350 100644 --- a/core/res/res/layout/notification_template_conversation_header.xml +++ b/core/res/res/layout/notification_template_conversation_header.xml @@ -99,13 +99,26 @@ android:visibility="gone" /> + + Alerted + + Verified + Expand diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7ad05de1bdd0a..d49e627c38000 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3112,8 +3112,10 @@ + + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/InflatedSmartReplyViewHolder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/InflatedSmartReplyViewHolder.kt index 4f69cd6a13676..4e5c461b9643c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/InflatedSmartReplyViewHolder.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/InflatedSmartReplyViewHolder.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.