Add proto dumpstate mode
Add a "PROTO" dumpstate mode to request a protobuf dump from
IDumpstateDevice HAL, primarily used by incidentd to get
device-specific state as a proto for automated issue reporting and
debugging.
Since the format of these states can vary across vendors and devices,
the proto schema will not be defined in AOSP.
Bug: 140521164
Test: VtsHalDumpstateV1_1TargetTest
Change-Id: I1d586c99b654471db5028039792c3d9e6e2184bb
Merged-In: I1d586c99b654471db5028039792c3d9e6e2184bb
diff --git a/dumpstate/1.1/types.hal b/dumpstate/1.1/types.hal
index f5cbade..c522f7c 100644
--- a/dumpstate/1.1/types.hal
+++ b/dumpstate/1.1/types.hal
@@ -55,6 +55,13 @@
* This mode MUST be supported if the dumpstate HAL is implemented.
*/
DEFAULT = 6,
+ /**
+ * Takes a report in protobuf.
+ *
+ * The content, if implemented, must be a binary protobuf message written to the first file
+ * descriptor of the native handle. The protobuf schema shall be defined by the vendor.
+ */
+ PROTO = 7,
};
/**
diff --git a/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp b/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp
index 089b039..1811b73 100644
--- a/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp
+++ b/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp
@@ -92,7 +92,8 @@
TEST_FOR_DUMPSTATE_MODE(name, body, WEAR); \
TEST_FOR_DUMPSTATE_MODE(name, body, CONNECTIVITY); \
TEST_FOR_DUMPSTATE_MODE(name, body, WIFI); \
- TEST_FOR_DUMPSTATE_MODE(name, body, DEFAULT);
+ TEST_FOR_DUMPSTATE_MODE(name, body, DEFAULT); \
+ TEST_FOR_DUMPSTATE_MODE(name, body, PROTO);
constexpr uint64_t kDefaultTimeoutMillis = 30 * 1000; // 30 seconds