Put the change to top if it has FLAG_MOVED_TO_TOP

This CL also refines the debug strings of TRANSIT_TO_FRONT and
TRANSIT_TO_BACK to make the naming rule consistent.

Fix: 283076194
Test: Swipe to home from a landscape app and quickly open it again. See
      if the home screen is on top of the app during the transition.
Change-Id: Ic8dba8c19e2447d8192898642d8499dec2a344c3
This commit is contained in:
Tiger
2023-05-31 21:42:25 +08:00
parent 3816d9b959
commit 8efc7aea52
2 changed files with 7 additions and 3 deletions

View File

@@ -424,8 +424,8 @@ public final class TransitionInfo implements Parcelable {
case TRANSIT_NONE: return "NONE";
case TRANSIT_OPEN: return "OPEN";
case TRANSIT_CLOSE: return "CLOSE";
case TRANSIT_TO_FRONT: return "SHOW";
case TRANSIT_TO_BACK: return "HIDE";
case TRANSIT_TO_FRONT: return "TO_FRONT";
case TRANSIT_TO_BACK: return "TO_BACK";
case TRANSIT_CHANGE: return "CHANGE";
default: return "<unknown:" + mode + ">";
}

View File

@@ -29,6 +29,7 @@ import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.fixScale;
import static android.window.TransitionInfo.FLAG_IS_OCCLUDED;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
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;
@@ -554,7 +555,10 @@ public class Transitions implements RemoteCallable<Transitions>,
layer = -zSplitLine - i;
}
} else if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
if (isOpening) {
if (isOpening
// This is for when an activity launches while a different transition is
// collecting.
|| change.hasFlags(FLAG_MOVED_TO_TOP)) {
// put on top
layer = zSplitLine + numChanges - i;
} else {