Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +19 −2 Original line number Original line Diff line number Diff line Loading @@ -1459,8 +1459,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } } moveToTop = change.hasFlags(FLAG_MOVED_TO_TOP); moveToTop = change.hasFlags(FLAG_MOVED_TO_TOP); info.getChanges().remove(j); info.getChanges().remove(j); } else if ((openShowWallpaper && change.hasFlags(FLAG_IS_WALLPAPER)) } else if ((openShowWallpaper && change.hasFlags(FLAG_IS_WALLPAPER))) { || !change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { info.getChanges().remove(j); info.getChanges().remove(j); } else if (!mergePredictive && TransitionUtil.isClosingMode(change.getMode())) { } else if (!mergePredictive && TransitionUtil.isClosingMode(change.getMode())) { mergePredictive = true; mergePredictive = true; Loading @@ -1483,6 +1482,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (moveToTop) { if (moveToTop) { change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); } } } else if (Flags.unifyBackNavigationTransition() && 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 // if it is closing. continue; } } info.getChanges().add(i, change); info.getChanges().add(i, change); } } Loading Loading @@ -1814,6 +1820,17 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont return findComponentName(change) != null || findTaskId(change) != INVALID_TASK_ID; return findComponentName(change) != null || findTaskId(change) != INVALID_TASK_ID; } } private static boolean isCloseChangeExist(TransitionInfo info, TransitionInfo.Change change) { for (int j = info.getChanges().size() - 1; j >= 0; --j) { final TransitionInfo.Change current = info.getChanges().get(j); if (TransitionUtil.isClosingMode(current.getMode()) && change.getLeash().isSameSurface(current.getLeash())) { return true; } } return false; } // Record the latest back gesture happen on which task. // Record the latest back gesture happen on which task. static class BackTransitionObserver implements Transitions.TransitionObserver { static class BackTransitionObserver implements Transitions.TransitionObserver { int mFocusedTaskId = INVALID_TASK_ID; int mFocusedTaskId = INVALID_TASK_ID; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +19 −2 Original line number Original line Diff line number Diff line Loading @@ -1459,8 +1459,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } } moveToTop = change.hasFlags(FLAG_MOVED_TO_TOP); moveToTop = change.hasFlags(FLAG_MOVED_TO_TOP); info.getChanges().remove(j); info.getChanges().remove(j); } else if ((openShowWallpaper && change.hasFlags(FLAG_IS_WALLPAPER)) } else if ((openShowWallpaper && change.hasFlags(FLAG_IS_WALLPAPER))) { || !change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { info.getChanges().remove(j); info.getChanges().remove(j); } else if (!mergePredictive && TransitionUtil.isClosingMode(change.getMode())) { } else if (!mergePredictive && TransitionUtil.isClosingMode(change.getMode())) { mergePredictive = true; mergePredictive = true; Loading @@ -1483,6 +1482,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont if (moveToTop) { if (moveToTop) { change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); change.setFlags(change.getFlags() | FLAG_MOVED_TO_TOP); } } } else if (Flags.unifyBackNavigationTransition() && 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 // if it is closing. continue; } } info.getChanges().add(i, change); info.getChanges().add(i, change); } } Loading Loading @@ -1814,6 +1820,17 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont return findComponentName(change) != null || findTaskId(change) != INVALID_TASK_ID; return findComponentName(change) != null || findTaskId(change) != INVALID_TASK_ID; } } private static boolean isCloseChangeExist(TransitionInfo info, TransitionInfo.Change change) { for (int j = info.getChanges().size() - 1; j >= 0; --j) { final TransitionInfo.Change current = info.getChanges().get(j); if (TransitionUtil.isClosingMode(current.getMode()) && change.getLeash().isSameSurface(current.getLeash())) { return true; } } return false; } // Record the latest back gesture happen on which task. // Record the latest back gesture happen on which task. static class BackTransitionObserver implements Transitions.TransitionObserver { static class BackTransitionObserver implements Transitions.TransitionObserver { int mFocusedTaskId = INVALID_TASK_ID; int mFocusedTaskId = INVALID_TASK_ID; Loading