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
This commit is contained in:
Mike Ma
2020-02-13 13:11:00 -08:00
parent 25c2de29b9
commit 6165e2dd30
3 changed files with 10 additions and 2 deletions

View File

@@ -612,7 +612,7 @@ dd377f404a8e71f6191d295e10067db629b0f0c28e594af906f2bea5d87fe2cc android.hardwar
40ab2c6866c18d32baf6e49e3053949e79601f56963a791e93e68b9ee18f718d android.hardware.bluetooth@1.1::IBluetoothHciCallbacks
07d0a252b2d8fa35887908a996ba395cf392968395fc30afab791f46e0c22a52 android.hardware.boot@1.1::IBootControl
74049a402be913963edfdd80828a53736570e9d8124a1bf18166b6ed46a6b0ab android.hardware.boot@1.1::types
446287268831f4ddfac4a51bb1c32ae1e48e47bccd535fccc2c4546d0e7c4013 android.hardware.dumpstate@1.1::types
d9df99be0f59d8f33a9699fe316c67bfd11818aa69440bb1123ba43e717cea85 android.hardware.dumpstate@1.1::types
f284ffde7cadf5a1364b75ab313baf22401eeca289bdde2a2dc7a27ea4ab98d7 android.hardware.dumpstate@1.1::IDumpstateDevice
ce8dbe76eb9ee94b46ef98f725be992e760a5751073d4f4912484026541371f3 android.hardware.health@2.1::IHealth
26f04510a0b57aba5167c5c0a7c2f077c2acbb98b81902a072517829fd9fd67f android.hardware.health@2.1::IHealthInfoCallback

View File

@@ -55,6 +55,13 @@ enum DumpstateMode : uint32_t {
* 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,
};
/**

View File

@@ -92,7 +92,8 @@ class DumpstateHidl1_1Test : public ::testing::TestWithParam<std::string> {
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