From 77859d0c89326c4c1748ab716895a7c1d90954c9 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Thu, 15 May 2025 16:37:40 -0700 Subject: [PATCH] Fixed issue with expanded view incorrect position. The expanded view was misplaced due to a race condition. This occurred because the BubbleBarController.onBubbleBarBoundsChanged() method was invoked while LauncherTaskbarUIController.onTaskbarInAppDisplayProgressUpdate() was in progress (e.g. inAppDisplayOverrideProgress value was slightly higher than 0). The latter method is also used to shift the three navigation buttons for IME open/collapse events. This concurrent execution led to an incorrect bubbleBarTranslationY value being used in the BubbleBarView.getTopToScreenBottom() method, ultimately causing the misplacement of the expanded view. Fixes: 416158567 Flag: EXEMPT bugfix Test: Manual. - Long Press Chrome icon select "bubble" adds - Press search bar inside Chrome app bubble to show IME - Hide IME - Press Chrome bubble - Press search bar inside Chrome app bubble to show IME - Hide IME Change-Id: I44431f0eb47c3e9e0bea0274624e5b1db0aa15c9 --- .../taskbar/bubbles/BubbleBarViewController.java | 2 +- .../taskbar/bubbles/stashing/BubbleStashController.kt | 10 ++++++---- .../stashing/PersistentBubbleStashController.kt | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index bf4c605534..e014326b24 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -282,7 +282,7 @@ public class BubbleBarViewController { mBarView.setController(new BubbleBarView.Controller() { @Override public float getBubbleBarTranslationY() { - return mBubbleStashController.getBubbleBarTranslationY(); + return mBubbleStashController.getTargetTranslationYForState(); } @Override diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt index ec272ac873..56622020e8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt @@ -186,12 +186,14 @@ interface BubbleStashController { fun getHandleViewAlpha(): MultiPropertyFactory.MultiProperty? = null /** - * Returns bubble bar Y position according to [isBubblesShowingOnHome] and - * [isBubblesShowingOnOverview] values. Default implementation only analyse - * [isBubblesShowingOnHome] and return translationY to align with the hotseat vertical center. - * For Other cases align bubbles with the taskbar. + * Default implementation only analyse [isBubblesShowingOnHome] and return value is equal to + * [targetTranslationYForState]. */ val bubbleBarTranslationY: Float + get() = targetTranslationYForState + + /** Returns bubble bar Y target position according to [isBubblesShowingOnHome] value. */ + val targetTranslationYForState: Float get() = if (isBubblesShowingOnHome) { bubbleBarTranslationYForHotseat diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt index 319bf1a5d2..0bcc3e6ad2 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt @@ -100,6 +100,10 @@ class PersistentBubbleStashController( return -bubbleBarVerticalCenterForHome + bubbleBarHeight / 2 } + /** + * Returns bubble bar Y target position according to [isBubblesShowingOnHome] value. Value could + * be adjusted to the display override progress. + */ override val bubbleBarTranslationY: Float get() = if (inAppDisplayOverrideProgress > 0f && launcherState == BubbleLauncherState.HOME) { @@ -112,7 +116,7 @@ class PersistentBubbleStashController( Interpolators.LINEAR, ) } else { - super.bubbleBarTranslationY + targetTranslationYForState } override var inAppDisplayOverrideProgress: Float = 0f