From a9e51b3e2b89603289c0a1d109e1386ec7ce114b Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Tue, 29 Jun 2021 17:01:30 +0200 Subject: [PATCH] Announce inattentive sleep warning for accessibility The inattentive sleep warning currently isn't being read out by TalkBack. This change explicitly asks TalkBack to announce the warning text when the warning is shown. Bug: 192336859 Test: Enable TalkBack & set low attentive timeout: adb shell settings put secure attentive_timeout 40000 Verify that when the warning is shown, TalkBack announces it Change-Id: Ia40fc94b618afb39f88f9aac8e8f10399456463b --- .../com/android/systemui/power/InattentiveSleepWarningView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java b/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java index 1ed98c0a8f90c..03d1f15bf379b 100644 --- a/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java +++ b/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java @@ -93,6 +93,8 @@ public class InattentiveSleepWarningView extends FrameLayout { setAlpha(1f); setVisibility(View.VISIBLE); mWindowManager.addView(this, getLayoutParams(mWindowToken)); + announceForAccessibility( + getContext().getString(R.string.inattentive_sleep_warning_message)); } /**