summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2024-11-01 17:30:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-01 17:30:56 +0000
commit5e4f136bd493f35002c2228e88cb33d5fe78cade (patch)
tree1f16b51a06836fc2c2b26323d48ff707323df8ce
parent21431b988ababa52d8fab0e13b1594ebb1f3120c (diff)
parent1cbc2bdc2589ce3184e124414509cb0320f1dfd4 (diff)
Merge "3a/ Improve logging around transitions" into main
-rw-r--r--core/java/android/window/WindowContainerTransaction.java26
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTransition.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/TransitionAnimationHelper.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java37
-rw-r--r--services/core/java/com/android/server/wm/Task.java6
-rw-r--r--services/core/java/com/android/server/wm/Transition.java66
-rw-r--r--services/core/java/com/android/server/wm/WindowContainer.java3
9 files changed, 109 insertions, 37 deletions
diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java
index 34abf3114925..3fe63ab17248 100644
--- a/core/java/android/window/WindowContainerTransaction.java
+++ b/core/java/android/window/WindowContainerTransaction.java
@@ -1867,27 +1867,33 @@ public final class WindowContainerTransaction implements Parcelable {
switch (type) {
case HIERARCHY_OP_TYPE_REPARENT: return "reparent";
case HIERARCHY_OP_TYPE_REORDER: return "reorder";
- case HIERARCHY_OP_TYPE_CHILDREN_TASKS_REPARENT: return "ChildrenTasksReparent";
- case HIERARCHY_OP_TYPE_SET_LAUNCH_ROOT: return "SetLaunchRoot";
- case HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS: return "SetAdjacentRoot";
- case HIERARCHY_OP_TYPE_LAUNCH_TASK: return "LaunchTask";
- case HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT: return "SetAdjacentFlagRoot";
+ case HIERARCHY_OP_TYPE_CHILDREN_TASKS_REPARENT: return "childrenTasksReparent";
+ case HIERARCHY_OP_TYPE_SET_LAUNCH_ROOT: return "setLaunchRoot";
+ case HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS: return "setAdjacentRoot";
+ case HIERARCHY_OP_TYPE_LAUNCH_TASK: return "launchTask";
+ case HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT: return "setAdjacentFlagRoot";
case HIERARCHY_OP_TYPE_SET_DISABLE_LAUNCH_ADJACENT:
- return "SetDisableLaunchAdjacent";
- case HIERARCHY_OP_TYPE_PENDING_INTENT: return "PendingIntent";
- case HIERARCHY_OP_TYPE_START_SHORTCUT: return "StartShortcut";
+ return "setDisableLaunchAdjacent";
+ case HIERARCHY_OP_TYPE_PENDING_INTENT: return "pendingIntent";
+ case HIERARCHY_OP_TYPE_START_SHORTCUT: return "startShortcut";
+ case HIERARCHY_OP_TYPE_RESTORE_TRANSIENT_ORDER: return "restoreTransientOrder";
case HIERARCHY_OP_TYPE_ADD_INSETS_FRAME_PROVIDER: return "addInsetsFrameProvider";
case HIERARCHY_OP_TYPE_REMOVE_INSETS_FRAME_PROVIDER:
return "removeInsetsFrameProvider";
case HIERARCHY_OP_TYPE_SET_ALWAYS_ON_TOP: return "setAlwaysOnTop";
- case HIERARCHY_OP_TYPE_REMOVE_TASK: return "RemoveTask";
+ case HIERARCHY_OP_TYPE_REMOVE_TASK: return "removeTask";
case HIERARCHY_OP_TYPE_FINISH_ACTIVITY: return "finishActivity";
- case HIERARCHY_OP_TYPE_CLEAR_ADJACENT_ROOTS: return "ClearAdjacentRoot";
+ case HIERARCHY_OP_TYPE_CLEAR_ADJACENT_ROOTS: return "clearAdjacentRoot";
case HIERARCHY_OP_TYPE_SET_REPARENT_LEAF_TASK_IF_RELAUNCH:
return "setReparentLeafTaskIfRelaunch";
case HIERARCHY_OP_TYPE_ADD_TASK_FRAGMENT_OPERATION:
return "addTaskFragmentOperation";
+ case HIERARCHY_OP_TYPE_MOVE_PIP_ACTIVITY_TO_PINNED_TASK:
+ return "movePipActivityToPinnedTask";
+ case HIERARCHY_OP_TYPE_SET_IS_TRIMMABLE: return "setIsTrimmable";
+ case HIERARCHY_OP_TYPE_RESTORE_BACK_NAVIGATION: return "restoreBackNav";
case HIERARCHY_OP_TYPE_SET_EXCLUDE_INSETS_TYPES: return "setExcludeInsetsTypes";
+ case HIERARCHY_OP_TYPE_SET_KEYGUARD_STATE: return "setKeyguardState";
default: return "HOP(" + type + ")";
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 9aa5066fc76c..28b91c6cb812 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -30,7 +30,6 @@ import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
-import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static com.android.wm.shell.pip.PipAnimationController.ANIM_TYPE_ALPHA;
@@ -45,6 +44,7 @@ import static com.android.wm.shell.transition.Transitions.TRANSIT_CLEANUP_PIP_EX
import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP;
import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP_TO_SPLIT;
import static com.android.wm.shell.transition.Transitions.TRANSIT_REMOVE_PIP;
+import static com.android.wm.shell.transition.Transitions.transitTypeToString;
import android.annotation.IntDef;
import android.app.ActivityManager;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTransition.java
index affa6aaa5d07..d3ae411469cc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTransition.java
@@ -23,7 +23,6 @@ import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.view.WindowManager.TRANSIT_TO_BACK;
-import static android.view.WindowManager.transitTypeToString;
import static com.android.wm.shell.common.pip.PipMenuController.ALPHA_NO_CHANGE;
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_LEAVE_PIP;
@@ -35,6 +34,7 @@ import static com.android.wm.shell.pip.PipTransitionState.EXITING_PIP;
import static com.android.wm.shell.pip.PipTransitionState.UNDEFINED;
import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP;
import static com.android.wm.shell.transition.Transitions.TRANSIT_REMOVE_PIP;
+import static com.android.wm.shell.transition.Transitions.transitTypeToString;
import android.animation.AnimationHandler;
import android.animation.Animator;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index 839bb4e7a766..cc0e1df115c2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -30,7 +30,6 @@ import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
-import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REORDER;
@@ -73,6 +72,7 @@ import static com.android.wm.shell.splitscreen.SplitScreenController.exitReasonT
import static com.android.wm.shell.transition.MixedTransitionHelper.getPipReplacingChange;
import static com.android.wm.shell.transition.Transitions.TRANSIT_SPLIT_SCREEN_OPEN_TO_SIDE;
import static com.android.wm.shell.transition.Transitions.TRANSIT_SPLIT_SCREEN_PAIR_OPEN;
+import static com.android.wm.shell.transition.Transitions.transitTypeToString;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/TransitionAnimationHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/TransitionAnimationHelper.java
index a27c14bda15a..4feb4753096e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/TransitionAnimationHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/TransitionAnimationHelper.java
@@ -24,7 +24,6 @@ import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
-import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAGS_IS_NON_APP_WINDOW;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
@@ -34,6 +33,7 @@ import static com.android.internal.policy.TransitionAnimation.WALLPAPER_TRANSITI
import static com.android.internal.policy.TransitionAnimation.WALLPAPER_TRANSITION_INTRA_CLOSE;
import static com.android.internal.policy.TransitionAnimation.WALLPAPER_TRANSITION_INTRA_OPEN;
import static com.android.internal.policy.TransitionAnimation.WALLPAPER_TRANSITION_OPEN;
+import static com.android.wm.shell.transition.Transitions.transitTypeToString;
import android.annotation.ColorInt;
import android.annotation.NonNull;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
index 7c9cd0862b69..1d456aed5f4d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
@@ -29,7 +29,6 @@ import static android.view.WindowManager.TRANSIT_SLEEP;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.fixScale;
-import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAGS_IS_NON_APP_WINDOW;
import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
@@ -725,7 +724,7 @@ public class Transitions implements RemoteCallable<Transitions>,
@NonNull SurfaceControl.Transaction t, @NonNull SurfaceControl.Transaction finishT) {
info.setUnreleasedWarningCallSiteForAllSurfaces("Transitions.onTransitionReady");
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "onTransitionReady (#%d) %s: %s",
- info.getDebugId(), transitionToken, info);
+ info.getDebugId(), transitionToken, info.toString(" " /* prefix */));
int activeIdx = findByToken(mPendingTransitions, transitionToken);
if (activeIdx < 0) {
final ActiveTransition existing = mKnownTransitions.get(transitionToken);
@@ -1847,6 +1846,40 @@ public class Transitions implements RemoteCallable<Transitions>,
}
}
+ /**
+ * Like WindowManager#transitTypeToString(), but also covers known custom transition types as
+ * well.
+ */
+ public static String transitTypeToString(int transitType) {
+ if (transitType < TRANSIT_FIRST_CUSTOM) {
+ return WindowManager.transitTypeToString(transitType);
+ }
+
+ String typeStr = switch (transitType) {
+ case TRANSIT_EXIT_PIP -> "EXIT_PIP";
+ case TRANSIT_EXIT_PIP_TO_SPLIT -> "EXIT_PIP_TO_SPLIT";
+ case TRANSIT_REMOVE_PIP -> "REMOVE_PIP";
+ case TRANSIT_SPLIT_SCREEN_PAIR_OPEN -> "SPLIT_SCREEN_PAIR_OPEN";
+ case TRANSIT_SPLIT_SCREEN_OPEN_TO_SIDE -> "SPLIT_SCREEN_OPEN_TO_SIDE";
+ case TRANSIT_SPLIT_DISMISS_SNAP -> "SPLIT_DISMISS_SNAP";
+ case TRANSIT_SPLIT_DISMISS -> "SPLIT_DISMISS";
+ case TRANSIT_MAXIMIZE -> "MAXIMIZE";
+ case TRANSIT_RESTORE_FROM_MAXIMIZE -> "RESTORE_FROM_MAXIMIZE";
+ case TRANSIT_DESKTOP_MODE_START_DRAG_TO_DESKTOP -> "DESKTOP_MODE_START_DRAG_TO_DESKTOP";
+ case TRANSIT_DESKTOP_MODE_END_DRAG_TO_DESKTOP -> "DESKTOP_MODE_END_DRAG_TO_DESKTOP";
+ case TRANSIT_DESKTOP_MODE_CANCEL_DRAG_TO_DESKTOP ->
+ "DESKTOP_MODE_CANCEL_DRAG_TO_DESKTOP";
+ case TRANSIT_DESKTOP_MODE_TOGGLE_RESIZE -> "DESKTOP_MODE_TOGGLE_RESIZE";
+ case TRANSIT_RESIZE_PIP -> "RESIZE_PIP";
+ case TRANSIT_TASK_FRAGMENT_DRAG_RESIZE -> "TASK_FRAGMENT_DRAG_RESIZE";
+ case TRANSIT_SPLIT_PASSTHROUGH -> "SPLIT_PASSTHROUGH";
+ case TRANSIT_CLEANUP_PIP_EXIT -> "CLEANUP_PIP_EXIT";
+ case TRANSIT_MINIMIZE -> "MINIMIZE";
+ default -> "";
+ };
+ return typeStr + "(FIRST_CUSTOM+" + (transitType - TRANSIT_FIRST_CUSTOM) + ")";
+ }
+
private static boolean getShellTransitEnabled() {
try {
if (AppGlobals.getPackageManager().hasSystemFeature(
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 8aa0530d3bc1..8986750d3c2e 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -3917,8 +3917,10 @@ class Task extends TaskFragment {
sb.append(affinityIntent.getComponent().flattenToShortString());
}
sb.append(" isResizeable=").append(isResizeable());
- sb.append(" minWidth=").append(mMinWidth);
- sb.append(" minHeight=").append(mMinHeight);
+ if (mMinWidth != INVALID_MIN_SIZE || mMinHeight != INVALID_MIN_SIZE) {
+ sb.append(" minWidth=").append(mMinWidth);
+ sb.append(" minHeight=").append(mMinHeight);
+ }
sb.append('}');
return stringName = sb.toString();
}
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index fc4660061c55..454e43120ede 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -237,15 +237,16 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
private final ArraySet<WindowToken> mVisibleAtTransitionEndTokens = new ArraySet<>();
/**
- * Set of transient activities (lifecycle initially tied to this transition) and their
+ * Map of transient activities (lifecycle initially tied to this transition) to their
* restore-below tasks.
*/
private ArrayMap<ActivityRecord, Task> mTransientLaunches = null;
/**
* The tasks that may be occluded by the transient activity. Assume the task stack is
- * [Home, A(opaque), B(opaque), C(translucent)] (bottom to top), then A is the restore-below
- * task, and [B, C] are the transient-hide tasks.
+ * [Home, A(opaque), B(opaque), C(translucent)] (bottom to top), and Home is started in a
+ * transient-launch activity, then A is the restore-below task, and [B, C] are the
+ * transient-hide tasks.
*/
private ArrayList<Task> mTransientHideTasks;
@@ -401,18 +402,26 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
mTransientLaunches.put(activity, restoreBelow);
setTransientLaunchToChanges(activity);
- final Task transientRootTask = activity.getRootTask();
+ final int restoreBelowTaskId = restoreBelow != null ? restoreBelow.mTaskId : -1;
+ ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS, "Transition %d: Set %s as "
+ + "transient-launch restoreBelowTaskId=%d", mSyncId, activity, restoreBelowTaskId);
+
+ final Task transientLaunchRootTask = activity.getRootTask();
final WindowContainer<?> parent = restoreBelow != null ? restoreBelow.getParent()
- : (transientRootTask != null ? transientRootTask.getParent() : null);
+ : (transientLaunchRootTask != null ? transientLaunchRootTask.getParent() : null);
if (parent != null) {
// Collect all visible tasks which can be occluded by the transient activity to
// make sure they are in the participants so their visibilities can be updated when
// finishing transition.
+ // Note: This currently assumes that the parent is a DA containing the full set of
+ // visible tasks
parent.forAllTasks(t -> {
// Skip transient-launch task
- if (t == transientRootTask) return false;
+ if (t == transientLaunchRootTask) return false;
if (t.isVisibleRequested() && !t.isAlwaysOnTop()) {
if (t.isRootTask()) {
+ ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS,
+ " transient hide: taskId=%d", t.mTaskId);
mTransientHideTasks.add(t);
}
if (t.isLeafTask()) {
@@ -442,9 +451,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
// the gesture threshold.
activity.getTask().setCanAffectSystemUiFlags(false);
}
-
- ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS, "Transition %d: Set %s as "
- + "transient-launch", mSyncId, activity);
}
/** @return whether `wc` is a descendent of a transient-hide window. */
@@ -462,6 +468,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
/** Returns {@code true} if the task should keep visible if this is a transient transition. */
boolean isTransientVisible(@NonNull Task task) {
if (mTransientLaunches == null) return false;
+
+ // Check if all the transient-launch activities are occluded
int occludedCount = 0;
final int numTransient = mTransientLaunches.size();
for (int i = numTransient - 1; i >= 0; --i) {
@@ -486,6 +494,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
// Let transient-hide activities pause before transition is finished.
return false;
}
+
+ // If this task is currently transient-hide, then keep it visible
return isInTransientHide(task);
}
@@ -608,7 +618,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
/**
- * Only set flag to the parent tasks and activity itself.
+ * Sets the FLAG_TRANSIENT_LAUNCH flag to all changes associated with the given activity
+ * container and parent tasks.
*/
private void setTransientLaunchToChanges(@NonNull WindowContainer wc) {
for (WindowContainer curr = wc; curr != null && mChanges.containsKey(curr);
@@ -774,7 +785,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
// Only look at tasks, taskfragments, or activities
if (wc.asTaskFragment() == null && wc.asActivityRecord() == null) return;
if (!isInTransientHide(wc)) return;
- info.mFlags |= ChangeInfo.FLAG_ABOVE_TRANSIENT_LAUNCH;
+ info.mFlags |= ChangeInfo.FLAG_TRANSIENT_HIDE;
}
private void recordDisplay(DisplayContent dc) {
@@ -2448,6 +2459,13 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
sb.append(" type=" + transitTypeToString(mType));
sb.append(" flags=0x" + Integer.toHexString(mFlags));
sb.append(" overrideAnimOptions=" + mOverrideOptions);
+ if (!mChanges.isEmpty()) {
+ sb.append(" c=[");
+ for (int i = 0; i < mChanges.size(); i++) {
+ sb.append("\n").append(" ").append(mChanges.valueAt(i).toString());
+ }
+ sb.append("\n]\n");
+ }
sb.append('}');
return sb.toString();
}
@@ -3396,8 +3414,14 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
* seamless rotation. This is currently only used by DisplayContent during fixed-rotation.
*/
private static final int FLAG_SEAMLESS_ROTATION = 1;
+ /**
+ * Identifies the associated WindowContainer as a transient-launch task or activity.
+ */
private static final int FLAG_TRANSIENT_LAUNCH = 2;
- private static final int FLAG_ABOVE_TRANSIENT_LAUNCH = 4;
+ /**
+ * Identifies the associated WindowContainer as a transient-hide task or activity.
+ */
+ private static final int FLAG_TRANSIENT_HIDE = 4;
/** This container explicitly requested no-animation (usually Activity level). */
private static final int FLAG_CHANGE_NO_ANIMATION = 0x8;
@@ -3429,7 +3453,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
FLAG_NONE,
FLAG_SEAMLESS_ROTATION,
FLAG_TRANSIENT_LAUNCH,
- FLAG_ABOVE_TRANSIENT_LAUNCH,
+ FLAG_TRANSIENT_HIDE,
FLAG_CHANGE_NO_ANIMATION,
FLAG_CHANGE_YES_ANIMATION,
FLAG_CHANGE_MOVED_TO_TOP,
@@ -3438,7 +3462,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
FLAG_BELOW_BACK_GESTURE_ANIMATION
})
@Retention(RetentionPolicy.SOURCE)
- @interface Flag {}
+ @interface ChangeInfoFlag {}
@NonNull final WindowContainer mContainer;
/**
@@ -3467,7 +3491,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
@ActivityInfo.Config int mKnownConfigChanges;
/** Extra information about this change. */
- @Flag int mFlags = FLAG_NONE;
+ @ChangeInfoFlag int mFlags = FLAG_NONE;
/** Snapshot surface and luma, if relevant. */
SurfaceControl mSnapshot;
@@ -3502,14 +3526,20 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
@Override
public String toString() {
- return mContainer.toString();
+ StringBuilder sb = new StringBuilder(64);
+ sb.append("ChangeInfo{");
+ sb.append(Integer.toHexString(System.identityHashCode(this)));
+ sb.append(" container=").append(mContainer);
+ sb.append(" flags=0x").append(Integer.toHexString(mFlags));
+ sb.append('}');
+ return sb.toString();
}
boolean hasChanged() {
final boolean currVisible = mContainer.isVisibleRequested();
// the task including transient launch must promote to root task
if (currVisible && ((mFlags & ChangeInfo.FLAG_TRANSIENT_LAUNCH) != 0
- || (mFlags & ChangeInfo.FLAG_ABOVE_TRANSIENT_LAUNCH) != 0)
+ || (mFlags & ChangeInfo.FLAG_TRANSIENT_HIDE) != 0)
|| (mFlags & ChangeInfo.FLAG_BACK_GESTURE_ANIMATION) != 0
|| (mFlags & ChangeInfo.FLAG_BELOW_BACK_GESTURE_ANIMATION) != 0) {
return true;
@@ -3530,7 +3560,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
@TransitionInfo.TransitionMode
int getTransitMode(@NonNull WindowContainer wc) {
- if ((mFlags & ChangeInfo.FLAG_ABOVE_TRANSIENT_LAUNCH) != 0) {
+ if ((mFlags & ChangeInfo.FLAG_TRANSIENT_HIDE) != 0) {
return mExistenceChanged ? TRANSIT_CLOSE : TRANSIT_TO_BACK;
}
if ((mFlags & ChangeInfo.FLAG_BELOW_BACK_GESTURE_ANIMATION) != 0) {
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index 552584222711..e0c473de0f33 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -2121,7 +2121,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
}
/**
- * For all tasks at or below this container call the callback.
+ * Calls the given {@param callback} for all tasks in depth-first top-down z-order at or below
+ * this container.
*
* @param callback Calls the {@link ToBooleanFunction#apply} method for each task found and
* stops the search if {@link ToBooleanFunction#apply} returns {@code true}.