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: can adb bugreport again
Test: HAL isn't running after 2nd bugreport finishes
Test: manually inspect state using `lshal` and logs
    using `adb logcat | grep android.hardware.dump`
Change-Id: Ib4917807aea9b8359094bc83e972d559546f649b
This commit is contained in:
Steven Moreland
2018-05-01 16:26:21 -07:00
parent eb666e36f6
commit 55a509b643
2 changed files with 9 additions and 0 deletions

View File

@@ -21,6 +21,8 @@
#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <cutils/properties.h>
#include <hidl/HidlBinderSupport.h>
#include <log/log.h>
#include <string.h>
@@ -210,6 +212,11 @@ static void DumpTouch(int fd) {
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
// Exit when dump is completed since this is a lazy HAL.
addPostCommandTask([]() {
exit(0);
});
if (handle == nullptr || handle->numFds < 1) {
ALOGE("no FDs\n");
return Void();

View File

@@ -3,6 +3,8 @@ service vendor.dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-servi
user system
group system
interface android.hardware.dumpstate@1.0::IDumpstateDevice default
oneshot
disabled
on boot
chmod 0444 /sys/kernel/debug/tzdbg/qsee_log