Loading services/core/java/com/android/server/wm/DisplayContent.java +2 −1 Original line number Diff line number Diff line Loading @@ -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++; Loading services/core/java/com/android/server/wm/RecentsAnimationController.java +16 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; } Loading @@ -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; } Loading services/core/java/com/android/server/wm/Task.java +18 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading services/core/java/com/android/server/wm/TaskStack.java +14 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +2 −1 Original line number Diff line number Diff line Loading @@ -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++; Loading
services/core/java/com/android/server/wm/RecentsAnimationController.java +16 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; } Loading @@ -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; } Loading
services/core/java/com/android/server/wm/Task.java +18 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading
services/core/java/com/android/server/wm/TaskStack.java +14 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading