summaryrefslogtreecommitdiff
path: root/adb/file_sync_client.cpp
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-04-01 17:43:27 -0700
committerFelipe Leme <felipeal@google.com>2016-04-13 09:21:23 -0700
commit44a42677cfde5f1ae6d0be67dcd07659d9c0f265 (patch)
tree74fe6bb42fa83ddd45161277c514022cfdab9a6f /adb/file_sync_client.cpp
parentc2648132d2dc5874bb49de4efdf1d9a2e12eb6e8 (diff)
Implements 'adb bugreport <ZIP_FILE>'.
Dumpstate now supports zipped bugreport, whose output is more complete than the flat-file bugreports provided prior to N. As such, adb now has a 'adb bugreport <ZIP_FILE>' name whose implementation: - Calls the new bugreportz binary. - Parses its output, which in case of success is the path of the .zip file. - Pulls the device file and renames it according to the command-line argument. BUG: 27653204 Change-Id: I7169fe157c77bbef1684d0cb4e43095d95ddf2b8
Diffstat (limited to 'adb/file_sync_client.cpp')
-rw-r--r--adb/file_sync_client.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp
index 6a9e163715..651e8ca97b 100644
--- a/adb/file_sync_client.cpp
+++ b/adb/file_sync_client.cpp
@@ -518,7 +518,8 @@ static bool sync_send(SyncConnection& sc, const char* lpath, const char* rpath,
return sc.CopyDone(lpath, rpath);
}
-static bool sync_recv(SyncConnection& sc, const char* rpath, const char* lpath) {
+static bool sync_recv(SyncConnection& sc, const char* rpath, const char* lpath,
+ const char* name=nullptr) {
unsigned size = 0;
if (!sync_stat(sc, rpath, nullptr, nullptr, &size)) return false;
@@ -574,7 +575,7 @@ static bool sync_recv(SyncConnection& sc, const char* rpath, const char* lpath)
bytes_copied += msg.data.size;
- sc.ReportProgress(rpath, bytes_copied, size);
+ sc.ReportProgress(name != nullptr ? name : rpath, bytes_copied, size);
}
adb_close(lfd);
@@ -927,7 +928,7 @@ static bool copy_remote_dir_local(SyncConnection& sc, std::string rpath,
}
bool do_sync_pull(const std::vector<const char*>& srcs, const char* dst,
- bool copy_attrs) {
+ bool copy_attrs, const char* name) {
SyncConnection sc;
if (!sc.IsValid()) return false;
@@ -1022,7 +1023,7 @@ bool do_sync_pull(const std::vector<const char*>& srcs, const char* dst,
}
sc.SetExpectedTotalBytes(src_size);
- if (!sync_recv(sc, src_path, dst_path)) {
+ if (!sync_recv(sc, src_path, dst_path, name)) {
success = false;
continue;
}