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

Commit de962eaa authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Cleanup task view when bubble is removed

When a bubble is dismissed from the bubble bar, remove its corresponding TaskView.

Bug: 283792836
Test: Manual - verified using logs that the task view is removed.
Change-Id: Icd03ddc53526d2ef1ff71d6d388bbf8d37fae081
parent a2d78978
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -465,7 +465,7 @@ public class Bubble implements BubbleViewProvider {
    /**
     * Call when all the views should be removed/cleaned up.
     */
    void cleanupViews() {
    public void cleanupViews() {
        cleanupViews(true);
    }

+2 −3
Original line number Diff line number Diff line
@@ -730,7 +730,7 @@ public class BubbleController implements ConfigurationChangeListener,
            // window to show this in, but we use a separate code path.
            // TODO(b/273312602): consider foldables where we do need a stack view when folded
            if (mLayerView == null) {
                mLayerView = new BubbleBarLayerView(mContext, this);
                mLayerView = new BubbleBarLayerView(mContext, this, mBubbleData);
                mLayerView.setUnBubbleConversationCallback(mSysuiProxy::onUnbubbleConversation);
            }
        } else {
@@ -1706,8 +1706,7 @@ public class BubbleController implements ConfigurationChangeListener,
        @Override
        public void removeBubble(Bubble removedBubble) {
            if (mLayerView != null) {
                // TODO: need to check if there's something that needs to happen here, e.g. if
                //  the currently selected & expanded bubble is removed?
                mLayerView.removeBubble(removedBubble);
            }
        }

+2 −3
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */
package com.android.wm.shell.bubbles;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
import static com.android.wm.shell.bubbles.Bubble.KEY_APP_BUBBLE;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_DATA;
@@ -41,6 +40,7 @@ import com.android.internal.util.FrameworkStatsLog;
import com.android.launcher3.icons.BubbleIconFactory;
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.Bubbles.DismissReason;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
import com.android.wm.shell.common.bubbles.BubbleBarUpdate;
import com.android.wm.shell.common.bubbles.RemovedBubble;

@@ -427,7 +427,7 @@ public class BubbleData {
    /**
     * When this method is called it is expected that all info in the bubble has completed loading.
     * @see Bubble#inflate(BubbleViewInfoTask.Callback, Context, BubbleController, BubbleStackView,
     * BubbleIconFactory, boolean)
     * BubbleBarLayerView, BubbleIconFactory, boolean)
     */
    void notificationEntryUpdated(Bubble bubble, boolean suppressFlyout, boolean showInShade) {
        if (DEBUG_BUBBLE_DATA) {
@@ -1056,7 +1056,6 @@ public class BubbleData {
    /**
     * The set of bubbles in row.
     */
    @VisibleForTesting(visibility = PACKAGE)
    public List<Bubble> getBubbles() {
        return Collections.unmodifiableList(mBubbles);
    }
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.content.Intent;
import android.graphics.Rect;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

@@ -186,6 +187,7 @@ public class BubbleTaskViewHelper {
            }
            if (mTaskView != null) {
                mTaskView.release();
                ((ViewGroup) mParentView).removeView(mTaskView);
                mTaskView = null;
            }
        }
+1 −6
Original line number Diff line number Diff line
@@ -266,13 +266,8 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView
        mListener.onBackPressed();
    }

    /** Cleans up task view, should be called when the bubble is no longer active. */
    /** Cleans up the expanded view, should be called when the bubble is no longer active. */
    public void cleanUpExpandedState() {
        if (mBubbleTaskViewHelper != null) {
            if (mTaskView != null) {
                removeView(mTaskView);
            }
        }
        mMenuViewController.hideMenu(false /* animated */);
    }

Loading