From 45b2235bd666b64d4171cc33524e54b1dc611785 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 2 Sep 2021 14:46:02 -0700 Subject: [PATCH] Fix an issue with bubbles overlapping the taskbar Test: manual - have bubbles opened, rotate device => observe that bubbles don't overlap Bug: 196857292 Change-Id: Ic108852e516e18441c265e8a03b0524c4b589b4f --- .../src/com/android/wm/shell/bubbles/BubbleController.java | 7 +++++-- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 95b80df7fcbd2..9dafefebf62b0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -628,8 +628,11 @@ public class BubbleController { mAddedToWindowManager = true; mBubbleData.getOverflow().initialize(this); mWindowManager.addView(mStackView, mWmLayoutParams); - // Position info is dependent on us being attached to a window - mBubblePositioner.update(); + mStackView.setOnApplyWindowInsetsListener((view, windowInsets) -> { + mBubblePositioner.update(); + mStackView.onDisplaySizeChanged(); + return windowInsets; + }); } catch (IllegalStateException e) { // This means the stack has already been added. This shouldn't happen... e.printStackTrace(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 5a51eed04e1a1..5bc6128d6c9ec 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -1315,6 +1315,7 @@ public class BubbleStackView extends FrameLayout @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); + mPositioner.update(); getViewTreeObserver().addOnComputeInternalInsetsListener(this); getViewTreeObserver().addOnDrawListener(mSystemGestureExcludeUpdater); }