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

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

Merge "Don't remove bubbles after mode switching" into main

parents 51153553 f75bc90c
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -1481,6 +1481,36 @@ public class BubbleController implements ConfigurationChangeListener,
        }
    }

    // TODO(b/316358859): remove this method after task views are shared across modes
    /**
     * Removes the bubble with the given key after task removal, unless the task was removed as
     * a result of mode switching, in which case, the bubble isn't removed because it will be
     * re-inflated for the new mode.
     */
    @MainThread
    public void removeFloatingBubbleAfterTaskRemoval(String key, int reason) {
        // if we're floating remove the bubble. otherwise, we're here because the task was removed
        // after switching modes. See b/316358859
        if (!isShowingAsBubbleBar()) {
            removeBubble(key, reason);
        }
    }

    // TODO(b/316358859): remove this method after task views are shared across modes
    /**
     * Removes the bubble with the given key after task removal, unless the task was removed as
     * a result of mode switching, in which case, the bubble isn't removed because it will be
     * re-inflated for the new mode.
     */
    @MainThread
    public void removeBarBubbleAfterTaskRemoval(String key, int reason) {
        // if we're showing as bubble bar remove the bubble. otherwise, we're here because the task
        // was removed after switching modes. See b/316358859
        if (isShowingAsBubbleBar()) {
            removeBubble(key, reason);
        }
    }

    /**
     * Removes all the bubbles.
     * <p>
+2 −1
Original line number Diff line number Diff line
@@ -313,7 +313,8 @@ public class BubbleExpandedView extends LinearLayout {
                        + " bubble=" + getBubbleKey());
            }
            if (mBubble != null) {
                mController.removeBubble(mBubble.getKey(), Bubbles.DISMISS_TASK_FINISHED);
                mController.removeFloatingBubbleAfterTaskRemoval(
                        mBubble.getKey(), Bubbles.DISMISS_TASK_FINISHED);
            }
            if (mTaskView != null) {
                // Release the surface
+2 −1
Original line number Diff line number Diff line
@@ -188,7 +188,8 @@ public class BubbleTaskViewHelper {
                        + " bubble=" + getBubbleKey());
            }
            if (mBubble != null) {
                mController.removeBubble(mBubble.getKey(), Bubbles.DISMISS_TASK_FINISHED);
                mController.removeBarBubbleAfterTaskRemoval(
                        mBubble.getKey(), Bubbles.DISMISS_TASK_FINISHED);
            }
        }