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

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

Merge "Cleanup task view when bubble is removed" into main

parents 47368cb3 de962eaa
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 {
@@ -1714,8 +1714,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) {
@@ -1069,7 +1069,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