Merge "Add localBounds in RemoteAnimationTarget" into rvc-dev am: bd8e715c01 am: c2fb1de0b8 am: 5bc593f90b
Change-Id: Ic50c28c41069a7b21bf9d9a2d2b273a00b07dfa5
This commit is contained in:
@@ -20,9 +20,11 @@ import static android.view.RemoteAnimationTargetProto.CLIP_RECT;
|
|||||||
import static android.view.RemoteAnimationTargetProto.CONTENT_INSETS;
|
import static android.view.RemoteAnimationTargetProto.CONTENT_INSETS;
|
||||||
import static android.view.RemoteAnimationTargetProto.IS_TRANSLUCENT;
|
import static android.view.RemoteAnimationTargetProto.IS_TRANSLUCENT;
|
||||||
import static android.view.RemoteAnimationTargetProto.LEASH;
|
import static android.view.RemoteAnimationTargetProto.LEASH;
|
||||||
|
import static android.view.RemoteAnimationTargetProto.LOCAL_BOUNDS;
|
||||||
import static android.view.RemoteAnimationTargetProto.MODE;
|
import static android.view.RemoteAnimationTargetProto.MODE;
|
||||||
import static android.view.RemoteAnimationTargetProto.POSITION;
|
import static android.view.RemoteAnimationTargetProto.POSITION;
|
||||||
import static android.view.RemoteAnimationTargetProto.PREFIX_ORDER_INDEX;
|
import static android.view.RemoteAnimationTargetProto.PREFIX_ORDER_INDEX;
|
||||||
|
import static android.view.RemoteAnimationTargetProto.SCREEN_SPACE_BOUNDS;
|
||||||
import static android.view.RemoteAnimationTargetProto.SOURCE_CONTAINER_BOUNDS;
|
import static android.view.RemoteAnimationTargetProto.SOURCE_CONTAINER_BOUNDS;
|
||||||
import static android.view.RemoteAnimationTargetProto.START_BOUNDS;
|
import static android.view.RemoteAnimationTargetProto.START_BOUNDS;
|
||||||
import static android.view.RemoteAnimationTargetProto.START_LEASH;
|
import static android.view.RemoteAnimationTargetProto.START_LEASH;
|
||||||
@@ -130,18 +132,37 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
* The source position of the app, in screen spaces coordinates. If the position of the leash
|
* The source position of the app, in screen spaces coordinates. If the position of the leash
|
||||||
* is modified from the controlling app, any animation transform needs to be offset by this
|
* is modified from the controlling app, any animation transform needs to be offset by this
|
||||||
* amount.
|
* amount.
|
||||||
|
* @deprecated Use {@link #localBounds} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public final Point position;
|
public final Point position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bounds of the target relative to its parent.
|
||||||
|
* When the app target animating on its parent, we need to use the local coordinates relative to
|
||||||
|
* its parent with {@code localBounds.left} & {@code localBounds.top} rather than using
|
||||||
|
* {@code position} in screen coordinates.
|
||||||
|
*/
|
||||||
|
public final Rect localBounds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The bounds of the source container the app lives in, in screen space coordinates. If the crop
|
* The bounds of the source container the app lives in, in screen space coordinates. If the crop
|
||||||
* of the leash is modified from the controlling app, it needs to take the source container
|
* of the leash is modified from the controlling app, it needs to take the source container
|
||||||
* bounds into account when calculating the crop.
|
* bounds into account when calculating the crop.
|
||||||
|
* @deprecated Renamed to {@link #screenSpaceBounds}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public final Rect sourceContainerBounds;
|
public final Rect sourceContainerBounds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bounds of the target relative to the screen. If the crop of the leash is modified from the
|
||||||
|
* controlling app, it needs to take the screen space bounds into account when calculating the
|
||||||
|
* crop.
|
||||||
|
*/
|
||||||
|
public final Rect screenSpaceBounds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The starting bounds of the source container in screen space coordinates. This is {@code null}
|
* The starting bounds of the source container in screen space coordinates. This is {@code null}
|
||||||
* if the animation target isn't MODE_CHANGING. Since this is the starting bounds, it's size
|
* if the animation target isn't MODE_CHANGING. Since this is the starting bounds, it's size
|
||||||
@@ -165,7 +186,8 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
|
|
||||||
public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
|
public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
|
||||||
Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
|
Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
|
||||||
Rect sourceContainerBounds, WindowConfiguration windowConfig, boolean isNotInRecents,
|
Rect localBounds, Rect screenSpaceBounds,
|
||||||
|
WindowConfiguration windowConfig, boolean isNotInRecents,
|
||||||
SurfaceControl startLeash, Rect startBounds) {
|
SurfaceControl startLeash, Rect startBounds) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
@@ -175,7 +197,9 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
this.contentInsets = new Rect(contentInsets);
|
this.contentInsets = new Rect(contentInsets);
|
||||||
this.prefixOrderIndex = prefixOrderIndex;
|
this.prefixOrderIndex = prefixOrderIndex;
|
||||||
this.position = new Point(position);
|
this.position = new Point(position);
|
||||||
this.sourceContainerBounds = new Rect(sourceContainerBounds);
|
this.localBounds = new Rect(localBounds);
|
||||||
|
this.sourceContainerBounds = new Rect(screenSpaceBounds);
|
||||||
|
this.screenSpaceBounds = new Rect(screenSpaceBounds);
|
||||||
this.windowConfiguration = windowConfig;
|
this.windowConfiguration = windowConfig;
|
||||||
this.isNotInRecents = isNotInRecents;
|
this.isNotInRecents = isNotInRecents;
|
||||||
this.startLeash = startLeash;
|
this.startLeash = startLeash;
|
||||||
@@ -191,7 +215,9 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
contentInsets = in.readParcelable(null);
|
contentInsets = in.readParcelable(null);
|
||||||
prefixOrderIndex = in.readInt();
|
prefixOrderIndex = in.readInt();
|
||||||
position = in.readParcelable(null);
|
position = in.readParcelable(null);
|
||||||
|
localBounds = in.readParcelable(null);
|
||||||
sourceContainerBounds = in.readParcelable(null);
|
sourceContainerBounds = in.readParcelable(null);
|
||||||
|
screenSpaceBounds = in.readParcelable(null);
|
||||||
windowConfiguration = in.readParcelable(null);
|
windowConfiguration = in.readParcelable(null);
|
||||||
isNotInRecents = in.readBoolean();
|
isNotInRecents = in.readBoolean();
|
||||||
startLeash = in.readParcelable(null);
|
startLeash = in.readParcelable(null);
|
||||||
@@ -213,7 +239,9 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
dest.writeParcelable(contentInsets, 0 /* flags */);
|
dest.writeParcelable(contentInsets, 0 /* flags */);
|
||||||
dest.writeInt(prefixOrderIndex);
|
dest.writeInt(prefixOrderIndex);
|
||||||
dest.writeParcelable(position, 0 /* flags */);
|
dest.writeParcelable(position, 0 /* flags */);
|
||||||
|
dest.writeParcelable(localBounds, 0 /* flags */);
|
||||||
dest.writeParcelable(sourceContainerBounds, 0 /* flags */);
|
dest.writeParcelable(sourceContainerBounds, 0 /* flags */);
|
||||||
|
dest.writeParcelable(screenSpaceBounds, 0 /* flags */);
|
||||||
dest.writeParcelable(windowConfiguration, 0 /* flags */);
|
dest.writeParcelable(windowConfiguration, 0 /* flags */);
|
||||||
dest.writeBoolean(isNotInRecents);
|
dest.writeBoolean(isNotInRecents);
|
||||||
dest.writeParcelable(startLeash, 0 /* flags */);
|
dest.writeParcelable(startLeash, 0 /* flags */);
|
||||||
@@ -229,6 +257,8 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
pw.print(" prefixOrderIndex="); pw.print(prefixOrderIndex);
|
pw.print(" prefixOrderIndex="); pw.print(prefixOrderIndex);
|
||||||
pw.print(" position="); position.printShortString(pw);
|
pw.print(" position="); position.printShortString(pw);
|
||||||
pw.print(" sourceContainerBounds="); sourceContainerBounds.printShortString(pw);
|
pw.print(" sourceContainerBounds="); sourceContainerBounds.printShortString(pw);
|
||||||
|
pw.print(" screenSpaceBounds="); screenSpaceBounds.printShortString(pw);
|
||||||
|
pw.print(" localBounds="); localBounds.printShortString(pw);
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.print(prefix); pw.print("windowConfiguration="); pw.println(windowConfiguration);
|
pw.print(prefix); pw.print("windowConfiguration="); pw.println(windowConfiguration);
|
||||||
pw.print(prefix); pw.print("leash="); pw.println(leash);
|
pw.print(prefix); pw.print("leash="); pw.println(leash);
|
||||||
@@ -245,6 +275,8 @@ public class RemoteAnimationTarget implements Parcelable {
|
|||||||
proto.write(PREFIX_ORDER_INDEX, prefixOrderIndex);
|
proto.write(PREFIX_ORDER_INDEX, prefixOrderIndex);
|
||||||
position.dumpDebug(proto, POSITION);
|
position.dumpDebug(proto, POSITION);
|
||||||
sourceContainerBounds.dumpDebug(proto, SOURCE_CONTAINER_BOUNDS);
|
sourceContainerBounds.dumpDebug(proto, SOURCE_CONTAINER_BOUNDS);
|
||||||
|
screenSpaceBounds.dumpDebug(proto, SCREEN_SPACE_BOUNDS);
|
||||||
|
localBounds.dumpDebug(proto, LOCAL_BOUNDS);
|
||||||
windowConfiguration.dumpDebug(proto, WINDOW_CONFIGURATION);
|
windowConfiguration.dumpDebug(proto, WINDOW_CONFIGURATION);
|
||||||
if (startLeash != null) {
|
if (startLeash != null) {
|
||||||
startLeash.dumpDebug(proto, START_LEASH);
|
startLeash.dumpDebug(proto, START_LEASH);
|
||||||
|
|||||||
@@ -44,4 +44,6 @@ message RemoteAnimationTargetProto {
|
|||||||
optional .android.app.WindowConfigurationProto window_configuration = 10;
|
optional .android.app.WindowConfigurationProto window_configuration = 10;
|
||||||
optional .android.view.SurfaceControlProto start_leash = 11;
|
optional .android.view.SurfaceControlProto start_leash = 11;
|
||||||
optional .android.graphics.RectProto start_bounds = 12;
|
optional .android.graphics.RectProto start_bounds = 12;
|
||||||
|
optional .android.graphics.RectProto local_bounds = 13;
|
||||||
|
optional .android.graphics.RectProto screen_space_bounds = 14;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ public class RemoteAnimationTargetCompat {
|
|||||||
public final Rect clipRect;
|
public final Rect clipRect;
|
||||||
public final int prefixOrderIndex;
|
public final int prefixOrderIndex;
|
||||||
public final Point position;
|
public final Point position;
|
||||||
|
public final Rect localBounds;
|
||||||
public final Rect sourceContainerBounds;
|
public final Rect sourceContainerBounds;
|
||||||
|
public final Rect screenSpaceBounds;
|
||||||
public final boolean isNotInRecents;
|
public final boolean isNotInRecents;
|
||||||
public final Rect contentInsets;
|
public final Rect contentInsets;
|
||||||
|
|
||||||
@@ -57,7 +59,9 @@ public class RemoteAnimationTargetCompat {
|
|||||||
isTranslucent = app.isTranslucent;
|
isTranslucent = app.isTranslucent;
|
||||||
clipRect = app.clipRect;
|
clipRect = app.clipRect;
|
||||||
position = app.position;
|
position = app.position;
|
||||||
|
localBounds = app.localBounds;
|
||||||
sourceContainerBounds = app.sourceContainerBounds;
|
sourceContainerBounds = app.sourceContainerBounds;
|
||||||
|
screenSpaceBounds = app.screenSpaceBounds;
|
||||||
prefixOrderIndex = app.prefixOrderIndex;
|
prefixOrderIndex = app.prefixOrderIndex;
|
||||||
isNotInRecents = app.isNotInRecents;
|
isNotInRecents = app.isNotInRecents;
|
||||||
contentInsets = app.contentInsets;
|
contentInsets = app.contentInsets;
|
||||||
|
|||||||
@@ -7620,7 +7620,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
return new RemoteAnimationTarget(task.mTaskId, record.getMode(),
|
return new RemoteAnimationTarget(task.mTaskId, record.getMode(),
|
||||||
record.mAdapter.mCapturedLeash, !fillsParent(),
|
record.mAdapter.mCapturedLeash, !fillsParent(),
|
||||||
mainWindow.mWinAnimator.mLastClipRect, insets,
|
mainWindow.mWinAnimator.mLastClipRect, insets,
|
||||||
getPrefixOrderIndex(), record.mAdapter.mPosition,
|
getPrefixOrderIndex(), record.mAdapter.mPosition, record.mAdapter.mLocalBounds,
|
||||||
record.mAdapter.mStackBounds, task.getWindowConfiguration(),
|
record.mAdapter.mStackBounds, task.getWindowConfiguration(),
|
||||||
false /*isNotInRecents*/,
|
false /*isNotInRecents*/,
|
||||||
record.mThumbnailAdapter != null ? record.mThumbnailAdapter.mCapturedLeash : null,
|
record.mThumbnailAdapter != null ? record.mThumbnailAdapter.mCapturedLeash : null,
|
||||||
|
|||||||
@@ -820,15 +820,19 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
private @AnimationType int mLastAnimationType;
|
private @AnimationType int mLastAnimationType;
|
||||||
private final boolean mIsRecentTaskInvisible;
|
private final boolean mIsRecentTaskInvisible;
|
||||||
private RemoteAnimationTarget mTarget;
|
private RemoteAnimationTarget mTarget;
|
||||||
private final Point mPosition = new Point();
|
|
||||||
private final Rect mBounds = new Rect();
|
private final Rect mBounds = new Rect();
|
||||||
|
// The bounds of the target relative to its parent.
|
||||||
|
private Rect mLocalBounds = new Rect();
|
||||||
|
|
||||||
TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
|
TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
|
||||||
mTask = task;
|
mTask = task;
|
||||||
mIsRecentTaskInvisible = isRecentTaskInvisible;
|
mIsRecentTaskInvisible = isRecentTaskInvisible;
|
||||||
final WindowContainer container = mTask.getParent();
|
mBounds.set(mTask.getDisplayedBounds());
|
||||||
mBounds.set(container.getDisplayedBounds());
|
|
||||||
mPosition.set(mBounds.left, mBounds.top);
|
mLocalBounds.set(mBounds);
|
||||||
|
Point tmpPos = new Point();
|
||||||
|
mTask.getRelativeDisplayedPosition(tmpPos);
|
||||||
|
mLocalBounds.offsetTo(tmpPos.x, tmpPos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteAnimationTarget createRemoteAnimationTarget() {
|
RemoteAnimationTarget createRemoteAnimationTarget() {
|
||||||
@@ -847,8 +851,9 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
: MODE_CLOSING;
|
: MODE_CLOSING;
|
||||||
mTarget = new RemoteAnimationTarget(mTask.mTaskId, mode, mCapturedLeash,
|
mTarget = new RemoteAnimationTarget(mTask.mTaskId, mode, mCapturedLeash,
|
||||||
!topApp.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
|
!topApp.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
|
||||||
insets, mTask.getPrefixOrderIndex(), mPosition, mBounds,
|
insets, mTask.getPrefixOrderIndex(), new Point(mBounds.left, mBounds.top),
|
||||||
mTask.getWindowConfiguration(), mIsRecentTaskInvisible, null, null);
|
mLocalBounds, mBounds, mTask.getWindowConfiguration(),
|
||||||
|
mIsRecentTaskInvisible, null, null);
|
||||||
return mTarget;
|
return mTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -862,8 +867,8 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
@AnimationType int type, OnAnimationFinishedCallback finishCallback) {
|
@AnimationType int type, OnAnimationFinishedCallback finishCallback) {
|
||||||
// Restore z-layering, position and stack crop until client has a chance to modify it.
|
// Restore z-layering, position and stack crop until client has a chance to modify it.
|
||||||
t.setLayer(animationLeash, mTask.getPrefixOrderIndex());
|
t.setLayer(animationLeash, mTask.getPrefixOrderIndex());
|
||||||
t.setPosition(animationLeash, mPosition.x, mPosition.y);
|
t.setPosition(animationLeash, mLocalBounds.left, mLocalBounds.top);
|
||||||
mTmpRect.set(mBounds);
|
mTmpRect.set(mLocalBounds);
|
||||||
mTmpRect.offsetTo(0, 0);
|
mTmpRect.offsetTo(0, 0);
|
||||||
t.setWindowCrop(animationLeash, mTmpRect);
|
t.setWindowCrop(animationLeash, mTmpRect);
|
||||||
mCapturedLeash = animationLeash;
|
mCapturedLeash = animationLeash;
|
||||||
@@ -897,7 +902,7 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
pw.print(prefix); pw.println("Target: null");
|
pw.print(prefix); pw.println("Target: null");
|
||||||
}
|
}
|
||||||
pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
|
pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
|
||||||
pw.println("mPosition=" + mPosition);
|
pw.println("mLocalBounds=" + mLocalBounds);
|
||||||
pw.println("mBounds=" + mBounds);
|
pw.println("mBounds=" + mBounds);
|
||||||
pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
|
pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,16 +80,17 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
*
|
*
|
||||||
* @param windowContainer The windows to animate.
|
* @param windowContainer The windows to animate.
|
||||||
* @param position The position app bounds, in screen coordinates.
|
* @param position The position app bounds, in screen coordinates.
|
||||||
|
* @param localBounds The bounds of the app relative to its parent.
|
||||||
* @param stackBounds The stack bounds of the app relative to position.
|
* @param stackBounds The stack bounds of the app relative to position.
|
||||||
* @param startBounds The stack bounds before the transition, in screen coordinates
|
* @param startBounds The stack bounds before the transition, in screen coordinates
|
||||||
* @return The record representing animation(s) to run on the app.
|
* @return The record representing animation(s) to run on the app.
|
||||||
*/
|
*/
|
||||||
RemoteAnimationRecord createRemoteAnimationRecord(WindowContainer windowContainer,
|
RemoteAnimationRecord createRemoteAnimationRecord(WindowContainer windowContainer,
|
||||||
Point position, Rect stackBounds, Rect startBounds) {
|
Point position, Rect localBounds, Rect stackBounds, Rect startBounds) {
|
||||||
ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAnimationAdapter(): container=%s",
|
ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAnimationAdapter(): container=%s",
|
||||||
windowContainer);
|
windowContainer);
|
||||||
final RemoteAnimationRecord adapters =
|
final RemoteAnimationRecord adapters = new RemoteAnimationRecord(windowContainer, position,
|
||||||
new RemoteAnimationRecord(windowContainer, position, stackBounds, startBounds);
|
localBounds, stackBounds, startBounds);
|
||||||
mPendingAnimations.add(adapters);
|
mPendingAnimations.add(adapters);
|
||||||
return adapters;
|
return adapters;
|
||||||
}
|
}
|
||||||
@@ -355,17 +356,18 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
final WindowContainer mWindowContainer;
|
final WindowContainer mWindowContainer;
|
||||||
final Rect mStartBounds;
|
final Rect mStartBounds;
|
||||||
|
|
||||||
RemoteAnimationRecord(WindowContainer windowContainer, Point endPos, Rect endBounds,
|
RemoteAnimationRecord(WindowContainer windowContainer, Point endPos, Rect localBounds,
|
||||||
Rect startBounds) {
|
Rect endBounds, Rect startBounds) {
|
||||||
mWindowContainer = windowContainer;
|
mWindowContainer = windowContainer;
|
||||||
mAdapter = new RemoteAnimationAdapterWrapper(this, endPos, endBounds);
|
mAdapter = new RemoteAnimationAdapterWrapper(this, endPos, localBounds, endBounds);
|
||||||
if (startBounds != null) {
|
if (startBounds != null) {
|
||||||
mStartBounds = new Rect(startBounds);
|
mStartBounds = new Rect(startBounds);
|
||||||
mTmpRect.set(startBounds);
|
mTmpRect.set(startBounds);
|
||||||
mTmpRect.offsetTo(0, 0);
|
mTmpRect.offsetTo(0, 0);
|
||||||
if (mRemoteAnimationAdapter.getChangeNeedsSnapshot()) {
|
if (mRemoteAnimationAdapter.getChangeNeedsSnapshot()) {
|
||||||
mThumbnailAdapter =
|
mThumbnailAdapter =
|
||||||
new RemoteAnimationAdapterWrapper(this, new Point(0, 0), mTmpRect);
|
new RemoteAnimationAdapterWrapper(this, new Point(0, 0), localBounds,
|
||||||
|
mTmpRect);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mStartBounds = null;
|
mStartBounds = null;
|
||||||
@@ -401,12 +403,14 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
private OnAnimationFinishedCallback mCapturedFinishCallback;
|
private OnAnimationFinishedCallback mCapturedFinishCallback;
|
||||||
private @AnimationType int mAnimationType;
|
private @AnimationType int mAnimationType;
|
||||||
final Point mPosition = new Point();
|
final Point mPosition = new Point();
|
||||||
|
final Rect mLocalBounds;
|
||||||
final Rect mStackBounds = new Rect();
|
final Rect mStackBounds = new Rect();
|
||||||
|
|
||||||
RemoteAnimationAdapterWrapper(RemoteAnimationRecord record, Point position,
|
RemoteAnimationAdapterWrapper(RemoteAnimationRecord record, Point position,
|
||||||
Rect stackBounds) {
|
Rect localBounds, Rect stackBounds) {
|
||||||
mRecord = record;
|
mRecord = record;
|
||||||
mPosition.set(position.x, position.y);
|
mPosition.set(position.x, position.y);
|
||||||
|
mLocalBounds = localBounds;
|
||||||
mStackBounds.set(stackBounds);
|
mStackBounds.set(stackBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class WallpaperAnimationAdapter implements AnimationAdapter {
|
|||||||
*/
|
*/
|
||||||
RemoteAnimationTarget createRemoteAnimationTarget() {
|
RemoteAnimationTarget createRemoteAnimationTarget() {
|
||||||
mTarget = new RemoteAnimationTarget(-1, -1, getLeash(), false, null, null,
|
mTarget = new RemoteAnimationTarget(-1, -1, getLeash(), false, null, null,
|
||||||
mWallpaperToken.getPrefixOrderIndex(), new Point(), null,
|
mWallpaperToken.getPrefixOrderIndex(), new Point(), null, null,
|
||||||
mWallpaperToken.getWindowConfiguration(), true, null, null);
|
mWallpaperToken.getWindowConfiguration(), true, null, null);
|
||||||
return mTarget;
|
return mTarget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2086,9 +2086,11 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
|||||||
|
|
||||||
// Delaying animation start isn't compatible with remote animations at all.
|
// Delaying animation start isn't compatible with remote animations at all.
|
||||||
if (controller != null && !mSurfaceAnimator.isAnimationStartDelayed()) {
|
if (controller != null && !mSurfaceAnimator.isAnimationStartDelayed()) {
|
||||||
|
final Rect localBounds = new Rect(mTmpRect);
|
||||||
|
localBounds.offsetTo(mTmpPoint.x, mTmpPoint.y);
|
||||||
final RemoteAnimationController.RemoteAnimationRecord adapters =
|
final RemoteAnimationController.RemoteAnimationRecord adapters =
|
||||||
controller.createRemoteAnimationRecord(this, mTmpPoint, mTmpRect,
|
controller.createRemoteAnimationRecord(this, mTmpPoint, localBounds,
|
||||||
(isChanging ? mSurfaceFreezer.mFreezeBounds : null));
|
mTmpRect, (isChanging ? mSurfaceFreezer.mFreezeBounds : null));
|
||||||
resultAdapters = new Pair<>(adapters.mAdapter, adapters.mThumbnailAdapter);
|
resultAdapters = new Pair<>(adapters.mAdapter, adapters.mThumbnailAdapter);
|
||||||
} else if (isChanging) {
|
} else if (isChanging) {
|
||||||
final float durationScale = mWmService.getTransitionAnimationScaleLocked();
|
final float durationScale = mWmService.getTransitionAnimationScaleLocked();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
||||||
try {
|
try {
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -136,7 +136,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
public void testCancel() throws Exception {
|
public void testCancel() throws Exception {
|
||||||
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -150,7 +150,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
public void testTimeout() throws Exception {
|
public void testTimeout() throws Exception {
|
||||||
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -170,7 +170,8 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION,
|
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION,
|
||||||
"testWin");
|
"testWin");
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(
|
||||||
win.mActivityRecord, new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
win.mActivityRecord, new Point(50, 100), null, new Rect(50, 100, 150, 150),
|
||||||
|
null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -201,7 +202,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
public void testNotReallyStarted() {
|
public void testNotReallyStarted() {
|
||||||
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
||||||
mController.createRemoteAnimationRecord(win.mActivityRecord,
|
mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null);
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
verifyNoMoreInteractionsExceptAsBinder(mMockRunner);
|
verifyNoMoreInteractionsExceptAsBinder(mMockRunner);
|
||||||
}
|
}
|
||||||
@@ -211,9 +212,9 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
final WindowState win1 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin1");
|
final WindowState win1 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin1");
|
||||||
final WindowState win2 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin2");
|
final WindowState win2 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin2");
|
||||||
mController.createRemoteAnimationRecord(win1.mActivityRecord,
|
mController.createRemoteAnimationRecord(win1.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null);
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null);
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win2.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win2.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -234,7 +235,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
public void testRemovedBeforeStarted() {
|
public void testRemovedBeforeStarted() {
|
||||||
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
win.mActivityRecord.removeImmediately();
|
win.mActivityRecord.removeImmediately();
|
||||||
@@ -250,7 +251,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
mDisplayContent.mChangingContainers.add(win.mActivityRecord);
|
mDisplayContent.mChangingContainers.add(win.mActivityRecord);
|
||||||
try {
|
try {
|
||||||
final RemoteAnimationRecord record = mController.createRemoteAnimationRecord(
|
final RemoteAnimationRecord record = mController.createRemoteAnimationRecord(
|
||||||
win.mActivityRecord, new Point(50, 100), new Rect(50, 100, 150, 150),
|
win.mActivityRecord, new Point(50, 100), null, new Rect(50, 100, 150, 150),
|
||||||
new Rect(0, 0, 200, 200));
|
new Rect(0, 0, 200, 200));
|
||||||
assertNotNull(record.mThumbnailAdapter);
|
assertNotNull(record.mThumbnailAdapter);
|
||||||
((AnimationAdapter) record.mAdapter)
|
((AnimationAdapter) record.mAdapter)
|
||||||
@@ -304,7 +305,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
||||||
try {
|
try {
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
@@ -333,7 +334,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
|
|||||||
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
mDisplayContent.mOpeningApps.add(win.mActivityRecord);
|
||||||
try {
|
try {
|
||||||
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
final AnimationAdapter adapter = mController.createRemoteAnimationRecord(win.mActivityRecord,
|
||||||
new Point(50, 100), new Rect(50, 100, 150, 150), null).mAdapter;
|
new Point(50, 100), null, new Rect(50, 100, 150, 150), null).mAdapter;
|
||||||
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
|
||||||
mFinishedCallback);
|
mFinishedCallback);
|
||||||
mController.goodToGo();
|
mController.goodToGo();
|
||||||
|
|||||||
Reference in New Issue
Block a user