Ensure bounds animination for expanding PiP window

The internal animation type maybe reset at the end of RecentsAnimation
following the repro path in bug comments. Ensure BOUNDS animation type
if we know for certain that we're expanding / collpasing the PiP window

Added also last reported multi-window and PiP mode in dumpsys. This is
for internal debug purpose only.

Bug: 137849660
Test: Manually, see b/137849660#comment9
Test: dumpsys activity -v all
Change-Id: I0b7d102ccb4bc27dd0e432d1022bc12a42a0c36d
This commit is contained in:
Hongwei Wang
2019-07-25 15:14:47 -07:00
parent 512acbeae6
commit 2cebfd5e5f
2 changed files with 15 additions and 0 deletions

View File

@@ -945,6 +945,10 @@ public class Activity extends ContextThemeWrapper
/** @hide */ /** @hide */
boolean mEnterAnimationComplete; boolean mEnterAnimationComplete;
/** Track last dispatched multi-window and PiP mode to client, internal debug purpose **/
private Boolean mLastDispatchedIsInMultiWindowMode;
private Boolean mLastDispatchedIsInPictureInPictureMode;
private static native String getDlWarning(); private static native String getDlWarning();
/** Return the intent that started this activity. */ /** Return the intent that started this activity. */
@@ -6990,6 +6994,10 @@ public class Activity extends ContextThemeWrapper
writer.print(mResumed); writer.print(" mStopped="); writer.print(mResumed); writer.print(" mStopped=");
writer.print(mStopped); writer.print(" mFinished="); writer.print(mStopped); writer.print(" mFinished=");
writer.println(mFinished); writer.println(mFinished);
writer.print(innerPrefix); writer.print("mLastDispatchedIsInMultiWindowMode=");
writer.print(mLastDispatchedIsInMultiWindowMode);
writer.print(" mLastDispatchedIsInPictureInPictureMode=");
writer.println(mLastDispatchedIsInPictureInPictureMode);
writer.print(innerPrefix); writer.print("mChangingConfigurations="); writer.print(innerPrefix); writer.print("mChangingConfigurations=");
writer.println(mChangingConfigurations); writer.println(mChangingConfigurations);
writer.print(innerPrefix); writer.print("mCurrentConfig="); writer.print(innerPrefix); writer.print("mCurrentConfig=");
@@ -8071,6 +8079,7 @@ public class Activity extends ContextThemeWrapper
if (mWindow != null) { if (mWindow != null) {
mWindow.onMultiWindowModeChanged(); mWindow.onMultiWindowModeChanged();
} }
mLastDispatchedIsInMultiWindowMode = isInMultiWindowMode;
onMultiWindowModeChanged(isInMultiWindowMode, newConfig); onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
} }
@@ -8083,6 +8092,7 @@ public class Activity extends ContextThemeWrapper
if (mWindow != null) { if (mWindow != null) {
mWindow.onPictureInPictureModeChanged(isInPictureInPictureMode); mWindow.onPictureInPictureModeChanged(isInPictureInPictureMode);
} }
mLastDispatchedIsInPictureInPictureMode = isInPictureInPictureMode;
onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig); onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);
} }

View File

@@ -1746,6 +1746,11 @@ public class TaskStack extends WindowContainer<Task> implements
if (toBounds.width() == fromBounds.width() if (toBounds.width() == fromBounds.width()
&& toBounds.height() == fromBounds.height()) { && toBounds.height() == fromBounds.height()) {
intendedAnimationType = BoundsAnimationController.BOUNDS; intendedAnimationType = BoundsAnimationController.BOUNDS;
} else if (!fromFullscreen && !toBounds.equals(fromBounds)) {
// intendedAnimationType may have been reset at the end of RecentsAnimation,
// force it to BOUNDS type if we know for certain we're animating to
// a different bounds, especially for expand and collapse of PiP window.
intendedAnimationType = BoundsAnimationController.BOUNDS;
} }
} }