From 116aa758dabe7fb1f99633afb9f41ff7b8c05d3d Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Mon, 7 Aug 2023 11:48:06 -0700 Subject: [PATCH] Set top and bottom of lock icon to be global rect. We no longer set the center when we migrate the lock icon. We can achieve the same thing by getting the top and bottom of the global rect. Test: Show ambient indication with flag on and off. Test: Add a ton of notifications. Fixes: 294871771 Change-Id: I113f5a3b14b2c48a1b415a03efac47a789a43a79 --- .../src/com/android/keyguard/LockIconView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java index 1a0c7f97e146e..8611dbbbcb701 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java @@ -22,6 +22,7 @@ import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.Point; +import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; @@ -154,11 +155,16 @@ public class LockIconView extends FrameLayout implements Dumpable { } float getLocationTop() { - return mLockIconCenter.y - mRadius; + Rect r = new Rect(); + mLockIcon.getGlobalVisibleRect(r); + return r.top; } float getLocationBottom() { - return mLockIconCenter.y + mRadius; + Rect r = new Rect(); + mLockIcon.getGlobalVisibleRect(r); + return r.bottom; + } /**