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

Commit 0aa22095 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Make flushing the broadcast loopers optional."

parents f2b0443d e0800e13
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -18322,9 +18322,11 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    public void waitForBroadcastBarrier(@Nullable PrintWriter pw) {
    public void waitForBroadcastBarrier(@Nullable PrintWriter pw, boolean flushBroadcastLoopers) {
        enforceCallingPermission(permission.DUMP, "waitForBroadcastBarrier()");
        if (flushBroadcastLoopers) {
            BroadcastLoopers.waitForBarrier(pw);
        }
        for (BroadcastQueue queue : mBroadcastQueues) {
            queue.waitForBarrier(pw);
        }
+11 −1
Original line number Diff line number Diff line
@@ -3131,7 +3131,17 @@ final class ActivityManagerShellCommand extends ShellCommand {
    }

    int runWaitForBroadcastBarrier(PrintWriter pw) throws RemoteException {
        mInternal.waitForBroadcastBarrier(pw);
        boolean flushBroadcastLoopers = false;
        String opt;
        while ((opt = getNextOption()) != null) {
            if (opt.equals("--flush-broadcast-loopers")) {
                flushBroadcastLoopers = true;
            } else {
                getErrPrintWriter().println("Error: Unknown option: " + opt);
                return -1;
            }
        }
        mInternal.waitForBroadcastBarrier(pw, flushBroadcastLoopers);
        return 0;
    }