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

Commit a099a95c authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "Fix blank Bubbles related to unfold transition" into main

parents 400a110a 307a7974
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -708,7 +708,6 @@ public class Bubble implements BubbleViewProvider {
    /**
     * Sets the current bubble-transition that is coordinating a change in this bubble.
     */
    @VisibleForTesting
    public void setPreparingTransition(BubbleTransitions.BubbleTransition transit) {
        ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "setPreparingTransition: transit=%s", transit);
        mPreparingTransition = transit;
+3 −1
Original line number Diff line number Diff line
@@ -213,7 +213,8 @@ public class BubbleTransitions {
        // we only do this when switching from floating bubbles to bar bubbles so guard this with
        // the bubble bar flag, but once these are combined we should be able to remove this.
        if (com.android.wm.shell.Flags.enableBubbleBar()
                && mBubbleData.getSelectedBubble() instanceof Bubble) {
                && mBubbleData.getSelectedBubble() instanceof Bubble
                && mBubbleData.isExpanded()) {
            ProtoLog.d(
                    WM_SHELL_BUBBLES, "notifyUnfoldTransitionStarting transition=%s", transition);
            Bubble bubble = (Bubble) mBubbleData.getSelectedBubble();
@@ -1703,6 +1704,7 @@ public class BubbleTransitions {
        public void onTransitionConsumed(@NonNull IBinder transition, boolean aborted,
                @Nullable SurfaceControl.Transaction finishTransaction) {
            if (!aborted) return;
            mBubble.setPreparingTransition(null);
            mTransition = null;
            mTaskViewTransitions.onExternalDone(transition);
        }
+1 −0
Original line number Diff line number Diff line
@@ -627,6 +627,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition {
                mLeftoversHandler.onTransitionConsumed(transition, aborted, finishT);
                break;
            case TYPE_UNFOLD:
                mBubbleTransitions.notifyUnfoldTransitionFinished(transition);
                mUnfoldHandler.onTransitionConsumed(transition, aborted, finishT);
                break;
            case TYPE_OPEN_IN_DESKTOP:
+14 −0
Original line number Diff line number Diff line
@@ -662,6 +662,7 @@ public class BubbleTransitionsTest extends ShellTestCase {
        setupBubble();
        final IBinder unfoldTransition = mock(IBinder.class);
        when(mBubbleData.getSelectedBubble()).thenReturn(mBubble);
        when(mBubbleData.isExpanded()).thenReturn(true);
        mBubbleTransitions.notifyUnfoldTransitionStarting(unfoldTransition);

        assertThat(mTaskViewTransitions.hasPending()).isTrue();
@@ -677,6 +678,18 @@ public class BubbleTransitionsTest extends ShellTestCase {
        assertThat(mTaskViewTransitions.hasPending()).isFalse();
    }

    @Test
    @EnableFlags(FLAG_ENABLE_BUBBLE_BAR)
    public void notifyUnfoldTransitionStarting_bubblesCollapsed_doesNotEnqueueExternal() {
        setupBubble();
        final IBinder unfoldTransition = mock(IBinder.class);
        when(mBubbleData.getSelectedBubble()).thenReturn(mBubble);
        when(mBubbleData.isExpanded()).thenReturn(false);
        mBubbleTransitions.notifyUnfoldTransitionStarting(unfoldTransition);

        assertThat(mTaskViewTransitions.hasPending()).isFalse();
    }

    @Test
    @DisableFlags(FLAG_ENABLE_BUBBLE_BAR)
    public void notifyUnfoldTransitionStarting_bubbleBarDisabled() {
@@ -694,6 +707,7 @@ public class BubbleTransitionsTest extends ShellTestCase {
        setupBubble();
        final IBinder unfoldTransition = mock(IBinder.class);
        when(mBubbleData.getSelectedBubble()).thenReturn(mBubble);
        when(mBubbleData.isExpanded()).thenReturn(true);
        mBubbleTransitions.notifyUnfoldTransitionStarting(unfoldTransition);

        assertThat(mTaskViewTransitions.hasPending()).isTrue();