Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1df5158 authored by mpodolian's avatar mpodolian
Browse files

Added bubble bar location to the update

Added update of bubble bar location after task bar icon drop to the
bubble  bar drop zone opposite to the current bubble bar location.

Fixes: 409417227
Test: Manual
Flag: EXEMPT bugfix
Change-Id: Ie0771fe81a85d3f738964f345260ce13f0b0e955
parent 62041833
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1596,9 +1596,11 @@ public class BubbleController implements ConfigurationChangeListener,
        if (!BubbleAnythingFlagHelper.enableCreateAnyBubble()) return;
        BubbleBarLocation updateLocation = isShowingAsBubbleBar() ? bubbleBarLocation : null;
        if (updateLocation != null) {
            // does not update the bubble bar location of the bubble bar, just expanded view
            updateExpandedViewForBubbleBarLocation(updateLocation, source);
        }
        if (b.isInflated()) {
            // mBubbleData should be updated with the new location to update the bubble bar location
            mBubbleData.setSelectedBubbleAndExpandStack(b, updateLocation);
        } else {
            b.enable(Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE);
@@ -1607,7 +1609,7 @@ public class BubbleController implements ConfigurationChangeListener,
                ensureBubbleViewsAndWindowCreated();
                mBubbleTransitions.startLaunchIntoOrConvertToBubble(b, mExpandedViewManager,
                        mBubbleTaskViewFactory, mBubblePositioner, mStackView, mLayerView,
                        mBubbleIconFactory, mInflateSynchronously);
                        mBubbleIconFactory, mInflateSynchronously, bubbleBarLocation);
            } else {
                inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false,
                        updateLocation);
+8 −4
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.bubbles.bar.BubbleBarExpandedView;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
import com.android.wm.shell.common.HomeIntentProvider;
import com.android.wm.shell.shared.bubbles.BubbleBarLocation;
import com.android.wm.shell.taskview.TaskView;
import com.android.wm.shell.taskview.TaskViewRepository;
import com.android.wm.shell.taskview.TaskViewTaskController;
@@ -183,9 +184,9 @@ public class BubbleTransitions {
            BubbleExpandedViewManager expandedViewManager, BubbleTaskViewFactory factory,
            BubblePositioner positioner, BubbleStackView stackView,
            BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
            boolean inflateSync) {
            boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) {
        new LaunchOrConvertToBubble(bubble, mContext, expandedViewManager, factory, positioner,
                stackView, layerView, iconFactory, inflateSync);
                stackView, layerView, iconFactory, inflateSync, bubbleBarLocation);
    }

    /**
@@ -665,17 +666,20 @@ public class BubbleTransitions {

        private SurfaceControl.Transaction mFinishT;
        private SurfaceControl mTaskLeash;
        @Nullable
        private BubbleBarLocation mBubbleBarLocation;

        LaunchOrConvertToBubble(Bubble bubble, Context context,
                BubbleExpandedViewManager expandedViewManager, BubbleTaskViewFactory factory,
                BubblePositioner positioner, BubbleStackView stackView,
                BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
                boolean inflateSync) {
                boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) {
            mBubble = bubble;
            mTransitionProgress = new TransitionProgress(bubble);
            mLayerView = layerView;
            mBubble.setInflateSynchronously(inflateSync);
            mBubble.setPreparingTransition(this);
            mBubbleBarLocation = bubbleBarLocation;
            mBubble.inflate(
                    this::onInflated,
                    context,
@@ -838,7 +842,7 @@ public class BubbleTransitions {

            // Now update state (and talk to launcher) in parallel with snapshot stuff
            mBubbleData.notificationEntryUpdated(mBubble, /* suppressFlyout= */ true,
                    /* showInShade= */ false);
                    /* showInShade= */ false, mBubbleBarLocation);

            if (mPlayConvertTaskAnimation) {
                final int left = mStartBounds.left - info.getRoot(0).getOffset().x;