summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland2018-05-01 18:26:21 -0500
committerSteven Moreland2018-05-07 11:35:11 -0500
commit521d15c537b410c62cbe0e65c37c6a902f056a81 (patch)
treeb8a4ce041fd66372ce5ab44d301164079b2e38dc /dumpstate/1.0/default/DumpstateDevice.cpp
parentaf3006428d3d241a40430f634efbb0750525708a (diff)
downloadplatform-hardware-interfaces-521d15c537b410c62cbe0e65c37c6a902f056a81.tar.gz
platform-hardware-interfaces-521d15c537b410c62cbe0e65c37c6a902f056a81.tar.xz
platform-hardware-interfaces-521d15c537b410c62cbe0e65c37c6a902f056a81.zip
Make dumpstate HAL lazy.
Bug: 78509314 Test: HAL isn't running Test: adb bugreport HAL runs Test: HAL isn't running after bugreport finishes Test: manually inspect state using `lshal` and logs using `adb logcat | grep android.hardware.dump` (cherry picked from commit 711b806727c85d91cf805db4f78b4a9609e2bf43) Change-Id: Ic97516a4297e7933430fb4fa3fd0109f8c1b1d0a
Diffstat (limited to 'dumpstate/1.0/default/DumpstateDevice.cpp')
-rw-r--r--dumpstate/1.0/default/DumpstateDevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/dumpstate/1.0/default/DumpstateDevice.cpp b/dumpstate/1.0/default/DumpstateDevice.cpp
index 818a5312..88623afd 100644
--- a/dumpstate/1.0/default/DumpstateDevice.cpp
+++ b/dumpstate/1.0/default/DumpstateDevice.cpp
@@ -18,6 +18,7 @@
18 18
19#include "DumpstateDevice.h" 19#include "DumpstateDevice.h"
20 20
21#include <hidl/HidlBinderSupport.h>
21#include <log/log.h> 22#include <log/log.h>
22 23
23#include "DumpstateUtil.h" 24#include "DumpstateUtil.h"
@@ -37,6 +38,11 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
37 // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never 38 // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
38 // be called by dumpstate. 39 // be called by dumpstate.
39 40
41 // Exit when dump is completed since this is a lazy HAL.
42 addPostCommandTask([]() {
43 exit(0);
44 });
45
40 if (handle == nullptr || handle->numFds < 1) { 46 if (handle == nullptr || handle->numFds < 1) {
41 ALOGE("no FDs\n"); 47 ALOGE("no FDs\n");
42 return Void(); 48 return Void();