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

Commit 4aa381dc authored by Olivier Gaillard's avatar Olivier Gaillard Committed by Android (Google) Code Review
Browse files

Merge "Do not run /system/bin/logcat when running on the ActivityManager...

Merge "Do not run /system/bin/logcat when running on the ActivityManager thread to avoid blocking the ActivityManager thread."
parents 0d0edd2e e927037d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -8858,6 +8858,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        // Do the rest in a worker thread to avoid blocking the caller on I/O
        // (After this point, we shouldn't access AMS internal data structures.)
        //
        // If process is null, we are being called from some internal code
        // and may be about to die -- run this synchronously.
        final boolean runSynchronously = process == null;
        Thread worker = new Thread("Error dump: " + dropboxTag) {
            @Override
            public void run() {
@@ -8885,7 +8889,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    sb.append(crashInfo.stackTrace);
                }
                if (lines > 0) {
                if (lines > 0 && !runSynchronously) {
                    sb.append("\n");
                    InputStreamReader input = null;
@@ -8917,9 +8921,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        };
        if (process == null) {
            // If process is null, we are being called from some internal code
            // and may be about to die -- run this synchronously.
        if (runSynchronously) {
            final int oldMask = StrictMode.allowThreadDiskWritesMask();
            try {
                worker.run();