From 97a656a2aba9ca0711f8efa9354935cea7e251e2 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 6 Jun 2022 23:16:33 +0000 Subject: [PATCH] Fix lock screen overlap test. This change fixes the rectangle reported for accessibility of the shelf when on the lockscreen, which ensures that overlap tests operate correctly. Fixes: 235118701 Test: atest LockscreenNotificationsOverlapWithLockIcon Test: manual testing with talkback on using ltr and rtl Change-Id: I71eb7f54244a620f0431ae519ae1c7405d8d412d --- .../android/systemui/statusbar/NotificationShelf.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 0d604014e8f1e..a1463401460fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -229,6 +229,17 @@ public class NotificationShelf extends ActivatableNotificationView implements mActualWidth = actualWidth; } + @Override + public void getBoundsOnScreen(Rect outRect, boolean clipToParent) { + super.getBoundsOnScreen(outRect, clipToParent); + final int actualWidth = getActualWidth(); + if (isLayoutRtl()) { + outRect.left = outRect.right - actualWidth; + } else { + outRect.right = outRect.left + actualWidth; + } + } + /** * @return Actual width of shelf, accounting for possible ongoing width animation */