From 2593ac5b1739721b1d73480caf15c876c8eab302 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 8 Jun 2023 10:57:47 -0700 Subject: [PATCH] Remove a11y noise for bouncer unlock When the bouncer unlocks, the keyguard message are and the lock icon view announce for accessibility but are not visible. By ensuring the view is visible in order to announce for accessibility, when we unlock the pin screen with talkback, we just get "Device unlocked" Fixes: 284902478 Test: unlock pin screen with talkback. Change-Id: I10c7e48e821e7eed1d85815cfb1b920b197f7350 --- .../src/com/android/keyguard/KeyguardMessageAreaController.java | 2 +- .../src/com/android/keyguard/LockIconViewController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java index 0332c9f571360..363dd014beb67 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java @@ -208,7 +208,7 @@ public class KeyguardMessageAreaController @Override public void run() { final View host = mHost.get(); - if (host != null) { + if (host != null && host.isVisibleToUser()) { host.announceForAccessibility(mTextToAnnounce); } } diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 7cedecc33a022..239a0cc01c457 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -326,7 +326,7 @@ public class LockIconViewController extends ViewController impleme } if (!Objects.equals(prevContentDescription, mView.getContentDescription()) - && mView.getContentDescription() != null) { + && mView.getContentDescription() != null && mView.isVisibleToUser()) { mView.announceForAccessibility(mView.getContentDescription()); } }