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

Commit 894c988c authored by Winson Chung's avatar Winson Chung
Browse files

Add corresponding finish-transition logs

- Useful for tracking calls to finish on local devices

Bug: 378565144
Flag: EXEMPT bugfix
Test: adb shell setprop persist.wm.debug.finish_shell_transition true
      adb logcat -s ShellTransitions

Change-Id: I500ae0ad2fede138e23c8c6cde79dd7d30ea038b
parent aea79856
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -166,17 +166,20 @@ adb shell setprop persist.wm.debug.finish_activity \"\"
adb reboot
```

## Tracing transition requests in the Shell
## Tracing transition starts/finishes in the Shell

To trace where a new WM transition is started in the Shell, you can enable this system property:
To trace where a new WM transition is started and finished in the Shell, you can enable these system
properties respectively:
```shell
# Enabling
adb shell setprop persist.wm.debug.start_shell_transition true
adb shell setprop persist.wm.debug.finish_shell_transition true
adb reboot
adb logcat -s "ShellTransitions"

# Disabling
adb shell setprop persist.wm.debug.start_shell_transition \"\"
adb shell setprop persist.wm.debug.finish_shell_transition \"\"
adb reboot
```

+9 −1
Original line number Diff line number Diff line
@@ -138,9 +138,11 @@ public class Transitions implements RemoteCallable<Transitions>,
        ShellCommandHandler.ShellCommandActionHandler {
    static final String TAG = "ShellTransitions";

    // If set, will print the stack trace for transition starts within the process
    // If set, will print the stack trace for transition starts/finishes within the process
    static final boolean DEBUG_START_TRANSITION = Build.IS_DEBUGGABLE &&
            SystemProperties.getBoolean("persist.wm.debug.start_shell_transition", false);
    static final boolean DEBUG_FINISH_TRANSITION = Build.IS_DEBUGGABLE &&
            SystemProperties.getBoolean("persist.wm.debug.finish_shell_transition", false);

    /** Set to {@code true} to enable shell transitions. */
    public static final boolean ENABLE_SHELL_TRANSITIONS = true;
@@ -1151,6 +1153,12 @@ public class Transitions implements RemoteCallable<Transitions>,
            Log.e(TAG, "Trying to finish a non-existent transition: " + token);
            return;
        }
        if (DEBUG_FINISH_TRANSITION) {
            final String name = active.mHandler != null
                    ?  active.mHandler.getClass().getName() : "null";
            Log.d(TAG, "finishTransition: type=" + transitTypeToString(active.mInfo.getType())
                            + " wct=" + wct + " handler=" + name, new Throwable());
        }

        final Track track = mTracks.get(active.getTrack());
        if (track == null || track.mActiveTransition != active) {