From 47e53c9ba516b85a04028bc0f826b27d469d19e8 Mon Sep 17 00:00:00 2001 From: Caitlin Cassidy Date: Tue, 11 May 2021 14:54:59 +0000 Subject: [PATCH] [Ongoing Call Chip] Improve accessibility. Test: atest and manual Bug: 183229367 Change-Id: I043f7259989c5431eeedc84488ae27fb08bc79c4 --- packages/SystemUI/res/layout/ongoing_call_chip.xml | 1 + packages/SystemUI/res/values/strings.xml | 2 ++ .../statusbar/phone/ongoingcall/OngoingCallChronometer.kt | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/packages/SystemUI/res/layout/ongoing_call_chip.xml b/packages/SystemUI/res/layout/ongoing_call_chip.xml index a146547d00839..90214b781ba10 100644 --- a/packages/SystemUI/res/layout/ongoing_call_chip.xml +++ b/packages/SystemUI/res/layout/ongoing_call_chip.xml @@ -23,6 +23,7 @@ android:background="@drawable/ongoing_call_chip_bg" android:paddingStart="@dimen/ongoing_call_chip_side_padding" android:paddingEnd="@dimen/ongoing_call_chip_side_padding" + android:contentDescription="@string/ongoing_phone_call_content_description" > Use fingerprint to open + + Ongoing phone call diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometer.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometer.kt index 1fe77fd441bc0..6e27caec93651 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometer.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometer.kt @@ -56,6 +56,7 @@ class OngoingCallChronometer @JvmOverloads constructor( // call starts. minimumTextWidth = 0 shouldHideText = false + visibility = VISIBLE super.setBase(base) } @@ -76,6 +77,9 @@ class OngoingCallChronometer @JvmOverloads constructor( if (desiredTextWidth > enforcedTextWidth) { shouldHideText = true + // Changing visibility ensures that the content description is not read aloud when the + // time isn't displayed. + visibility = GONE setMeasuredDimension(0, 0) } else { // It's possible that the current text could fit in a smaller width, but we don't want