Loading core/java/android/window/TransitionInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,18 @@ public final class TransitionInfo implements Parcelable { @Override public String toString() { return toString(""); } /** * Returns a string representation of this transition info. * @hide */ public String toString(@NonNull String prefix) { final boolean shouldPrettyPrint = !prefix.isEmpty() && !mChanges.isEmpty(); final String innerPrefix = shouldPrettyPrint ? prefix + " " : ""; final String changesLineStart = shouldPrettyPrint ? "\n" + prefix : ""; final String perChangeLineStart = shouldPrettyPrint ? "\n" + innerPrefix : ""; StringBuilder sb = new StringBuilder(); sb.append("{id=").append(mDebugId).append(" t=").append(transitTypeToString(mType)) .append(" f=0x").append(Integer.toHexString(mFlags)).append(" trk=").append(mTrack) Loading @@ -413,12 +425,15 @@ public final class TransitionInfo implements Parcelable { sb.append(mRoots.get(i).mDisplayId).append("@").append(mRoots.get(i).mOffset); } sb.append("] c=["); sb.append(perChangeLineStart); for (int i = 0; i < mChanges.size(); ++i) { if (i > 0) { sb.append(','); sb.append(perChangeLineStart); } sb.append(mChanges.get(i)); } sb.append(changesLineStart); sb.append("]}"); return sb.toString(); } Loading core/java/android/window/TransitionRequestInfo.java +40 −8 Original line number Diff line number Diff line Loading @@ -62,13 +62,16 @@ public final class TransitionRequestInfo implements Parcelable { /** The transition flags known at the time of the request. These may not be complete. */ private final int mFlags; /** This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ private final int mDebugId; /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition) { this(type, triggerTask, null /* pipTask */, remoteTransition, null /* displayChange */, 0 /* flags */); remoteTransition, null /* displayChange */, 0 /* flags */, -1 /* debugId */); } /** constructor override */ Loading @@ -78,16 +81,29 @@ public final class TransitionRequestInfo implements Parcelable { @Nullable RemoteTransition remoteTransition, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, null /* displayChange */, flags); remoteTransition, null /* displayChange */, flags, -1 /* debugId */); } /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, displayChange, flags, -1 /* debugId */); } /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable ActivityManager.RunningTaskInfo pipTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, displayChange, flags); this(type, triggerTask, pipTask, remoteTransition, displayChange, flags, -1 /* debugId */); } /** @hide */ Loading Loading @@ -270,7 +286,7 @@ public final class TransitionRequestInfo implements Parcelable { }; @DataClass.Generated( time = 1695667226050L, time = 1697564781403L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", inputSignatures = "private final int mDisplayId\nprivate @android.annotation.Nullable android.graphics.Rect mStartAbsBounds\nprivate @android.annotation.Nullable android.graphics.Rect mEndAbsBounds\nprivate int mStartRotation\nprivate int mEndRotation\nprivate boolean mPhysicalDisplayChanged\nclass DisplayChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)") Loading Loading @@ -318,6 +334,8 @@ public final class TransitionRequestInfo implements Parcelable { * (if size is changing). * @param flags * The transition flags known at the time of the request. These may not be complete. * @param debugId * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ @DataClass.Generated.Member public TransitionRequestInfo( Loading @@ -326,7 +344,8 @@ public final class TransitionRequestInfo implements Parcelable { @Nullable ActivityManager.RunningTaskInfo pipTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { int flags, int debugId) { this.mType = type; com.android.internal.util.AnnotationValidations.validate( WindowManager.TransitionType.class, null, mType); Loading @@ -335,6 +354,7 @@ public final class TransitionRequestInfo implements Parcelable { this.mRemoteTransition = remoteTransition; this.mDisplayChange = displayChange; this.mFlags = flags; this.mDebugId = debugId; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -391,6 +411,14 @@ public final class TransitionRequestInfo implements Parcelable { return mFlags; } /** * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ @DataClass.Generated.Member public int getDebugId() { return mDebugId; } /** * If non-null, the task containing the activity whose lifecycle change (start or * finish) has caused this transition to occur. Loading Loading @@ -443,7 +471,8 @@ public final class TransitionRequestInfo implements Parcelable { "pipTask = " + mPipTask + ", " + "remoteTransition = " + mRemoteTransition + ", " + "displayChange = " + mDisplayChange + ", " + "flags = " + mFlags + "flags = " + mFlags + ", " + "debugId = " + mDebugId + " }"; } Loading @@ -465,6 +494,7 @@ public final class TransitionRequestInfo implements Parcelable { if (mRemoteTransition != null) dest.writeTypedObject(mRemoteTransition, flags); if (mDisplayChange != null) dest.writeTypedObject(mDisplayChange, flags); dest.writeInt(mFlags); dest.writeInt(mDebugId); } @Override Loading @@ -485,6 +515,7 @@ public final class TransitionRequestInfo implements Parcelable { RemoteTransition remoteTransition = (flg & 0x8) == 0 ? null : (RemoteTransition) in.readTypedObject(RemoteTransition.CREATOR); TransitionRequestInfo.DisplayChange displayChange = (flg & 0x10) == 0 ? null : (TransitionRequestInfo.DisplayChange) in.readTypedObject(TransitionRequestInfo.DisplayChange.CREATOR); int flags = in.readInt(); int debugId = in.readInt(); this.mType = type; com.android.internal.util.AnnotationValidations.validate( Loading @@ -494,6 +525,7 @@ public final class TransitionRequestInfo implements Parcelable { this.mRemoteTransition = remoteTransition; this.mDisplayChange = displayChange; this.mFlags = flags; this.mDebugId = debugId; // onConstructed(); // You can define this method to get a callback } Loading @@ -513,10 +545,10 @@ public final class TransitionRequestInfo implements Parcelable { }; @DataClass.Generated( time = 1695667226088L, time = 1697564781438L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\nprivate final int mDebugId\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") @Deprecated private void __metadata() {} Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +3 −3 Original line number Diff line number Diff line Loading @@ -605,6 +605,7 @@ public abstract class WMShellBaseModule { @Provides static Transitions provideTransitions(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, ShellController shellController, ShellTaskOrganizer organizer, TransactionPool pool, Loading @@ -612,14 +613,13 @@ public abstract class WMShellBaseModule { @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler, @ShellAnimationThread ShellExecutor animExecutor, ShellCommandHandler shellCommandHandler, RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) { if (!context.getResources().getBoolean(R.bool.config_registerShellTransitionsOnInit)) { // TODO(b/238217847): Force override shell init if registration is disabled shellInit = new ShellInit(mainExecutor); } return new Transitions(context, shellInit, shellController, organizer, pool, displayController, mainExecutor, mainHandler, animExecutor, shellCommandHandler, return new Transitions(context, shellInit, shellCommandHandler, shellController, organizer, pool, displayController, mainExecutor, mainHandler, animExecutor, rootTaskDisplayAreaOrganizer); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/OneShotRemoteHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler { @NonNull Transitions.TransitionFinishCallback finishCallback) { if (mTransition != transition) return false; ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Using registered One-shot remote" + " transition %s for #%d.", mRemote, info.getDebugId()); + " transition %s for (#%d).", mRemote, info.getDebugId()); final IBinder.DeathRecipient remoteDied = () -> { Log.e(Transitions.TAG, "Remote transition died, finishing"); Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { } } } ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Delegate animation for #%d to %s", ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Delegate animation for (#%d) to %s", info.getDebugId(), pendingRemote); if (pendingRemote == null) return false; Loading Loading @@ -241,7 +241,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { if (remote == null) return null; mRequestedRemotes.put(transition, remote); ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "RemoteTransition directly requested" + " for %s: %s", transition, remote); + " for (#%d) %s: %s", request.getDebugId(), transition, remote); return new WindowContainerTransaction(); } Loading Loading
core/java/android/window/TransitionInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,18 @@ public final class TransitionInfo implements Parcelable { @Override public String toString() { return toString(""); } /** * Returns a string representation of this transition info. * @hide */ public String toString(@NonNull String prefix) { final boolean shouldPrettyPrint = !prefix.isEmpty() && !mChanges.isEmpty(); final String innerPrefix = shouldPrettyPrint ? prefix + " " : ""; final String changesLineStart = shouldPrettyPrint ? "\n" + prefix : ""; final String perChangeLineStart = shouldPrettyPrint ? "\n" + innerPrefix : ""; StringBuilder sb = new StringBuilder(); sb.append("{id=").append(mDebugId).append(" t=").append(transitTypeToString(mType)) .append(" f=0x").append(Integer.toHexString(mFlags)).append(" trk=").append(mTrack) Loading @@ -413,12 +425,15 @@ public final class TransitionInfo implements Parcelable { sb.append(mRoots.get(i).mDisplayId).append("@").append(mRoots.get(i).mOffset); } sb.append("] c=["); sb.append(perChangeLineStart); for (int i = 0; i < mChanges.size(); ++i) { if (i > 0) { sb.append(','); sb.append(perChangeLineStart); } sb.append(mChanges.get(i)); } sb.append(changesLineStart); sb.append("]}"); return sb.toString(); } Loading
core/java/android/window/TransitionRequestInfo.java +40 −8 Original line number Diff line number Diff line Loading @@ -62,13 +62,16 @@ public final class TransitionRequestInfo implements Parcelable { /** The transition flags known at the time of the request. These may not be complete. */ private final int mFlags; /** This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ private final int mDebugId; /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition) { this(type, triggerTask, null /* pipTask */, remoteTransition, null /* displayChange */, 0 /* flags */); remoteTransition, null /* displayChange */, 0 /* flags */, -1 /* debugId */); } /** constructor override */ Loading @@ -78,16 +81,29 @@ public final class TransitionRequestInfo implements Parcelable { @Nullable RemoteTransition remoteTransition, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, null /* displayChange */, flags); remoteTransition, null /* displayChange */, flags, -1 /* debugId */); } /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, displayChange, flags, -1 /* debugId */); } /** constructor override */ public TransitionRequestInfo( @WindowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable ActivityManager.RunningTaskInfo pipTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { this(type, triggerTask, null /* pipTask */, remoteTransition, displayChange, flags); this(type, triggerTask, pipTask, remoteTransition, displayChange, flags, -1 /* debugId */); } /** @hide */ Loading Loading @@ -270,7 +286,7 @@ public final class TransitionRequestInfo implements Parcelable { }; @DataClass.Generated( time = 1695667226050L, time = 1697564781403L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", inputSignatures = "private final int mDisplayId\nprivate @android.annotation.Nullable android.graphics.Rect mStartAbsBounds\nprivate @android.annotation.Nullable android.graphics.Rect mEndAbsBounds\nprivate int mStartRotation\nprivate int mEndRotation\nprivate boolean mPhysicalDisplayChanged\nclass DisplayChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)") Loading Loading @@ -318,6 +334,8 @@ public final class TransitionRequestInfo implements Parcelable { * (if size is changing). * @param flags * The transition flags known at the time of the request. These may not be complete. * @param debugId * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ @DataClass.Generated.Member public TransitionRequestInfo( Loading @@ -326,7 +344,8 @@ public final class TransitionRequestInfo implements Parcelable { @Nullable ActivityManager.RunningTaskInfo pipTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags) { int flags, int debugId) { this.mType = type; com.android.internal.util.AnnotationValidations.validate( WindowManager.TransitionType.class, null, mType); Loading @@ -335,6 +354,7 @@ public final class TransitionRequestInfo implements Parcelable { this.mRemoteTransition = remoteTransition; this.mDisplayChange = displayChange; this.mFlags = flags; this.mDebugId = debugId; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -391,6 +411,14 @@ public final class TransitionRequestInfo implements Parcelable { return mFlags; } /** * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ @DataClass.Generated.Member public int getDebugId() { return mDebugId; } /** * If non-null, the task containing the activity whose lifecycle change (start or * finish) has caused this transition to occur. Loading Loading @@ -443,7 +471,8 @@ public final class TransitionRequestInfo implements Parcelable { "pipTask = " + mPipTask + ", " + "remoteTransition = " + mRemoteTransition + ", " + "displayChange = " + mDisplayChange + ", " + "flags = " + mFlags + "flags = " + mFlags + ", " + "debugId = " + mDebugId + " }"; } Loading @@ -465,6 +494,7 @@ public final class TransitionRequestInfo implements Parcelable { if (mRemoteTransition != null) dest.writeTypedObject(mRemoteTransition, flags); if (mDisplayChange != null) dest.writeTypedObject(mDisplayChange, flags); dest.writeInt(mFlags); dest.writeInt(mDebugId); } @Override Loading @@ -485,6 +515,7 @@ public final class TransitionRequestInfo implements Parcelable { RemoteTransition remoteTransition = (flg & 0x8) == 0 ? null : (RemoteTransition) in.readTypedObject(RemoteTransition.CREATOR); TransitionRequestInfo.DisplayChange displayChange = (flg & 0x10) == 0 ? null : (TransitionRequestInfo.DisplayChange) in.readTypedObject(TransitionRequestInfo.DisplayChange.CREATOR); int flags = in.readInt(); int debugId = in.readInt(); this.mType = type; com.android.internal.util.AnnotationValidations.validate( Loading @@ -494,6 +525,7 @@ public final class TransitionRequestInfo implements Parcelable { this.mRemoteTransition = remoteTransition; this.mDisplayChange = displayChange; this.mFlags = flags; this.mDebugId = debugId; // onConstructed(); // You can define this method to get a callback } Loading @@ -513,10 +545,10 @@ public final class TransitionRequestInfo implements Parcelable { }; @DataClass.Generated( time = 1695667226088L, time = 1697564781438L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\nprivate final int mDebugId\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") @Deprecated private void __metadata() {} Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +3 −3 Original line number Diff line number Diff line Loading @@ -605,6 +605,7 @@ public abstract class WMShellBaseModule { @Provides static Transitions provideTransitions(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, ShellController shellController, ShellTaskOrganizer organizer, TransactionPool pool, Loading @@ -612,14 +613,13 @@ public abstract class WMShellBaseModule { @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler, @ShellAnimationThread ShellExecutor animExecutor, ShellCommandHandler shellCommandHandler, RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) { if (!context.getResources().getBoolean(R.bool.config_registerShellTransitionsOnInit)) { // TODO(b/238217847): Force override shell init if registration is disabled shellInit = new ShellInit(mainExecutor); } return new Transitions(context, shellInit, shellController, organizer, pool, displayController, mainExecutor, mainHandler, animExecutor, shellCommandHandler, return new Transitions(context, shellInit, shellCommandHandler, shellController, organizer, pool, displayController, mainExecutor, mainHandler, animExecutor, rootTaskDisplayAreaOrganizer); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/OneShotRemoteHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler { @NonNull Transitions.TransitionFinishCallback finishCallback) { if (mTransition != transition) return false; ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Using registered One-shot remote" + " transition %s for #%d.", mRemote, info.getDebugId()); + " transition %s for (#%d).", mRemote, info.getDebugId()); final IBinder.DeathRecipient remoteDied = () -> { Log.e(Transitions.TAG, "Remote transition died, finishing"); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { } } } ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Delegate animation for #%d to %s", ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Delegate animation for (#%d) to %s", info.getDebugId(), pendingRemote); if (pendingRemote == null) return false; Loading Loading @@ -241,7 +241,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler { if (remote == null) return null; mRequestedRemotes.put(transition, remote); ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "RemoteTransition directly requested" + " for %s: %s", transition, remote); + " for (#%d) %s: %s", request.getDebugId(), transition, remote); return new WindowContainerTransaction(); } Loading