Lite bugreports(wifi/telephony) don't need screenshots
Set do_fb to false for lite bugreports to not take screenshots.
Also, add a nonempty check for screenshot files before broadcasting to
notification. This way while sharing or uploading to drive/gmail by
clicking the "Share" button would not show empty file (Not able to
upload) error.
Update unit tests to check for do_fb set to false for wifi/telephony.
Bug: 128546970
Test: Manually take a wifi bugreport:
* adb root
* adb shell setprop dumpstate.options bugreportwifi
* adb shell dumpstate
* share bugreport from the notification to the drive
* No upload failures (previously screenshot would show "Upload was
unsuccessful" notification.)
Test:
* adb shell mkdir /data/nativetest64
* 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: I0d2fe2a64f91dee7d090d5f8353e86d51ed5fb94
diff --git a/cmds/dumpstate/tests/dumpstate_test.cpp b/cmds/dumpstate/tests/dumpstate_test.cpp
index eb73d41..e6a7735 100644
--- a/cmds/dumpstate/tests/dumpstate_test.cpp
+++ b/cmds/dumpstate/tests/dumpstate_test.cpp
@@ -373,7 +373,7 @@
EXPECT_EQ(status, Dumpstate::RunStatus::OK);
EXPECT_TRUE(options_.do_add_date);
- EXPECT_TRUE(options_.do_fb);
+ EXPECT_FALSE(options_.do_fb);
EXPECT_TRUE(options_.do_broadcast);
EXPECT_TRUE(options_.do_zip_file);
EXPECT_TRUE(options_.telephony_only);
@@ -404,7 +404,7 @@
EXPECT_EQ(status, Dumpstate::RunStatus::OK);
EXPECT_TRUE(options_.do_add_date);
- EXPECT_TRUE(options_.do_fb);
+ EXPECT_FALSE(options_.do_fb);
EXPECT_TRUE(options_.do_broadcast);
EXPECT_TRUE(options_.do_zip_file);
EXPECT_TRUE(options_.wifi_only);