Fixed usage --receiver-foreground on am call.
BUG: 26871362
Change-Id: Ied8e663eec59c83a06a8f2a6e2908c02ac1558c8
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 513e295..b03a7e4 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -1118,7 +1118,7 @@
if (!path.empty()) {
ALOGI("Final bugreport path: %s\n", path.c_str());
std::vector<std::string> am_args = {
- "--receiver-permission", "android.permission.DUMP",
+ "android.permission.DUMP", "--receiver-foreground",
"--ei", "android.intent.extra.PID", std::to_string(getpid()),
"--es", "android.intent.extra.BUGREPORT", path
};
diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp
index 7562ac8..2cf8d36 100644
--- a/cmds/dumpstate/utils.cpp
+++ b/cmds/dumpstate/utils.cpp
@@ -578,7 +578,7 @@
fprintf(stderr, "send_broadcast: too many arguments (%d)\n", (int) args.size());
return;
}
- const char *am_args[1024] = { "/system/bin/am", "broadcast", "--receiver-foreground",
+ const char *am_args[1024] = { "/system/bin/am", "broadcast",
"--user", "0", "-a", action.c_str() };
size_t am_index = 5; // Starts at the index of last initial value above.
for (const std::string& arg : args) {