Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +8 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,14 @@ public class PipBoundsState { mExpandedMovementBounds.set(bounds); } /** Updates the min and max sizes based on the size spec and aspect ratio. */ public void updateMinMaxSize(float aspectRatio) { final Size minSize = mSizeSpecSource.getMinSize(aspectRatio); mMinSize.set(minSize.getWidth(), minSize.getHeight()); final Size maxSize = mSizeSpecSource.getMaxSize(aspectRatio); mMaxSize.set(maxSize.getWidth(), maxSize.getHeight()); } /** Sets the max possible size for resize. */ public void setMaxSize(int width, int height) { mMaxSize.set(width, height); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +1 −0 Original line number Diff line number Diff line Loading @@ -1037,6 +1037,7 @@ public class PipTransition extends PipTransitionController { private void computeEnterPipRotatedBounds(int rotationDelta, int startRotation, int endRotation, TaskInfo taskInfo, Rect outDestinationBounds, @Nullable Rect outSourceHintRect) { mPipDisplayLayoutState.rotateTo(endRotation); mPipBoundsState.updateMinMaxSize(mPipBoundsState.getAspectRatio()); final Rect displayBounds = mPipDisplayLayoutState.getDisplayBounds(); outDestinationBounds.set(mPipBoundsAlgorithm.getEntryDestinationBounds()); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +8 −0 Original line number Diff line number Diff line Loading @@ -976,8 +976,16 @@ public class PipController implements PipTransitionController.PipTransitionCallb mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG, hotseatKeepClearArea); onDisplayRotationChangedNotInPip(mContext, launcherRotation); // cache current min/max size Point minSize = mPipBoundsState.getMinSize(); Point maxSize = mPipBoundsState.getMaxSize(); mPipBoundsState.updateMinMaxSize(pictureInPictureParams.getAspectRatioFloat()); final Rect entryBounds = mPipTaskOrganizer.startSwipePipToHome(componentName, activityInfo, pictureInPictureParams); // restore min/max size, as this is referenced later in OnDisplayChangingListener and needs // to reflect the pre-rotation state for it to work mPipBoundsState.setMinSize(minSize.x, minSize.y); mPipBoundsState.setMaxSize(maxSize.x, maxSize.y); // sync mPipBoundsState with the newly calculated bounds. mPipBoundsState.setNormalBounds(entryBounds); return entryBounds; Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +5 −11 Original line number Diff line number Diff line Loading @@ -467,17 +467,11 @@ public class PipTouchHandler { } private void updatePinchResizeSizeConstraints(float aspectRatio) { final int minWidth, minHeight, maxWidth, maxHeight; minWidth = mSizeSpecSource.getMinSize(aspectRatio).getWidth(); minHeight = mSizeSpecSource.getMinSize(aspectRatio).getHeight(); maxWidth = mSizeSpecSource.getMaxSize(aspectRatio).getWidth(); maxHeight = mSizeSpecSource.getMaxSize(aspectRatio).getHeight(); mPipResizeGestureHandler.updateMinSize(minWidth, minHeight); mPipResizeGestureHandler.updateMaxSize(maxWidth, maxHeight); mPipBoundsState.setMaxSize(maxWidth, maxHeight); mPipBoundsState.setMinSize(minWidth, minHeight); mPipBoundsState.updateMinMaxSize(aspectRatio); mPipResizeGestureHandler.updateMinSize(mPipBoundsState.getMinSize().x, mPipBoundsState.getMinSize().y); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getMaxSize().x, mPipBoundsState.getMaxSize().y); } /** Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +8 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,14 @@ public class PipBoundsState { mExpandedMovementBounds.set(bounds); } /** Updates the min and max sizes based on the size spec and aspect ratio. */ public void updateMinMaxSize(float aspectRatio) { final Size minSize = mSizeSpecSource.getMinSize(aspectRatio); mMinSize.set(minSize.getWidth(), minSize.getHeight()); final Size maxSize = mSizeSpecSource.getMaxSize(aspectRatio); mMaxSize.set(maxSize.getWidth(), maxSize.getHeight()); } /** Sets the max possible size for resize. */ public void setMaxSize(int width, int height) { mMaxSize.set(width, height); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +1 −0 Original line number Diff line number Diff line Loading @@ -1037,6 +1037,7 @@ public class PipTransition extends PipTransitionController { private void computeEnterPipRotatedBounds(int rotationDelta, int startRotation, int endRotation, TaskInfo taskInfo, Rect outDestinationBounds, @Nullable Rect outSourceHintRect) { mPipDisplayLayoutState.rotateTo(endRotation); mPipBoundsState.updateMinMaxSize(mPipBoundsState.getAspectRatio()); final Rect displayBounds = mPipDisplayLayoutState.getDisplayBounds(); outDestinationBounds.set(mPipBoundsAlgorithm.getEntryDestinationBounds()); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +8 −0 Original line number Diff line number Diff line Loading @@ -976,8 +976,16 @@ public class PipController implements PipTransitionController.PipTransitionCallb mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG, hotseatKeepClearArea); onDisplayRotationChangedNotInPip(mContext, launcherRotation); // cache current min/max size Point minSize = mPipBoundsState.getMinSize(); Point maxSize = mPipBoundsState.getMaxSize(); mPipBoundsState.updateMinMaxSize(pictureInPictureParams.getAspectRatioFloat()); final Rect entryBounds = mPipTaskOrganizer.startSwipePipToHome(componentName, activityInfo, pictureInPictureParams); // restore min/max size, as this is referenced later in OnDisplayChangingListener and needs // to reflect the pre-rotation state for it to work mPipBoundsState.setMinSize(minSize.x, minSize.y); mPipBoundsState.setMaxSize(maxSize.x, maxSize.y); // sync mPipBoundsState with the newly calculated bounds. mPipBoundsState.setNormalBounds(entryBounds); return entryBounds; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +5 −11 Original line number Diff line number Diff line Loading @@ -467,17 +467,11 @@ public class PipTouchHandler { } private void updatePinchResizeSizeConstraints(float aspectRatio) { final int minWidth, minHeight, maxWidth, maxHeight; minWidth = mSizeSpecSource.getMinSize(aspectRatio).getWidth(); minHeight = mSizeSpecSource.getMinSize(aspectRatio).getHeight(); maxWidth = mSizeSpecSource.getMaxSize(aspectRatio).getWidth(); maxHeight = mSizeSpecSource.getMaxSize(aspectRatio).getHeight(); mPipResizeGestureHandler.updateMinSize(minWidth, minHeight); mPipResizeGestureHandler.updateMaxSize(maxWidth, maxHeight); mPipBoundsState.setMaxSize(maxWidth, maxHeight); mPipBoundsState.setMinSize(minWidth, minHeight); mPipBoundsState.updateMinMaxSize(aspectRatio); mPipResizeGestureHandler.updateMinSize(mPipBoundsState.getMinSize().x, mPipBoundsState.getMinSize().y); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getMaxSize().x, mPipBoundsState.getMaxSize().y); } /** Loading