From f5df0dc88a7becbbccf4bfc9025e9cc52e072734 Mon Sep 17 00:00:00 2001 From: xiangj5x Date: Mon, 14 May 2018 14:54:47 +0800 Subject: [PATCH] dumpstate: remote bug reports fail Call DevicePolicyManager.requestBugreport() in device owner, the service 'bugreport' killed by signal 1. This process exit in below code in dumpstate.cpp because the value of do_zip_file is false when is_remote_mode is true. if (is_remote_mode && (ds.update_progress_ || !do_broadcast || !do_zip_file || !do_add_date)) { ExitOnInvalidArgs(); } before android 8.0,the remotebugreport is designed as below: service bugreportremote /system/bin/dumpstate -d -q -B -R -z \ -o /data/user_de/0/com.android.shell/files/bugreports/remote/bugreport but have changed using extra_options_ == "bugreportremote" for distinguish from android 8.0, miss -z(do_zip_file) premeter when call remotebugreport. Jira: None Test: Call DevicePolicyManager.requestBugreport() in device owner,and get reports success. Signed-off-by: xiangj5x --- cmds/dumpstate/dumpstate.cpp | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 cmds/dumpstate/dumpstate.cpp diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp old mode 100644 new mode 100755 index 5f93e9906..f9736a4d0 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -1577,6 +1577,7 @@ int main(int argc, char *argv[]) { } else if (ds.extra_options_ == "bugreportremote") { do_vibrate = 0; is_remote_mode = 1; + do_zip_file = 1; do_fb = 0; } else if (ds.extra_options_ == "bugreportwear") { ds.update_progress_ = true;