Loading core/java/android/app/Activity.java +4 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.DETECT_SCREEN_CAPTURE; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.Instrumentation.DEBUG_FINISH_ACTIVITY; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.inMultiWindowMode; import static android.os.Process.myUid; Loading Loading @@ -7297,6 +7298,9 @@ public class Activity extends ContextThemeWrapper */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private void finish(int finishTask) { if (DEBUG_FINISH_ACTIVITY) { Log.d("Instrumentation", "finishActivity: finishTask=" + finishTask, new Throwable()); } if (mParent == null) { int resultCode; Intent resultData; Loading core/java/android/app/Instrumentation.java +2 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,8 @@ public class Instrumentation { // If set, will print the stack trace for activity starts within the process static final boolean DEBUG_START_ACTIVITY = Build.IS_DEBUGGABLE && SystemProperties.getBoolean("persist.wm.debug.start_activity", false); static final boolean DEBUG_FINISH_ACTIVITY = Build.IS_DEBUGGABLE && SystemProperties.getBoolean("persist.wm.debug.finish_activity", false); /** * @hide Loading libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md +14 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ adb reboot adb logcat -s "SurfaceControlRegistry" ``` ## Tracing activity starts in the app process ## Tracing activity starts & finishes in the app process It's sometimes useful to know when to see a stack trace of when an activity starts in the app code (ie. if you are repro'ing a bug related to activity starts). You can enable this system property to Loading @@ -113,6 +113,19 @@ adb shell setprop persist.wm.debug.start_activity \"\" adb reboot ``` Likewise, to trace where a finish() call may be made in the app process, you can enable this system property: ```shell # Enabling adb shell setprop persist.wm.debug.finish_activity true adb reboot adb logcat -s "Instrumentation" # Disabling adb shell setprop persist.wm.debug.finish_activity \"\" adb reboot ``` ## Dumps Because the Shell library is built as a part of SystemUI, dumping the state is currently done as a Loading Loading
core/java/android/app/Activity.java +4 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.DETECT_SCREEN_CAPTURE; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.Instrumentation.DEBUG_FINISH_ACTIVITY; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.inMultiWindowMode; import static android.os.Process.myUid; Loading Loading @@ -7297,6 +7298,9 @@ public class Activity extends ContextThemeWrapper */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private void finish(int finishTask) { if (DEBUG_FINISH_ACTIVITY) { Log.d("Instrumentation", "finishActivity: finishTask=" + finishTask, new Throwable()); } if (mParent == null) { int resultCode; Intent resultData; Loading
core/java/android/app/Instrumentation.java +2 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,8 @@ public class Instrumentation { // If set, will print the stack trace for activity starts within the process static final boolean DEBUG_START_ACTIVITY = Build.IS_DEBUGGABLE && SystemProperties.getBoolean("persist.wm.debug.start_activity", false); static final boolean DEBUG_FINISH_ACTIVITY = Build.IS_DEBUGGABLE && SystemProperties.getBoolean("persist.wm.debug.finish_activity", false); /** * @hide Loading
libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md +14 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ adb reboot adb logcat -s "SurfaceControlRegistry" ``` ## Tracing activity starts in the app process ## Tracing activity starts & finishes in the app process It's sometimes useful to know when to see a stack trace of when an activity starts in the app code (ie. if you are repro'ing a bug related to activity starts). You can enable this system property to Loading @@ -113,6 +113,19 @@ adb shell setprop persist.wm.debug.start_activity \"\" adb reboot ``` Likewise, to trace where a finish() call may be made in the app process, you can enable this system property: ```shell # Enabling adb shell setprop persist.wm.debug.finish_activity true adb reboot adb logcat -s "Instrumentation" # Disabling adb shell setprop persist.wm.debug.finish_activity \"\" adb reboot ``` ## Dumps Because the Shell library is built as a part of SystemUI, dumping the state is currently done as a Loading