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

Commit 8ada330d authored by Chris Tate's avatar Chris Tate Committed by Android (Google) Code Review
Browse files

Merge "Don't ANR if a broadcast recipient is sitting at a breakpoint" into pi-dev

parents 1817c132 f2370163
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1457,10 +1457,17 @@ public final class BroadcastQueue {
            return;
        }

        // If the receiver app is being debugged we quietly ignore unresponsiveness, just
        // tidying up and moving on to the next broadcast without crashing or ANRing this
        // app just because it's stopped at a breakpoint.
        final boolean debugging = (r.curApp != null && r.curApp.debugging);

        Slog.w(TAG, "Timeout of broadcast " + r + " - receiver=" + r.receiver
                + ", started " + (now - r.receiverTime) + "ms ago");
        r.receiverTime = now;
        if (!debugging) {
            r.anrCount++;
        }

        ProcessRecord app = null;
        String anrMessage = null;
@@ -1500,7 +1507,7 @@ public final class BroadcastQueue {
                r.resultExtras, r.resultAbort, false);
        scheduleBroadcastsLocked();

        if (anrMessage != null) {
        if (!debugging && anrMessage != null) {
            // Post the ANR to the handler since we do not want to process ANRs while
            // potentially holding our lock.
            mHandler.post(new AppNotResponding(app, anrMessage));