From 47d3f66a04eef5234f6bbcfc8459583a9d88f969 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 18 Nov 2020 14:20:56 -0800 Subject: [PATCH] Improve some issues around position and window order - which ever window was last created is on top, so if taskbar was just created, re-add bubbles window so its on top - only set pinned location when the bar is visible Test: manual Bug: 173386799 Change-Id: I691f856947a094ba5a7afee611a95219fcca4830 --- .../com/android/wm/shell/bubbles/BubbleController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 beac59b699fa8..aa7355b61eda5 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 @@ -89,6 +89,7 @@ public class BubbleController implements Bubbles { // TODO(b/173386799) keep in sync with Launcher3 and also don't do a broadcast public static final String TASKBAR_CHANGED_BROADCAST = "taskbarChanged"; + public static final String EXTRA_TASKBAR_CREATED = "taskbarCreated"; public static final String EXTRA_BUBBLE_OVERFLOW_OPENED = "bubbleOverflowOpened"; public static final String EXTRA_TASKBAR_VISIBLE = "taskbarVisible"; public static final String EXTRA_TASKBAR_POSITION = "taskbarPosition"; @@ -350,12 +351,15 @@ public class BubbleController implements Bubbles { + " itemPosition: " + itemPosition[0] + "," + itemPosition[1] + " iconSize: " + iconSize); PointF point = new PointF(itemPosition[0], itemPosition[1]); - mBubblePositioner.setPinnedLocation(point); + mBubblePositioner.setPinnedLocation(isVisible ? point : null); mBubblePositioner.updateForTaskbar(iconSize, taskbarPosition, isVisible, taskbarSize); if (mStackView != null) { - if (isVisible) { - mStackView.updateStackPosition(); + if (isVisible && b.getBoolean(EXTRA_TASKBAR_CREATED, false /* default */)) { + // If taskbar was created, add and remove the window so that bubbles display on top + removeFromWindowManagerMaybe(); + addToWindowManagerMaybe(); } + mStackView.updateStackPosition(); mBubbleIconFactory = new BubbleIconFactory(mContext); mStackView.onDisplaySizeChanged(); }