On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.
BUG: 30451114
Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
(cherry picked from commit 9a882a3ef3)
(cherry picked from commit b0022b036e)
Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.
With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.
BUG: 30451114
BUG: 29448020
Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
(cherry picked from commit 307951e124)
(cherry picked from commit f8d9e4eb00)
- Skipped artificial 100/100 message, since pulling will take care of
the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
be copied to the destination directory.
BUG: 30451114
Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
(cherry picked from commit 80a65d03c9)
(cherry picked from commit 5f6eacaeda)
Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.
Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...
Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
(cherry picked from commit f7c38b4c03)
(cherry picked from commit 33ae849fef)
adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).
Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.
BUG: 28609499
Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
(cherry picked from commit cd42d658b2)
(cherry picked from commit 97b73a0daf)
bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.
As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.
Fixes: 30100363
Bug: 30268737
Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
(cherry picked from commit 78e0963e4b)
(cherry picked from commit 218e1ff759)