Merge "Retain current position and expand state on next video" into rvc-dev am: 7d4bad92af

Change-Id: Ifb7fc1ec0db57d18be56e7887d503b984beb254b
This commit is contained in:
Hongwei Wang
2020-05-30 01:45:36 +00:00
committed by Automerger Merge Worker
2 changed files with 13 additions and 4 deletions

View File

@@ -250,10 +250,19 @@ public class PipBoundsHandler {
}
/**
* @return {@link Rect} of the destination PiP window bounds.
* See {@link #getDestinationBounds(ComponentName, float, Rect, Size, boolean)}
*/
Rect getDestinationBounds(ComponentName componentName, float aspectRatio, Rect bounds,
Size minimalSize) {
return getDestinationBounds(componentName, aspectRatio, bounds, minimalSize,
false /* useCurrentMinEdgeSize */);
}
/**
* @return {@link Rect} of the destination PiP window bounds.
*/
Rect getDestinationBounds(ComponentName componentName, float aspectRatio, Rect bounds,
Size minimalSize, boolean useCurrentMinEdgeSize) {
if (!componentName.equals(mLastPipComponentName)) {
onResetReentryBoundsUnchecked();
mLastPipComponentName = componentName;
@@ -269,8 +278,7 @@ public class PipBoundsHandler {
destinationBounds = new Rect(bounds);
}
if (isValidPictureInPictureAspectRatio(aspectRatio)) {
transformBoundsToAspectRatio(destinationBounds, aspectRatio,
false /* useCurrentMinEdgeSize */);
transformBoundsToAspectRatio(destinationBounds, aspectRatio, useCurrentMinEdgeSize);
}
mAspectRatio = aspectRatio;
return destinationBounds;

View File

@@ -459,7 +459,8 @@ public class PipTaskOrganizer extends TaskOrganizer implements
}
final Rect destinationBounds = mPipBoundsHandler.getDestinationBounds(
info.topActivity, getAspectRatioOrDefault(newParams),
null /* bounds */, getMinimalSize(info.topActivityInfo));
mLastReportedBounds, getMinimalSize(info.topActivityInfo),
true /* userCurrentMinEdgeSize */);
Objects.requireNonNull(destinationBounds, "Missing destination bounds");
scheduleAnimateResizePip(destinationBounds, mEnterExitAnimationDuration,
null /* updateBoundsCallback */);