Support to screenshot to interactive bugreport.

- Take screenshot only after critical dumpsys has finished -- so calling
app can be shown earlier without disrupting critical dumpsys after
starting bugreport.

- Show a visual indication to indicate screenshot is taken via IDumpstateListener.onScreenshotTaken().

- Copy the screenshot file to calling app after consent is granted for letting
calling app can get and show the screenshot earlier, otherwise calling
app may need to wait several minutes to get the screenshot to show.

- Rename do_fb --> do_screenshot because do_fb basically means do_screenshot.

BUG:149525300
Test: Flash and press bug report shortcut and check the screenshot
Change-Id: Ibaca13bfabc1350448d05df12be5ee9291860c0e
Merged-In: Ibaca13bfabc1350448d05df12be5ee9291860c0e
diff --git a/cmds/dumpstate/tests/dumpstate_smoke_test.cpp b/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
index dac90d9..f26e4db 100644
--- a/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
+++ b/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
@@ -167,6 +167,12 @@
         return binder::Status::ok();
     }
 
+    binder::Status onScreenshotTaken(bool success) override {
+        std::lock_guard<std::mutex> lock(lock_);
+        dprintf(out_fd_, "\rResult of taking screenshot: %s", success ? "success" : "failure");
+        return binder::Status::ok();
+    }
+
     bool getIsFinished() {
         std::lock_guard<std::mutex> lock(lock_);
         return is_finished_;