Merge changes from topic "fw_quickstep_update" into pi-dev

am: 5fa07c0986

Change-Id: Ic6b6991106fe021a178b3af4328d5fd81287649c
This commit is contained in:
Winson Chung
2018-04-03 16:58:05 -07:00
committed by android-build-merger
4 changed files with 50 additions and 7 deletions

View File

@@ -3568,7 +3568,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
if (s.inSplitScreenWindowingMode() && mSplitScreenDividerAnchor != null) {
t.setLayer(mSplitScreenDividerAnchor, layer++);
}
if (s.isAppAnimating() && state != ALWAYS_ON_TOP_STATE) {
if ((s.isTaskAnimating() || s.isAppAnimating())
&& state != ALWAYS_ON_TOP_STATE) {
// Ensure the animation layer ends up above the
// highest animating stack and no higher.
layerForAnimationLayer = layer++;

View File

@@ -432,6 +432,15 @@ public class RecentsAnimationController implements DeathRecipient {
return mHomeAppToken.windowsCanBeWallpaperTarget();
}
boolean isAnimatingTask(Task task) {
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
if (task == mPendingAnimations.get(i).mTask) {
return true;
}
}
return false;
}
private boolean isAnimatingApp(AppWindowToken appToken) {
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
final Task task = mPendingAnimations.get(i).mTask;
@@ -452,18 +461,18 @@ public class RecentsAnimationController implements DeathRecipient {
private OnAnimationFinishedCallback mCapturedFinishCallback;
private final boolean mIsRecentTaskInvisible;
private RemoteAnimationTarget mTarget;
private final Point mPosition = new Point();
private final Rect mBounds = new Rect();
TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
mTask = task;
mIsRecentTaskInvisible = isRecentTaskInvisible;
final WindowContainer container = mTask.getParent();
container.getRelativePosition(mPosition);
container.getBounds(mBounds);
}
RemoteAnimationTarget createRemoteAnimationApp() {
final Point position = new Point();
final Rect bounds = new Rect();
final WindowContainer container = mTask.getParent();
container.getRelativePosition(position);
container.getBounds(bounds);
final WindowState mainWindow = mTask.getTopVisibleAppMainWindow();
if (mainWindow == null) {
return null;
@@ -472,7 +481,7 @@ public class RecentsAnimationController implements DeathRecipient {
InsetUtils.addInsets(insets, mainWindow.mAppToken.getLetterboxInsets());
mTarget = new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash,
!mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
insets, mTask.getPrefixOrderIndex(), position, bounds,
insets, mTask.getPrefixOrderIndex(), mPosition, mBounds,
mTask.getWindowConfiguration(), mIsRecentTaskInvisible);
return mTarget;
}
@@ -495,6 +504,7 @@ public class RecentsAnimationController implements DeathRecipient {
@Override
public void startAnimation(SurfaceControl animationLeash, Transaction t,
OnAnimationFinishedCallback finishCallback) {
t.setPosition(animationLeash, mPosition.x, mPosition.y);
mCapturedLeash = animationLeash;
mCapturedFinishCallback = finishCallback;
}

View File

@@ -44,6 +44,7 @@ import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.Surface;
import android.view.SurfaceControl;
import com.android.internal.annotations.VisibleForTesting;
import java.io.PrintWriter;
@@ -559,6 +560,23 @@ class Task extends WindowContainer<AppWindowToken> {
&& !mStack.isAnimatingBoundsToFullscreen() && !mPreserveNonFloatingState;
}
@Override
public SurfaceControl getAnimationLeashParent() {
// Reparent to the animation layer so that we aren't clipped by the non-minimized
// stack bounds, currently we only animate the task for the recents animation
return getAppAnimationLayer(false /* boosted */);
}
boolean isTaskAnimating() {
final RecentsAnimationController recentsAnim = mService.getRecentsAnimationController();
if (recentsAnim != null) {
if (recentsAnim.isAnimatingTask(this)) {
return true;
}
}
return false;
}
WindowState getTopVisibleAppMainWindow() {
final AppWindowToken token = getTopVisibleAppToken();
return token != null ? token.findMainWindow() : null;

View File

@@ -1331,6 +1331,20 @@ public class TaskStack extends WindowContainer<Task> implements
return mMinimizeAmount != 0f;
}
/**
* @return {@code true} if we have a {@link Task} that is animating (currently only used for the
* recents animation); {@code false} otherwise.
*/
boolean isTaskAnimating() {
for (int j = mChildren.size() - 1; j >= 0; j--) {
final Task task = mChildren.get(j);
if (task.isTaskAnimating()) {
return true;
}
}
return false;
}
@CallSuper
@Override
public void writeToProto(ProtoOutputStream proto, long fieldId, boolean trim) {