diff options
| author | 2017-06-06 08:31:17 -0700 | |
|---|---|---|
| committer | 2017-06-06 08:31:17 -0700 | |
| commit | 15ba1515a8df437355e013ee9d4421e5862ced2c (patch) | |
| tree | c5393b1508aa81c842ac44d0013bc231f9142799 | |
| parent | 2f77da6e10d4e5c6fedd16814f98944d82b888c3 (diff) | |
Don't allow removed DividerView to resize stack
If a divider view is removed or in the process of been removed, then it
should no longer have any influence on the size of stacks.
Fixes: 62273599
Test: go/wm-smoke
Test: enter split-screen and make sure recents is visible, lock and
unlock the device and verify things look fine.
Change-Id: I79aca82be8a7013328b78e82f508c4ed9fa48a4a
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java | 3 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java index 0b09accf2db1..3b37437bfca0 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java @@ -91,6 +91,9 @@ public class Divider extends SystemUI { } private void removeDivider() { + if (mView != null) { + mView.onDividerRemoved(); + } mWindowManager.remove(); } diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 9e2ec571faa8..6dc7870770a5 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -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() @@ -917,6 +925,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) { |