Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,21 @@ public class PipBoundsAlgorithm { return null; return null; } } /** * Returns the source hint rect if it is valid (if provided and is contained by the current * task bounds and not too small). */ public static Rect getValidSourceHintRect(PictureInPictureParams params, Rect sourceBounds, @NonNull Rect destinationBounds) { final Rect sourceHintRect = getValidSourceHintRect(params, sourceBounds); if (sourceHintRect != null && sourceHintRect.width() > destinationBounds.width() && sourceHintRect.height() > destinationBounds.height()) { return sourceHintRect; } return null; } public float getDefaultAspectRatio() { public float getDefaultAspectRatio() { return mDefaultAspectRatio; return mDefaultAspectRatio; } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -564,7 +564,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { mPipMenuController.attach(mLeash); mPipMenuController.attach(mLeash); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( info.pictureInPictureParams, currentBounds); info.pictureInPictureParams, currentBounds, destinationBounds); scheduleAnimateResizePip(currentBounds, destinationBounds, 0 /* startingAngle */, scheduleAnimateResizePip(currentBounds, destinationBounds, 0 /* startingAngle */, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, null /* updateBoundsCallback */); null /* updateBoundsCallback */); Loading @@ -590,9 +590,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return; return; } } final Rect currentBounds = mTaskInfo.configuration.windowConfiguration.getBounds(); final Rect currentBounds = mTaskInfo.configuration.windowConfiguration.getBounds(); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( mPictureInPictureParams, currentBounds); final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds(); final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds(); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( mPictureInPictureParams, currentBounds, destinationBounds); animateResizePip(currentBounds, destinationBounds, sourceHintRect, animateResizePip(currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, 0 /* startingAngle */); TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, 0 /* startingAngle */); mState = State.ENTERING_PIP; mState = State.ENTERING_PIP; Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -110,7 +110,7 @@ public class PipTransition extends PipTransitionController { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { final Rect sourceHintRect = final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( PipBoundsAlgorithm.getValidSourceHintRect( taskInfo.pictureInPictureParams, currentBounds); taskInfo.pictureInPictureParams, currentBounds, destinationBounds); animator = mPipAnimationController.getAnimator(taskInfo, leash, currentBounds, animator = mPipAnimationController.getAnimator(taskInfo, leash, currentBounds, currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, 0 /* startingAngle */, Surface.ROTATION_0); 0 /* startingAngle */, Surface.ROTATION_0); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,21 @@ public class PipBoundsAlgorithm { return null; return null; } } /** * Returns the source hint rect if it is valid (if provided and is contained by the current * task bounds and not too small). */ public static Rect getValidSourceHintRect(PictureInPictureParams params, Rect sourceBounds, @NonNull Rect destinationBounds) { final Rect sourceHintRect = getValidSourceHintRect(params, sourceBounds); if (sourceHintRect != null && sourceHintRect.width() > destinationBounds.width() && sourceHintRect.height() > destinationBounds.height()) { return sourceHintRect; } return null; } public float getDefaultAspectRatio() { public float getDefaultAspectRatio() { return mDefaultAspectRatio; return mDefaultAspectRatio; } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -564,7 +564,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { mPipMenuController.attach(mLeash); mPipMenuController.attach(mLeash); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( info.pictureInPictureParams, currentBounds); info.pictureInPictureParams, currentBounds, destinationBounds); scheduleAnimateResizePip(currentBounds, destinationBounds, 0 /* startingAngle */, scheduleAnimateResizePip(currentBounds, destinationBounds, 0 /* startingAngle */, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, null /* updateBoundsCallback */); null /* updateBoundsCallback */); Loading @@ -590,9 +590,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return; return; } } final Rect currentBounds = mTaskInfo.configuration.windowConfiguration.getBounds(); final Rect currentBounds = mTaskInfo.configuration.windowConfiguration.getBounds(); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( mPictureInPictureParams, currentBounds); final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds(); final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds(); final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( mPictureInPictureParams, currentBounds, destinationBounds); animateResizePip(currentBounds, destinationBounds, sourceHintRect, animateResizePip(currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, 0 /* startingAngle */); TRANSITION_DIRECTION_TO_PIP, mEnterAnimationDuration, 0 /* startingAngle */); mState = State.ENTERING_PIP; mState = State.ENTERING_PIP; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -110,7 +110,7 @@ public class PipTransition extends PipTransitionController { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { final Rect sourceHintRect = final Rect sourceHintRect = PipBoundsAlgorithm.getValidSourceHintRect( PipBoundsAlgorithm.getValidSourceHintRect( taskInfo.pictureInPictureParams, currentBounds); taskInfo.pictureInPictureParams, currentBounds, destinationBounds); animator = mPipAnimationController.getAnimator(taskInfo, leash, currentBounds, animator = mPipAnimationController.getAnimator(taskInfo, leash, currentBounds, currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP, 0 /* startingAngle */, Surface.ROTATION_0); 0 /* startingAngle */, Surface.ROTATION_0); Loading