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

Commit d034fec9 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by android-build-merger
Browse files

Merge "Don't allow removed DividerView to resize stack" into oc-dev am: d7427d5d

am: b4f383c2

Change-Id: Ibded63bebba40bc29978dee2717dd61a36d609a9
parents cd8c82a1 b4f383c2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,9 @@ public class Divider extends SystemUI {
    }

    private void removeDivider() {
        if (mView != null) {
            mView.onDividerRemoved();
        }
        mWindowManager.remove();
    }

+12 −0
Original line number Diff line number Diff line
@@ -162,6 +162,9 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    private DividerState mState;
    private final SurfaceFlingerVsyncChoreographer mSfChoreographer;

    // The view is removed or in the process of been removed from the system.
    private boolean mRemoved;

    private final Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
@@ -323,6 +326,11 @@ public class DividerView extends FrameLayout implements OnTouchListener,
        EventBus.getDefault().unregister(this);
    }

    void onDividerRemoved() {
        mRemoved = true;
        mHandler.removeMessages(MSG_RESIZE_STACK);
    }

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        if (mStableInsets.left != insets.getStableInsetLeft()
@@ -927,6 +935,10 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    }

    public void resizeStack(int position, int taskPosition, SnapTarget taskSnapTarget) {
        if (mRemoved) {
            // This divider view has been removed so shouldn't have any additional influence.
            return;
        }
        calculateBoundsForPosition(position, mDockSide, mDockedRect);

        if (mDockedRect.equals(mLastResizeRect) && !mEntranceAnimationRunning) {