Add support for proto dumps in dumpstate

- Call dumpsys library directly from dumpstate.
- Send section generation status (name, size and duration) via section
  progress reporter.
- Add end to end smoke test for bugreport:
   - Checks if zipped bug report was generated without errors within a
     reasonable time of a reasonable size.
   - Checks if zipped bug report contains version file, main entry and
     some selected files from the device file system.
   - Checks if all sections in the bug report were generated without
     errors.
   - Checks if some sections were generated with a reasonable size.
- Changes are gated by Bugreport version. Version will be updated in a
  subsequent cl.

Bug: 67716082, 70154685
Test: Manually generate bugrepot (default version) and check for any issues
Test: mmm -j56 frameworks/native/cmds/dumpstate && \
      adb shell setprop dumpstate.version "2.0-dev-priority-dumps" && \
      adb sync data && adb shell /data/nativetest/dumpstate_test/dumpstate_test && \
      adb shell /data/nativetest64/dumpstate_test/dumpstate_test && \
      adb shell /data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test && \
      printf "\n\n#### ALL TESTS PASSED ####\n"

Change-Id: If036699d0588f74ef8e84c56323126214857dbdd
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 843c545..2554b63 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -226,8 +226,14 @@
 
     /*
      * Adds a new entry to the existing zip file.
+     *
+     * |entry_name| destination path of the new entry.
+     * |fd| file descriptor to read from.
+     * |timeout| timeout to terminate the read if not completed. Set
+     * value of 0s (default) to disable timeout.
      */
-    bool AddZipEntryFromFd(const std::string& entry_name, int fd);
+    android::status_t AddZipEntryFromFd(const std::string& entry_name, int fd,
+                                        std::chrono::milliseconds timeout);
 
     /*
      * Adds a text entry entry to the existing zip file.