Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 521d15c5 authored by Steven Moreland's avatar Steven Moreland
Browse files

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
parent af300642
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@


#include "DumpstateDevice.h"
#include "DumpstateDevice.h"


#include <hidl/HidlBinderSupport.h>
#include <log/log.h>
#include <log/log.h>


#include "DumpstateUtil.h"
#include "DumpstateUtil.h"
@@ -37,6 +38,11 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
    // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
    // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
    // be called by dumpstate.
    // be called by dumpstate.


    // Exit when dump is completed since this is a lazy HAL.
    addPostCommandTask([]() {
        exit(0);
    });

    if (handle == nullptr || handle->numFds < 1) {
    if (handle == nullptr || handle->numFds < 1) {
        ALOGE("no FDs\n");
        ALOGE("no FDs\n");
        return Void();
        return Void();
+2 −0
Original line number Original line Diff line number Diff line
@@ -3,3 +3,5 @@ service dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-service
    user system
    user system
    group system
    group system
    interface android.hardware.dumpstate@1.0::IDumpstateDevice default
    interface android.hardware.dumpstate@1.0::IDumpstateDevice default
    oneshot
    disabled