Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −2 Original line number Diff line number Diff line Loading @@ -7979,8 +7979,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } boolean isInTransition() { return mTransitionController.inTransition(this) // Shell transitions. || isAnimating(PARENTS | TRANSITION); // Legacy transitions. return inTransitionSelfOrParent(); } /** Loading services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +1 −7 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE_PRIV; import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS; import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS; import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_PINNED_TASK; import static com.android.server.wm.Task.REPARENT_KEEP_ROOT_TASK_AT_FRONT; import static com.android.server.wm.Task.TAG_CLEANUP; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION; import static com.android.server.wm.WindowContainer.POSITION_TOP; import android.Manifest; Loading Loading @@ -1925,9 +1921,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { ArrayList<ActivityRecord> readyToStopActivities = null; for (int i = mStoppingActivities.size() - 1; i >= 0; --i) { final ActivityRecord s = mStoppingActivities.get(i); final boolean animating = s.isAnimating(TRANSITION | PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS) || s.inTransition(); final boolean animating = s.isInTransition(); ProtoLog.v(WM_DEBUG_STATES, "Stopping %s: nowVisible=%b animating=%b " + "finishing=%s", s, s.nowVisible, animating, s.finishing); if (!animating || mService.mShuttingDown) { Loading services/core/java/com/android/server/wm/DisplayContent.java +3 −4 Original line number Diff line number Diff line Loading @@ -1782,7 +1782,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp * rotation transform to it and indicate that the display may be rotated after it is launched. */ void setFixedRotationLaunchingApp(@NonNull ActivityRecord r, @Rotation int rotation) { final WindowToken prevRotatedLaunchingApp = mFixedRotationLaunchingApp; final ActivityRecord prevRotatedLaunchingApp = mFixedRotationLaunchingApp; if (prevRotatedLaunchingApp == r && r.getWindowConfiguration().getRotation() == rotation) { // The given launching app and target rotation are the same as the existing ones. Loading @@ -1791,8 +1791,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (prevRotatedLaunchingApp != null && prevRotatedLaunchingApp.getWindowConfiguration().getRotation() == rotation // It is animating so we can expect there will have a transition callback. && (prevRotatedLaunchingApp.isAnimating(TRANSITION | PARENTS) || mTransitionController.inTransition(prevRotatedLaunchingApp))) { && (prevRotatedLaunchingApp.isInTransition())) { // It may be the case that multiple activities launch consecutively. Because their // rotation are the same, the transformed state can be shared to avoid duplicating // the heavy operations. This also benefits that the states of multiple activities Loading Loading @@ -6468,7 +6467,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Different tasks won't be in one activity transition animation. return; } if (task.isAppTransitioning()) { if (task.getActivity(ActivityRecord::isInTransition) != null) { return; // Continue to update orientation because the transition of the top rotated // launching activity is done. Loading services/core/java/com/android/server/wm/TaskFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -2496,7 +2496,7 @@ class TaskFragment extends WindowContainer<WindowContainer> { if (!hasChild()) { return false; } return isExitAnimationRunningSelfOrChild() || inTransition(); return isExitAnimationRunningSelfOrChild(); } @Override Loading services/core/java/com/android/server/wm/WindowContainer.java +16 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import static com.android.server.wm.IdentifierProto.TITLE; import static com.android.server.wm.IdentifierProto.USER_ID; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_ALL; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION; Loading Loading @@ -1158,6 +1159,19 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< return getActivity(app -> app.isAnimating(PARENTS | TRANSITION)) != null; } /** * Returns {@code true} if self or the parent container of the window is in transition, e.g. * the app or recents transition. This method is only used when legacy and shell transition * have the same condition to check the animation state. */ boolean inTransitionSelfOrParent() { if (!mTransitionController.isShellTransitionsEnabled()) { return isAnimating(PARENTS | TRANSITION, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS); } return inTransition(); } /** * @return Whether our own container running an animation at the moment. */ Loading @@ -1180,7 +1194,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< if (!mTransitionController.isShellTransitionsEnabled()) { return isAnimating(TRANSITION | CHILDREN, WindowState.EXIT_ANIMATING_TYPES); } if (mTransitionController.isCollecting(this)) { // Only check leaf containers because inTransition() includes parent. if (mChildren.isEmpty() && inTransition()) { return true; } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −2 Original line number Diff line number Diff line Loading @@ -7979,8 +7979,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } boolean isInTransition() { return mTransitionController.inTransition(this) // Shell transitions. || isAnimating(PARENTS | TRANSITION); // Legacy transitions. return inTransitionSelfOrParent(); } /** Loading
services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +1 −7 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE_PRIV; import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS; import static com.android.server.wm.RootWindowContainer.MATCH_ATTACHED_TASK_OR_RECENT_TASKS_AND_RESTORE; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS; import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_PINNED_TASK; import static com.android.server.wm.Task.REPARENT_KEEP_ROOT_TASK_AT_FRONT; import static com.android.server.wm.Task.TAG_CLEANUP; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION; import static com.android.server.wm.WindowContainer.POSITION_TOP; import android.Manifest; Loading Loading @@ -1925,9 +1921,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { ArrayList<ActivityRecord> readyToStopActivities = null; for (int i = mStoppingActivities.size() - 1; i >= 0; --i) { final ActivityRecord s = mStoppingActivities.get(i); final boolean animating = s.isAnimating(TRANSITION | PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS) || s.inTransition(); final boolean animating = s.isInTransition(); ProtoLog.v(WM_DEBUG_STATES, "Stopping %s: nowVisible=%b animating=%b " + "finishing=%s", s, s.nowVisible, animating, s.finishing); if (!animating || mService.mShuttingDown) { Loading
services/core/java/com/android/server/wm/DisplayContent.java +3 −4 Original line number Diff line number Diff line Loading @@ -1782,7 +1782,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp * rotation transform to it and indicate that the display may be rotated after it is launched. */ void setFixedRotationLaunchingApp(@NonNull ActivityRecord r, @Rotation int rotation) { final WindowToken prevRotatedLaunchingApp = mFixedRotationLaunchingApp; final ActivityRecord prevRotatedLaunchingApp = mFixedRotationLaunchingApp; if (prevRotatedLaunchingApp == r && r.getWindowConfiguration().getRotation() == rotation) { // The given launching app and target rotation are the same as the existing ones. Loading @@ -1791,8 +1791,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (prevRotatedLaunchingApp != null && prevRotatedLaunchingApp.getWindowConfiguration().getRotation() == rotation // It is animating so we can expect there will have a transition callback. && (prevRotatedLaunchingApp.isAnimating(TRANSITION | PARENTS) || mTransitionController.inTransition(prevRotatedLaunchingApp))) { && (prevRotatedLaunchingApp.isInTransition())) { // It may be the case that multiple activities launch consecutively. Because their // rotation are the same, the transformed state can be shared to avoid duplicating // the heavy operations. This also benefits that the states of multiple activities Loading Loading @@ -6468,7 +6467,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Different tasks won't be in one activity transition animation. return; } if (task.isAppTransitioning()) { if (task.getActivity(ActivityRecord::isInTransition) != null) { return; // Continue to update orientation because the transition of the top rotated // launching activity is done. Loading
services/core/java/com/android/server/wm/TaskFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -2496,7 +2496,7 @@ class TaskFragment extends WindowContainer<WindowContainer> { if (!hasChild()) { return false; } return isExitAnimationRunningSelfOrChild() || inTransition(); return isExitAnimationRunningSelfOrChild(); } @Override Loading
services/core/java/com/android/server/wm/WindowContainer.java +16 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import static com.android.server.wm.IdentifierProto.TITLE; import static com.android.server.wm.IdentifierProto.USER_ID; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_ALL; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION; Loading Loading @@ -1158,6 +1159,19 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< return getActivity(app -> app.isAnimating(PARENTS | TRANSITION)) != null; } /** * Returns {@code true} if self or the parent container of the window is in transition, e.g. * the app or recents transition. This method is only used when legacy and shell transition * have the same condition to check the animation state. */ boolean inTransitionSelfOrParent() { if (!mTransitionController.isShellTransitionsEnabled()) { return isAnimating(PARENTS | TRANSITION, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS); } return inTransition(); } /** * @return Whether our own container running an animation at the moment. */ Loading @@ -1180,7 +1194,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< if (!mTransitionController.isShellTransitionsEnabled()) { return isAnimating(TRANSITION | CHILDREN, WindowState.EXIT_ANIMATING_TYPES); } if (mTransitionController.isCollecting(this)) { // Only check leaf containers because inTransition() includes parent. if (mChildren.isEmpty() && inTransition()) { return true; } Loading