Loading core/java/android/window/flags/windowing_frontend.aconfig +0 −8 Original line number Diff line number Diff line Loading @@ -265,14 +265,6 @@ flag { is_exported: true } flag { name: "unify_back_navigation_transition" namespace: "windowing_frontend" description: "Always create predictive back transition when start back gesture animation" bug: "372230928" is_fixed_read_only: true } flag { name: "predictive_back_system_override_callback" namespace: "windowing_frontend" Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +3 −6 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import static android.window.TransitionInfo.FLAG_SHOW_WALLPAPER; import static com.android.internal.jank.InteractionJankMonitor.CUJ_PREDICTIVE_BACK_HOME; import static com.android.systemui.Flags.predictiveBackDelayWmTransition; import static com.android.window.flags.Flags.unifyBackNavigationTransition; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BACK_PREVIEW; import android.annotation.NonNull; Loading Loading @@ -1365,7 +1364,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (transition == mClosePrepareTransition && aborted) { mClosePrepareTransition = null; applyFinishOpenTransition(); } else if (!aborted && unifyBackNavigationTransition()) { } else if (!aborted) { // Since the closing target participates in the predictive back transition, the // merged transition must be applied with the first transition to ensure a seamless // animation. Loading Loading @@ -1474,8 +1473,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (moveToTop) { change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); } } else if (Flags.unifyBackNavigationTransition() && change.hasFlags(FLAG_BACK_GESTURE_ANIMATED) } else if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED) && change.getMode() == TRANSIT_CHANGE && isCloseChangeExist(info, change)) { // This is the original top target, don't add it into current transition Loading Loading @@ -1756,8 +1754,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } private static boolean checkTakeoverFlags() { return TransitionAnimator.Companion.longLivedReturnAnimationsEnabled() && Flags.unifyBackNavigationTransition(); return TransitionAnimator.Companion.longLivedReturnAnimationsEnabled(); } } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -557,8 +557,7 @@ public class BackAnimationControllerTest extends ShellTestCase { } @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, com.android.window.flags.Flags.FLAG_UNIFY_BACK_NAVIGATION_TRANSITION}) com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) @Test public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); Loading services/core/java/com/android/server/wm/BackNavigationController.java +33 −56 Original line number Diff line number Diff line Loading @@ -897,7 +897,6 @@ class BackNavigationController { changedActivity = next; } } if (Flags.unifyBackNavigationTransition()) { for (int i = mAnimationHandler.mOpenAnimAdaptor.mAdaptors.length - 1; i >= 0; --i) { collectAnimatableTarget(transition, switchType, mAnimationHandler.mOpenAnimAdaptor.mAdaptors[i].mTarget, Loading @@ -905,7 +904,6 @@ class BackNavigationController { } collectAnimatableTarget(transition, switchType, mAnimationHandler.mCloseAdaptor.mTarget, true /* isTop */); } if (collectTask && switchType == AnimationHandler.TASK_SWITCH) { final Task topTask = mAnimationHandler.mOpenAnimAdaptor.mAdaptors[0].getTopTask(); if (topTask != null) { Loading Loading @@ -1884,7 +1882,6 @@ class BackNavigationController { private Transition prepareTransitionIfNeeded(ActivityRecord[] visibleOpenActivities, WindowContainer promoteToClose, WindowContainer[] promoteToOpen) { if (Flags.unifyBackNavigationTransition()) { if (mCloseTarget.asWindowState() != null) { return null; } Loading Loading @@ -1913,10 +1910,6 @@ class BackNavigationController { null /* displayChange */); prepareOpen.setReady(mCloseTarget, true); return prepareOpen; } else if (mSnapshot == null) { return setLaunchBehind(visibleOpenActivities); } return null; } /** Loading Loading @@ -2101,7 +2094,7 @@ class BackNavigationController { return false; } private static Transition setLaunchBehind(@NonNull ActivityRecord[] activities) { private static void setLaunchBehind(@NonNull ActivityRecord[] activities) { final ArrayList<ActivityRecord> affects = new ArrayList<>(); for (int i = activities.length - 1; i >= 0; --i) { final ActivityRecord activity = activities[i]; Loading @@ -2111,13 +2104,9 @@ class BackNavigationController { affects.add(activity); } if (affects.isEmpty()) { return null; return; } final TransitionController tc = activities[0].mTransitionController; final Transition prepareOpen = !Flags.unifyBackNavigationTransition() && !tc.isCollecting() ? tc.createTransition(TRANSIT_PREPARE_BACK_NAVIGATION) : null; for (int i = affects.size() - 1; i >= 0; --i) { final ActivityRecord activity = affects.get(i); activity.mTransitionController.mSnapshotController Loading @@ -2133,18 +2122,6 @@ class BackNavigationController { activity.makeVisibleIfNeeded(null /* starting */, true /* notifyToClient */); } } if (prepareOpen != null) { if (prepareOpen.hasChanges()) { tc.requestStartTransition(prepareOpen, null /*startTask */, null /* remoteTransition */, null /* displayChange */); prepareOpen.setReady(affects.get(0), true); return prepareOpen; } else { prepareOpen.abort(); } } return null; } private static void restoreLaunchBehind(@NonNull ActivityRecord activity, boolean cancel, Loading Loading
core/java/android/window/flags/windowing_frontend.aconfig +0 −8 Original line number Diff line number Diff line Loading @@ -265,14 +265,6 @@ flag { is_exported: true } flag { name: "unify_back_navigation_transition" namespace: "windowing_frontend" description: "Always create predictive back transition when start back gesture animation" bug: "372230928" is_fixed_read_only: true } flag { name: "predictive_back_system_override_callback" namespace: "windowing_frontend" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +3 −6 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import static android.window.TransitionInfo.FLAG_SHOW_WALLPAPER; import static com.android.internal.jank.InteractionJankMonitor.CUJ_PREDICTIVE_BACK_HOME; import static com.android.systemui.Flags.predictiveBackDelayWmTransition; import static com.android.window.flags.Flags.unifyBackNavigationTransition; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BACK_PREVIEW; import android.annotation.NonNull; Loading Loading @@ -1365,7 +1364,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (transition == mClosePrepareTransition && aborted) { mClosePrepareTransition = null; applyFinishOpenTransition(); } else if (!aborted && unifyBackNavigationTransition()) { } else if (!aborted) { // Since the closing target participates in the predictive back transition, the // merged transition must be applied with the first transition to ensure a seamless // animation. Loading Loading @@ -1474,8 +1473,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (moveToTop) { change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); } } else if (Flags.unifyBackNavigationTransition() && change.hasFlags(FLAG_BACK_GESTURE_ANIMATED) } else if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED) && change.getMode() == TRANSIT_CHANGE && isCloseChangeExist(info, change)) { // This is the original top target, don't add it into current transition Loading Loading @@ -1756,8 +1754,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } private static boolean checkTakeoverFlags() { return TransitionAnimator.Companion.longLivedReturnAnimationsEnabled() && Flags.unifyBackNavigationTransition(); return TransitionAnimator.Companion.longLivedReturnAnimationsEnabled(); } } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -557,8 +557,7 @@ public class BackAnimationControllerTest extends ShellTestCase { } @EnableFlags({com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED, com.android.window.flags.Flags.FLAG_UNIFY_BACK_NAVIGATION_TRANSITION}) com.android.systemui.shared.Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LONG_LIVED}) @Test public void appCallback_receivesTakeoverHandler_whenAvailable() throws RemoteException { registerAnimation(BackNavigationInfo.TYPE_CROSS_TASK); Loading
services/core/java/com/android/server/wm/BackNavigationController.java +33 −56 Original line number Diff line number Diff line Loading @@ -897,7 +897,6 @@ class BackNavigationController { changedActivity = next; } } if (Flags.unifyBackNavigationTransition()) { for (int i = mAnimationHandler.mOpenAnimAdaptor.mAdaptors.length - 1; i >= 0; --i) { collectAnimatableTarget(transition, switchType, mAnimationHandler.mOpenAnimAdaptor.mAdaptors[i].mTarget, Loading @@ -905,7 +904,6 @@ class BackNavigationController { } collectAnimatableTarget(transition, switchType, mAnimationHandler.mCloseAdaptor.mTarget, true /* isTop */); } if (collectTask && switchType == AnimationHandler.TASK_SWITCH) { final Task topTask = mAnimationHandler.mOpenAnimAdaptor.mAdaptors[0].getTopTask(); if (topTask != null) { Loading Loading @@ -1884,7 +1882,6 @@ class BackNavigationController { private Transition prepareTransitionIfNeeded(ActivityRecord[] visibleOpenActivities, WindowContainer promoteToClose, WindowContainer[] promoteToOpen) { if (Flags.unifyBackNavigationTransition()) { if (mCloseTarget.asWindowState() != null) { return null; } Loading Loading @@ -1913,10 +1910,6 @@ class BackNavigationController { null /* displayChange */); prepareOpen.setReady(mCloseTarget, true); return prepareOpen; } else if (mSnapshot == null) { return setLaunchBehind(visibleOpenActivities); } return null; } /** Loading Loading @@ -2101,7 +2094,7 @@ class BackNavigationController { return false; } private static Transition setLaunchBehind(@NonNull ActivityRecord[] activities) { private static void setLaunchBehind(@NonNull ActivityRecord[] activities) { final ArrayList<ActivityRecord> affects = new ArrayList<>(); for (int i = activities.length - 1; i >= 0; --i) { final ActivityRecord activity = activities[i]; Loading @@ -2111,13 +2104,9 @@ class BackNavigationController { affects.add(activity); } if (affects.isEmpty()) { return null; return; } final TransitionController tc = activities[0].mTransitionController; final Transition prepareOpen = !Flags.unifyBackNavigationTransition() && !tc.isCollecting() ? tc.createTransition(TRANSIT_PREPARE_BACK_NAVIGATION) : null; for (int i = affects.size() - 1; i >= 0; --i) { final ActivityRecord activity = affects.get(i); activity.mTransitionController.mSnapshotController Loading @@ -2133,18 +2122,6 @@ class BackNavigationController { activity.makeVisibleIfNeeded(null /* starting */, true /* notifyToClient */); } } if (prepareOpen != null) { if (prepareOpen.hasChanges()) { tc.requestStartTransition(prepareOpen, null /*startTask */, null /* remoteTransition */, null /* displayChange */); prepareOpen.setReady(affects.get(0), true); return prepareOpen; } else { prepareOpen.abort(); } } return null; } private static void restoreLaunchBehind(@NonNull ActivityRecord activity, boolean cancel, Loading