Loading services/core/java/com/android/server/am/ActivityManagerService.java +7 −5 Original line number Diff line number Diff line Loading @@ -18894,12 +18894,14 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void waitForBroadcastIdle() { waitForBroadcastIdle(LOG_WRITER_INFO); waitForBroadcastIdle(LOG_WRITER_INFO, false); } public void waitForBroadcastIdle(@NonNull PrintWriter pw) { void waitForBroadcastIdle(@NonNull PrintWriter pw, boolean flushBroadcastLoopers) { enforceCallingPermission(permission.DUMP, "waitForBroadcastIdle()"); if (flushBroadcastLoopers) { BroadcastLoopers.waitForIdle(pw); } for (BroadcastQueue queue : mBroadcastQueues) { queue.waitForIdle(pw); } Loading @@ -18912,7 +18914,7 @@ public class ActivityManagerService extends IActivityManager.Stub waitForBroadcastBarrier(LOG_WRITER_INFO, false, false); } public void waitForBroadcastBarrier(@NonNull PrintWriter pw, void waitForBroadcastBarrier(@NonNull PrintWriter pw, boolean flushBroadcastLoopers, boolean flushApplicationThreads) { enforceCallingPermission(permission.DUMP, "waitForBroadcastBarrier()"); if (flushBroadcastLoopers) { Loading @@ -18930,7 +18932,7 @@ public class ActivityManagerService extends IActivityManager.Stub * Wait for all pending {@link IApplicationThread} events to be processed in * all currently running apps. */ public void waitForApplicationBarrier(@NonNull PrintWriter pw) { void waitForApplicationBarrier(@NonNull PrintWriter pw) { final CountDownLatch finishedLatch = new CountDownLatch(1); final AtomicInteger pingCount = new AtomicInteger(0); final AtomicInteger pongCount = new AtomicInteger(0); services/core/java/com/android/server/am/ActivityManagerShellCommand.java +11 −1 Original line number Diff line number Diff line Loading @@ -3447,7 +3447,17 @@ final class ActivityManagerShellCommand extends ShellCommand { int runWaitForBroadcastIdle(PrintWriter pw) throws RemoteException { pw = new PrintWriter(new TeeWriter(LOG_WRITER_INFO, pw)); mInternal.waitForBroadcastIdle(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.waitForBroadcastIdle(pw, flushBroadcastLoopers); return 0; } Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +7 −5 Original line number Diff line number Diff line Loading @@ -18894,12 +18894,14 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void waitForBroadcastIdle() { waitForBroadcastIdle(LOG_WRITER_INFO); waitForBroadcastIdle(LOG_WRITER_INFO, false); } public void waitForBroadcastIdle(@NonNull PrintWriter pw) { void waitForBroadcastIdle(@NonNull PrintWriter pw, boolean flushBroadcastLoopers) { enforceCallingPermission(permission.DUMP, "waitForBroadcastIdle()"); if (flushBroadcastLoopers) { BroadcastLoopers.waitForIdle(pw); } for (BroadcastQueue queue : mBroadcastQueues) { queue.waitForIdle(pw); } Loading @@ -18912,7 +18914,7 @@ public class ActivityManagerService extends IActivityManager.Stub waitForBroadcastBarrier(LOG_WRITER_INFO, false, false); } public void waitForBroadcastBarrier(@NonNull PrintWriter pw, void waitForBroadcastBarrier(@NonNull PrintWriter pw, boolean flushBroadcastLoopers, boolean flushApplicationThreads) { enforceCallingPermission(permission.DUMP, "waitForBroadcastBarrier()"); if (flushBroadcastLoopers) { Loading @@ -18930,7 +18932,7 @@ public class ActivityManagerService extends IActivityManager.Stub * Wait for all pending {@link IApplicationThread} events to be processed in * all currently running apps. */ public void waitForApplicationBarrier(@NonNull PrintWriter pw) { void waitForApplicationBarrier(@NonNull PrintWriter pw) { final CountDownLatch finishedLatch = new CountDownLatch(1); final AtomicInteger pingCount = new AtomicInteger(0); final AtomicInteger pongCount = new AtomicInteger(0);
services/core/java/com/android/server/am/ActivityManagerShellCommand.java +11 −1 Original line number Diff line number Diff line Loading @@ -3447,7 +3447,17 @@ final class ActivityManagerShellCommand extends ShellCommand { int runWaitForBroadcastIdle(PrintWriter pw) throws RemoteException { pw = new PrintWriter(new TeeWriter(LOG_WRITER_INFO, pw)); mInternal.waitForBroadcastIdle(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.waitForBroadcastIdle(pw, flushBroadcastLoopers); return 0; } Loading