Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd582575 authored by Evan Rosky's avatar Evan Rosky
Browse files

Maintain relative order of changes during CHANGE transits

Previously there was a specific fix for ordering during
CHANGE transit. However, it was too broad and caused order
to reverse for TO_BACK transitions.

This CL changes the logic a little to just put all changes
into the same z-order "strata" if the overall transition
isn't an open or close type. This maintains relative ordering
instead of trying to make assumptions.

Bug: 340128968
Bug: 283076194
Test: go "back" from one task to another via moveToBack
      (example is back from wallpaper settings to settings
       on a non-AE device).
Change-Id: I9d78062bd401893ec9a241ce72fb182040d9f06a
parent d97268ac
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import static android.view.WindowManager.fixScale;
import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED;
import static android.window.TransitionInfo.FLAG_IS_BEHIND_STARTING_WINDOW;
import static android.window.TransitionInfo.FLAG_IS_OCCLUDED;
import static android.window.TransitionInfo.FLAG_MOVED_TO_TOP;
import static android.window.TransitionInfo.FLAG_NO_ANIMATION;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;

@@ -559,15 +558,15 @@ public class Transitions implements RemoteCallable<Transitions>,
        final int mode = change.getMode();
        // Put all the OPEN/SHOW on top
        if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
            if (isOpening
                    // This is for when an activity launches while a different transition is
                    // collecting.
                    || change.hasFlags(FLAG_MOVED_TO_TOP)) {
            if (isOpening) {
                // put on top
                return zSplitLine + numChanges - i;
            } else {
            } else if (isClosing) {
                // put on bottom
                return zSplitLine - i;
            } else {
                // maintain relative ordering (put all changes in the animating layer)
                return zSplitLine + numChanges - i;
            }
        } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
            if (isOpening) {