From 8908d6fd517f2b9ce6b571dfbc598638d8e505bc Mon Sep 17 00:00:00 2001 From: Mike Ma Date: Thu, 13 Feb 2020 13:11:00 -0800 Subject: [PATCH] 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 --- current.txt | 2 +- dumpstate/1.1/types.hal | 7 +++++++ .../1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/current.txt b/current.txt index adffc8d868..d3dee6212a 100644 --- a/current.txt +++ b/current.txt @@ -645,7 +645,7 @@ f18695dd36ee205640b8326a17453858a7b4596653aaa6ef0016b0aef1bd4dac android.hardwar 4d85e814f94949dae4dc6cb82bbd7d6bb24ffafda6ddb2eac928d2a4fc2e21ce android.hardware.cas@1.2::types 66931c2506fbb5af61f20138cb05e0a09e7bf67d6964c231d27c648933bb33ec android.hardware.drm@1.3::ICryptoFactory 994d08ab27d613022c258a9ec48cece7adf2a305e92df5d76ef923e2c6665f64 android.hardware.drm@1.3::IDrmFactory -446287268831f4ddfac4a51bb1c32ae1e48e47bccd535fccc2c4546d0e7c4013 android.hardware.dumpstate@1.1::types +d9df99be0f59d8f33a9699fe316c67bfd11818aa69440bb1123ba43e717cea85 android.hardware.dumpstate@1.1::types 186bc152ae189ab48f3a761a44ddf5edd0d483073c5b6ca1f802f8b50488b754 android.hardware.dumpstate@1.1::IDumpstateDevice 769d346927a94fd40ee80a5a976d8d15cf022ef99c5900738f4a82f26c0ed229 android.hardware.gnss@2.1::types 626db710bf917ecf551a0b0b1f25be10bf52758f43e0fc808b148b6aae2ef73e android.hardware.gnss@2.1::IGnss diff --git a/dumpstate/1.1/types.hal b/dumpstate/1.1/types.hal index f5cbade151..c522f7cb8b 100644 --- a/dumpstate/1.1/types.hal +++ b/dumpstate/1.1/types.hal @@ -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, }; /** diff --git a/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp b/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp index 51dce5e345..cbdd87bc78 100644 --- a/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp +++ b/dumpstate/1.1/vts/functional/VtsHalDumpstateV1_1TargetTest.cpp @@ -92,7 +92,8 @@ class DumpstateHidl1_1Test : public ::testing::TestWithParam { 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