Loading services/core/java/com/android/server/wm/PinnedStackController.java +15 −5 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class PinnedStackController { private final DisplayMetrics mTmpMetrics = new DisplayMetrics(); private final Rect mTmpInsets = new Rect(); private final Rect mTmpRect = new Rect(); private final Point mTmpDisplaySize = new Point(); /** * The callback object passed to listeners for them to notify the controller of state changes. Loading Loading @@ -209,6 +210,9 @@ class PinnedStackController { final int top = (int) (stackBounds.centerY() - height / 2f); stackBounds.set(left, top, left + width, top + height); mSnapAlgorithm.applySnapFraction(stackBounds, getMovementBounds(stackBounds), snapFraction); if (mIsMinimized) { applyMinimizedOffset(stackBounds, getMovementBounds(stackBounds)); } return stackBounds; } Loading Loading @@ -269,11 +273,7 @@ class PinnedStackController { mSnapAlgorithm.applySnapFraction(postChangeStackBounds, postChangeMovementBounds, snapFraction); if (mIsMinimized) { final Point displaySize = new Point(mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); mService.getStableInsetsLocked(displayContent.getDisplayId(), mStableInsets); mSnapAlgorithm.applyMinimizedOffset(postChangeStackBounds, postChangeMovementBounds, displaySize, mStableInsets); applyMinimizedOffset(postChangeStackBounds, postChangeMovementBounds); } notifyMovementBoundsChanged(false /* fromImeAdjustment */); } Loading Loading @@ -386,6 +386,16 @@ class PinnedStackController { mDisplayInfo.logicalHeight - mTmpInsets.bottom - mScreenEdgeInsets.y); } /** * Applies the minimized offsets to the given stack bounds. */ private void applyMinimizedOffset(Rect stackBounds, Rect movementBounds) { mTmpDisplaySize.set(mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); mService.getStableInsetsLocked(mDisplayContent.getDisplayId(), mStableInsets); mSnapAlgorithm.applyMinimizedOffset(stackBounds, movementBounds, mTmpDisplaySize, mStableInsets); } /** * @return the pixels for a given dp value. */ Loading Loading
services/core/java/com/android/server/wm/PinnedStackController.java +15 −5 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class PinnedStackController { private final DisplayMetrics mTmpMetrics = new DisplayMetrics(); private final Rect mTmpInsets = new Rect(); private final Rect mTmpRect = new Rect(); private final Point mTmpDisplaySize = new Point(); /** * The callback object passed to listeners for them to notify the controller of state changes. Loading Loading @@ -209,6 +210,9 @@ class PinnedStackController { final int top = (int) (stackBounds.centerY() - height / 2f); stackBounds.set(left, top, left + width, top + height); mSnapAlgorithm.applySnapFraction(stackBounds, getMovementBounds(stackBounds), snapFraction); if (mIsMinimized) { applyMinimizedOffset(stackBounds, getMovementBounds(stackBounds)); } return stackBounds; } Loading Loading @@ -269,11 +273,7 @@ class PinnedStackController { mSnapAlgorithm.applySnapFraction(postChangeStackBounds, postChangeMovementBounds, snapFraction); if (mIsMinimized) { final Point displaySize = new Point(mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); mService.getStableInsetsLocked(displayContent.getDisplayId(), mStableInsets); mSnapAlgorithm.applyMinimizedOffset(postChangeStackBounds, postChangeMovementBounds, displaySize, mStableInsets); applyMinimizedOffset(postChangeStackBounds, postChangeMovementBounds); } notifyMovementBoundsChanged(false /* fromImeAdjustment */); } Loading Loading @@ -386,6 +386,16 @@ class PinnedStackController { mDisplayInfo.logicalHeight - mTmpInsets.bottom - mScreenEdgeInsets.y); } /** * Applies the minimized offsets to the given stack bounds. */ private void applyMinimizedOffset(Rect stackBounds, Rect movementBounds) { mTmpDisplaySize.set(mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); mService.getStableInsetsLocked(mDisplayContent.getDisplayId(), mStableInsets); mSnapAlgorithm.applyMinimizedOffset(stackBounds, movementBounds, mTmpDisplaySize, mStableInsets); } /** * @return the pixels for a given dp value. */ Loading