From 983cc2ecc82687bc9e17663d7efd7610cec441ee Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 3 May 2023 16:28:43 -0700 Subject: [PATCH] Calculate the launch bounds after layout This fixes the issue where the surface is cropped incorrectly after launching a bubble from the overflow (after changing rotation). Bug: 278653202 Test: manual - have some bubbles in the overflow - expand a bubble, navigate to overflow, add a bubble => observe that the surface isn't cropped incorrectly Change-Id: Id54ed0ccf724ec05aef8cb3a9bbbb5ef5ed28d28 --- .../com/android/wm/shell/bubbles/BubbleExpandedView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index 6c482c831152d..240c15c93bbe9 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -214,9 +214,6 @@ public class BubbleExpandedView extends LinearLayout { ActivityOptions options = ActivityOptions.makeCustomAnimation(getContext(), 0 /* enterResId */, 0 /* exitResId */); - Rect launchBounds = new Rect(); - mTaskView.getBoundsOnScreen(launchBounds); - // TODO: I notice inconsistencies in lifecycle // Post to keep the lifecycle normal post(() -> { @@ -225,6 +222,9 @@ public class BubbleExpandedView extends LinearLayout { + getBubbleKey()); } try { + Rect launchBounds = new Rect(); + mTaskView.getBoundsOnScreen(launchBounds); + options.setTaskAlwaysOnTop(true); options.setLaunchedFromBubble(true); options.setPendingIntentBackgroundActivityStartMode(