Loading services/core/java/com/android/server/wm/DockedStackDividerController.java +39 −11 Original line number Diff line number Diff line Loading @@ -606,12 +606,7 @@ public class DockedStackDividerController implements DimLayerUser { private void setMinimizedDockedStack(boolean minimized) { final TaskStack stack = mDisplayContent.getDockedStackVisibleForUserLocked(); notifyDockedStackMinimizedChanged(minimized, 0); if (stack == null) { return; } if (stack.setAdjustedForMinimizedDock(minimized ? 1f : 0f)) { mService.mWindowPlacerLocked.performSurfacePlacement(); } setMinimizeAmount(stack, minimized ? 1f : 0f); } private boolean isAnimationMaximizing() { Loading Loading @@ -695,11 +690,8 @@ public class DockedStackDividerController implements DimLayerUser { float t = Math.min(1f, (float) (now - mAnimationStartTime) / mAnimationDuration); t = (isAnimationMaximizing() ? TOUCH_RESPONSE_INTERPOLATOR : mMinimizedDockInterpolator) .getInterpolation(t); if (stack != null) { if (stack.setAdjustedForMinimizedDock(getMinimizeAmount(stack, t))) { mService.mWindowPlacerLocked.performSurfacePlacement(); } } setMinimizeAmount(stack, getMinimizeAmount(stack, t)); if (t >= 1.0f) { mAnimatingForMinimizedDockedStack = false; return false; Loading @@ -708,6 +700,42 @@ public class DockedStackDividerController implements DimLayerUser { } } void setMinimizeAmount(TaskStack dockedStack, float minimizeAmount) { final ArrayList<TaskStack> stacks = mDisplayContent.getStacks(); // If the docked stack is not visible, clear the complementary stack on all stacks. if (dockedStack == null) { for (int i = stacks.size() - 1; i >= 0; --i) { final TaskStack stack = stacks.get(i); stack.resetAdjustedForComplementDock(); } return; } // Otherwise if the docked stack minimize amount has changed, update the adjusted bounds // on the other stack that's currently visible, so that the stack's getDimBounds() // occupies what's left by the docked stack. This is needed so that stuff like wallpaper // gets cropped properly to the area left by the dock. if (dockedStack.setAdjustedForMinimizedDock(minimizeAmount)) { final boolean adjusted = dockedStack.isVisibleForUserLocked() && minimizeAmount != 0.0f; dockedStack.getDimBounds(mTmpRect2); int dockSide = dockedStack.getDockSide(); for (int i = stacks.size() - 1; i >= 0; --i) { final TaskStack stack = stacks.get(i); if (stack == dockedStack) { continue; } if (stack.isVisibleLocked() && adjusted) { stack.setAdjustedForComplementDock(mTmpRect2, dockSide); } else { stack.resetAdjustedForComplementDock(); } } mService.mWindowPlacerLocked.performSurfacePlacement(); } } private float getInterpolatedAnimationValue(float t) { return t * mAnimationTarget + (1 - t) * mAnimationStart; } Loading services/core/java/com/android/server/wm/TaskStack.java +35 −2 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ public class TaskStack implements DimLayer.DimLayerUser, private float mAdjustImeAmount; private float mAdjustDividerAmount; private final int mDockedStackMinimizeThickness; private boolean mAdjustedForForComplementDock; // If this is true, we are in the bounds animating mode. // The task will be down or upscaled to perfectly fit the Loading Loading @@ -247,7 +248,9 @@ public class TaskStack implements DimLayer.DimLayerUser, insetBounds = mFullyAdjustedImeBounds; } } if (!mAdjustedForForComplementDock) { alignTasksToAdjustedBounds(adjusted ? mAdjustedBounds : mBounds, insetBounds); } mDisplayContent.layoutNeeded = true; } Loading Loading @@ -854,6 +857,7 @@ public class TaskStack implements DimLayer.DimLayerUser, mImeWin = imeWin; mImeGoingAway = false; if (!mAdjustedForIme || forceUpdate) { mAdjustedForForComplementDock = false; mAdjustedForIme = true; mAdjustImeAmount = 0f; mAdjustDividerAmount = 0f; Loading Loading @@ -916,10 +920,12 @@ public class TaskStack implements DimLayer.DimLayerUser, * @return Whether the amount has changed and a layout is needed. */ boolean setAdjustedForMinimizedDock(float minimizeAmount) { mAdjustedForForComplementDock = false; if (minimizeAmount != mMinimizeAmount) { mMinimizeAmount = minimizeAmount; updateAdjustedBounds(); return isVisibleForUserLocked(); return true; } else { return false; } Loading @@ -929,6 +935,33 @@ public class TaskStack implements DimLayer.DimLayerUser, return mMinimizeAmount != 0f; } void setAdjustedForComplementDock(Rect dockBounds, int dockSide) { if (mMinimizeAmount != 0f || mAdjustedForIme) { return; } mTmpAdjustedBounds.set(mBounds); if (dockSide == DOCKED_TOP) { mTmpAdjustedBounds.top = dockBounds.bottom; } else if (dockSide == DOCKED_LEFT) { mTmpAdjustedBounds.left = dockBounds.right; } else if (dockSide == DOCKED_RIGHT) { mTmpAdjustedBounds.right = dockBounds.left; } else { Slog.w(TAG_WM, "setAdjustedForComplementDock: invalid dock side " + dockSide); return; } mAdjustedForForComplementDock = true; setAdjustedBounds(mTmpAdjustedBounds); } void resetAdjustedForComplementDock() { if (mAdjustedForForComplementDock) { mAdjustedForForComplementDock = false; mTmpAdjustedBounds.setEmpty(); setAdjustedBounds(mTmpAdjustedBounds); } } /** * Puts all visible tasks that are adjusted for IME into resizing mode and adds the windows * to the list of to be drawn windows the service is waiting for. Loading Loading
services/core/java/com/android/server/wm/DockedStackDividerController.java +39 −11 Original line number Diff line number Diff line Loading @@ -606,12 +606,7 @@ public class DockedStackDividerController implements DimLayerUser { private void setMinimizedDockedStack(boolean minimized) { final TaskStack stack = mDisplayContent.getDockedStackVisibleForUserLocked(); notifyDockedStackMinimizedChanged(minimized, 0); if (stack == null) { return; } if (stack.setAdjustedForMinimizedDock(minimized ? 1f : 0f)) { mService.mWindowPlacerLocked.performSurfacePlacement(); } setMinimizeAmount(stack, minimized ? 1f : 0f); } private boolean isAnimationMaximizing() { Loading Loading @@ -695,11 +690,8 @@ public class DockedStackDividerController implements DimLayerUser { float t = Math.min(1f, (float) (now - mAnimationStartTime) / mAnimationDuration); t = (isAnimationMaximizing() ? TOUCH_RESPONSE_INTERPOLATOR : mMinimizedDockInterpolator) .getInterpolation(t); if (stack != null) { if (stack.setAdjustedForMinimizedDock(getMinimizeAmount(stack, t))) { mService.mWindowPlacerLocked.performSurfacePlacement(); } } setMinimizeAmount(stack, getMinimizeAmount(stack, t)); if (t >= 1.0f) { mAnimatingForMinimizedDockedStack = false; return false; Loading @@ -708,6 +700,42 @@ public class DockedStackDividerController implements DimLayerUser { } } void setMinimizeAmount(TaskStack dockedStack, float minimizeAmount) { final ArrayList<TaskStack> stacks = mDisplayContent.getStacks(); // If the docked stack is not visible, clear the complementary stack on all stacks. if (dockedStack == null) { for (int i = stacks.size() - 1; i >= 0; --i) { final TaskStack stack = stacks.get(i); stack.resetAdjustedForComplementDock(); } return; } // Otherwise if the docked stack minimize amount has changed, update the adjusted bounds // on the other stack that's currently visible, so that the stack's getDimBounds() // occupies what's left by the docked stack. This is needed so that stuff like wallpaper // gets cropped properly to the area left by the dock. if (dockedStack.setAdjustedForMinimizedDock(minimizeAmount)) { final boolean adjusted = dockedStack.isVisibleForUserLocked() && minimizeAmount != 0.0f; dockedStack.getDimBounds(mTmpRect2); int dockSide = dockedStack.getDockSide(); for (int i = stacks.size() - 1; i >= 0; --i) { final TaskStack stack = stacks.get(i); if (stack == dockedStack) { continue; } if (stack.isVisibleLocked() && adjusted) { stack.setAdjustedForComplementDock(mTmpRect2, dockSide); } else { stack.resetAdjustedForComplementDock(); } } mService.mWindowPlacerLocked.performSurfacePlacement(); } } private float getInterpolatedAnimationValue(float t) { return t * mAnimationTarget + (1 - t) * mAnimationStart; } Loading
services/core/java/com/android/server/wm/TaskStack.java +35 −2 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ public class TaskStack implements DimLayer.DimLayerUser, private float mAdjustImeAmount; private float mAdjustDividerAmount; private final int mDockedStackMinimizeThickness; private boolean mAdjustedForForComplementDock; // If this is true, we are in the bounds animating mode. // The task will be down or upscaled to perfectly fit the Loading Loading @@ -247,7 +248,9 @@ public class TaskStack implements DimLayer.DimLayerUser, insetBounds = mFullyAdjustedImeBounds; } } if (!mAdjustedForForComplementDock) { alignTasksToAdjustedBounds(adjusted ? mAdjustedBounds : mBounds, insetBounds); } mDisplayContent.layoutNeeded = true; } Loading Loading @@ -854,6 +857,7 @@ public class TaskStack implements DimLayer.DimLayerUser, mImeWin = imeWin; mImeGoingAway = false; if (!mAdjustedForIme || forceUpdate) { mAdjustedForForComplementDock = false; mAdjustedForIme = true; mAdjustImeAmount = 0f; mAdjustDividerAmount = 0f; Loading Loading @@ -916,10 +920,12 @@ public class TaskStack implements DimLayer.DimLayerUser, * @return Whether the amount has changed and a layout is needed. */ boolean setAdjustedForMinimizedDock(float minimizeAmount) { mAdjustedForForComplementDock = false; if (minimizeAmount != mMinimizeAmount) { mMinimizeAmount = minimizeAmount; updateAdjustedBounds(); return isVisibleForUserLocked(); return true; } else { return false; } Loading @@ -929,6 +935,33 @@ public class TaskStack implements DimLayer.DimLayerUser, return mMinimizeAmount != 0f; } void setAdjustedForComplementDock(Rect dockBounds, int dockSide) { if (mMinimizeAmount != 0f || mAdjustedForIme) { return; } mTmpAdjustedBounds.set(mBounds); if (dockSide == DOCKED_TOP) { mTmpAdjustedBounds.top = dockBounds.bottom; } else if (dockSide == DOCKED_LEFT) { mTmpAdjustedBounds.left = dockBounds.right; } else if (dockSide == DOCKED_RIGHT) { mTmpAdjustedBounds.right = dockBounds.left; } else { Slog.w(TAG_WM, "setAdjustedForComplementDock: invalid dock side " + dockSide); return; } mAdjustedForForComplementDock = true; setAdjustedBounds(mTmpAdjustedBounds); } void resetAdjustedForComplementDock() { if (mAdjustedForForComplementDock) { mAdjustedForForComplementDock = false; mTmpAdjustedBounds.setEmpty(); setAdjustedBounds(mTmpAdjustedBounds); } } /** * Puts all visible tasks that are adjusted for IME into resizing mode and adds the windows * to the list of to be drawn windows the service is waiting for. Loading