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

Commit 7ae419a9 authored by Stefan Andonian's avatar Stefan Andonian Committed by Android (Google) Code Review
Browse files

Merge "Allow DumpViewHierarchy cmd to be interruptible without breaking." into main

parents e72e539b 559393ee
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1569,7 +1569,17 @@ public class LauncherAppsService extends SystemService {
         */
        private void forEachViewCaptureWindow(
                @NonNull BiConsumer<String, InputStream> outputtingConsumer) {
            for (int i = mDumpCallbacks.beginBroadcast() - 1; i >= 0; i--) {
            int i;
            try {
                i = mDumpCallbacks.beginBroadcast() - 1;
            } catch (IllegalStateException e) {
                Log.d(TAG, "The previous broadcast must have been killed, because a broadcast"
                        + "was occurring when it should not have been. Calling finishBroadcast and "
                        + "retrying.", e);
                mDumpCallbacks.finishBroadcast();
                i = mDumpCallbacks.beginBroadcast() - 1;
            }
            for (; i >= 0; i--) {
                String packageName = (String) mDumpCallbacks.getBroadcastCookie(i);
                String fileName = WM_TRACE_DIR + packageName + "_" + i + VC_FILE_SUFFIX;