Fix adb bugreport and add bugreport unit tests.
Commit 58d72e2 introduced a regression, which made fullbugreport as the
default mode. This lead to 'adb bugreport SAMPLE_BR' triggering a
progress notification on the device as it inherited do_broadcast from full bugreport.
Fix the issue by separating full bugreport from default bugreport.
Add unit tests for all the cases of calling bugreport.
Bug: 119877616
Test: Verified that 'adb bugreport SAMPLE_BR' does not show any notification on the device.
Test: mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest64/dumpstate_test* /data/nativetest64 && adb shell /data/nativetest64/dumpstate_test/dumpstate_test && printf "\n\n#### ALL TESTS PASSED ####\n"
Change-Id: I06e57454a91a3276dd89d47b3b0a04d3d85f32da
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 35cbdb1..06b4ff3 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -196,7 +196,8 @@
BUGREPORT_REMOTE = android::os::IDumpstate::BUGREPORT_MODE_REMOTE,
BUGREPORT_WEAR = android::os::IDumpstate::BUGREPORT_MODE_WEAR,
BUGREPORT_TELEPHONY = android::os::IDumpstate::BUGREPORT_MODE_TELEPHONY,
- BUGREPORT_WIFI = android::os::IDumpstate::BUGREPORT_MODE_WIFI
+ BUGREPORT_WIFI = android::os::IDumpstate::BUGREPORT_MODE_WIFI,
+ BUGREPORT_DEFAULT = android::os::IDumpstate::BUGREPORT_MODE_DEFAULT
};
static android::os::dumpstate::CommandOptions DEFAULT_DUMPSYS;