OSDN Git Service

Fixed logic to print BEGIN: line for bugreportz.
authorFelipe Leme <felipeal@google.com>
Thu, 4 Aug 2016 19:48:50 +0000 (12:48 -0700)
committerFelipe Leme <felipeal@google.com>
Thu, 4 Aug 2016 19:51:20 +0000 (12:51 -0700)
BUG: 30451114
Change-Id: I0e65a38999c128a435b43ad0806e06e6e74580ff

cmds/dumpstate/dumpstate.cpp

index 0129392..e9f9e57 100644 (file)
@@ -1269,17 +1269,19 @@ int main(int argc, char *argv[]) {
             add_text_zip_entry("version.txt", version);
         }
 
-        if (do_update_progress && do_broadcast) {
-            // clang-format off
-            std::vector<std::string> am_args = {
-                 "--receiver-permission", "android.permission.DUMP", "--receiver-foreground",
-                 "--es", "android.intent.extra.NAME", suffix,
-                 "--ei", "android.intent.extra.ID", std::to_string(id),
-                 "--ei", "android.intent.extra.PID", std::to_string(getpid()),
-                 "--ei", "android.intent.extra.MAX", std::to_string(WEIGHT_TOTAL),
-            // clang-format on
-            };
-            send_broadcast("android.intent.action.BUGREPORT_STARTED", am_args);
+        if (do_update_progress) {
+            if (do_broadcast) {
+                // clang-format off
+                std::vector<std::string> am_args = {
+                     "--receiver-permission", "android.permission.DUMP", "--receiver-foreground",
+                     "--es", "android.intent.extra.NAME", suffix,
+                     "--ei", "android.intent.extra.ID", std::to_string(id),
+                     "--ei", "android.intent.extra.PID", std::to_string(getpid()),
+                     "--ei", "android.intent.extra.MAX", std::to_string(WEIGHT_TOTAL),
+                };
+                // clang-format on
+                send_broadcast("android.intent.action.BUGREPORT_STARTED", am_args);
+            }
             if (use_control_socket) {
                 dprintf(control_socket_fd, "BEGIN:%s\n", path.c_str());
             }