Merge "Do not send finished broadcasts when called by API"
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 86558ef..302d491 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -2708,7 +2708,7 @@
     }
 
     /* tell activity manager we're done */
-    if (options_->do_broadcast) {
+    if (options_->do_broadcast && !CalledByApi()) {
         SendBugreportFinishedBroadcast();
         // Note that listener_ is notified in Run();
     }