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

Commit e53fd052 authored by Mark Renouf's avatar Mark Renouf Committed by Android (Google) Code Review
Browse files

Merge "Clean up ActivityView workaround for release"

parents 4fecb6af 28c250d0
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import android.util.AttributeSet;
import android.util.Log;
import android.util.StatsLog;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsets;
import android.widget.FrameLayout;
import android.widget.ImageButton;
@@ -491,23 +490,14 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    /**
     * Removes and releases an ActivityView if one was previously created for this bubble.
     */
    public void destroyActivityView(ViewGroup tmpParent) {
    public void destroyActivityView() {
        if (mActivityView == null) {
            return;
        }
        if (!mActivityViewReady) {
            // release not needed, never initialized?
            mActivityView = null;
            return;
        }
        // HACK: release() will crash if the view is not attached.
        if (!isAttachedToWindow()) {
            mActivityView.setVisibility(View.GONE);
            tmpParent.addView(this);
        }

        if (mActivityViewReady) {
            mActivityView.release();
        ((ViewGroup) getParent()).removeView(this);
        }
        removeView(mActivityView);
        mActivityView = null;
        mActivityViewReady = false;
    }
+2 −2
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ public class BubbleStackView extends FrameLayout {

        // Remove it from the views
        int removedIndex = mBubbleContainer.indexOfChild(b.iconView);
        b.expandedView.destroyActivityView(this /* tmpParent */);
        b.expandedView.destroyActivityView();
        mBubbleContainer.removeView(b.iconView);

        int bubbleCount = mBubbleContainer.getChildCount();
@@ -377,7 +377,7 @@ public class BubbleStackView extends FrameLayout {
    public void stackDismissed() {
        for (Bubble bubble : mBubbleData.getBubbles()) {
            bubble.entry.setBubbleDismissed(true);
            bubble.expandedView.destroyActivityView(this /* tmpParent */);
            bubble.expandedView.destroyActivityView();
        }
        mBubbleData.clear();
        collapseStack();