Loading packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public class PipAnimationController { return mCurrentAnimator; } PipTransitionAnimator getCurrentAnimator() { return mCurrentAnimator; } private PipTransitionAnimator setupPipTransitionAnimator(PipTransitionAnimator animator) { animator.setSurfaceTransactionHelper(mSurfaceTransactionHelper); animator.setInterpolator(mFastOutSlowInInterpolator); Loading Loading @@ -239,6 +243,9 @@ public class PipAnimationController { void setDestinationBounds(Rect destinationBounds) { mDestinationBounds.set(destinationBounds); if (mAnimationType == ANIM_TYPE_ALPHA) { onStartTransaction(mLeash, newSurfaceControlTransaction()); } } void setCurrentValue(T value) { Loading packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,10 @@ public class PipBoundsHandler { return mLastDestinationBounds; } public Rect getDisplayBounds() { return new Rect(0, 0, mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); } /** * Responds to IPinnedStackListener on {@link DisplayInfo} change. * It will normally follow up with a Loading packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +23 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,29 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { null /* updateBoundsCallback */); } /** * TODO(b/152809058): consolidate the display info handling logic in SysUI */ @SuppressWarnings("unchecked") public void mayUpdateCurrentAnimationOnRotationChange() { final PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); if (animator != null && animator.isRunning() && animator.getTransitionDirection() == TRANSITION_DIRECTION_TO_PIP) { final Rect currentDestinationBounds = animator.getDestinationBounds(); if (mPipBoundsHandler.getDisplayBounds().contains(currentDestinationBounds)) { return; } final Rect newDestinationBounds = mPipBoundsHandler.getDestinationBounds( getAspectRatioOrDefault(mTaskInfo.pictureInPictureParams), null /* bounds */, getMinimalSize(mTaskInfo.topActivityInfo)); if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) { animator.updateEndValue(newDestinationBounds); } animator.setDestinationBounds(newDestinationBounds); } } /** * @return {@code true} if the aspect ratio is changed since no other parameters within * {@link PictureInPictureParams} would affect the bounds. Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds, animatingBounds, fromImeAdjustment, fromShelfAdjustment, mTmpDisplayInfo.rotation); mPipTaskOrganizer.mayUpdateCurrentAnimationOnRotationChange(); } public void dump(PrintWriter pw) { Loading Loading
packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public class PipAnimationController { return mCurrentAnimator; } PipTransitionAnimator getCurrentAnimator() { return mCurrentAnimator; } private PipTransitionAnimator setupPipTransitionAnimator(PipTransitionAnimator animator) { animator.setSurfaceTransactionHelper(mSurfaceTransactionHelper); animator.setInterpolator(mFastOutSlowInInterpolator); Loading Loading @@ -239,6 +243,9 @@ public class PipAnimationController { void setDestinationBounds(Rect destinationBounds) { mDestinationBounds.set(destinationBounds); if (mAnimationType == ANIM_TYPE_ALPHA) { onStartTransaction(mLeash, newSurfaceControlTransaction()); } } void setCurrentValue(T value) { Loading
packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,10 @@ public class PipBoundsHandler { return mLastDestinationBounds; } public Rect getDisplayBounds() { return new Rect(0, 0, mDisplayInfo.logicalWidth, mDisplayInfo.logicalHeight); } /** * Responds to IPinnedStackListener on {@link DisplayInfo} change. * It will normally follow up with a Loading
packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +23 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,29 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { null /* updateBoundsCallback */); } /** * TODO(b/152809058): consolidate the display info handling logic in SysUI */ @SuppressWarnings("unchecked") public void mayUpdateCurrentAnimationOnRotationChange() { final PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); if (animator != null && animator.isRunning() && animator.getTransitionDirection() == TRANSITION_DIRECTION_TO_PIP) { final Rect currentDestinationBounds = animator.getDestinationBounds(); if (mPipBoundsHandler.getDisplayBounds().contains(currentDestinationBounds)) { return; } final Rect newDestinationBounds = mPipBoundsHandler.getDestinationBounds( getAspectRatioOrDefault(mTaskInfo.pictureInPictureParams), null /* bounds */, getMinimalSize(mTaskInfo.topActivityInfo)); if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) { animator.updateEndValue(newDestinationBounds); } animator.setDestinationBounds(newDestinationBounds); } } /** * @return {@code true} if the aspect ratio is changed since no other parameters within * {@link PictureInPictureParams} would affect the bounds. Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds, animatingBounds, fromImeAdjustment, fromShelfAdjustment, mTmpDisplayInfo.rotation); mPipTaskOrganizer.mayUpdateCurrentAnimationOnRotationChange(); } public void dump(PrintWriter pw) { Loading