From 5fc076011ca247da94426196f125aa1ee4040fa0 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Mon, 11 Apr 2022 15:35:05 +0000 Subject: [PATCH] Implements AIDL multi-HAL debug dump Bug: 228645167 Test: adb shell dumpsys android.hardware.sensors.ISensors/default Change-Id: If5985d669d5fae6ca99d0156f61841f868c8c60f --- sensors/aidl/default/multihal/HalProxyAidl.cpp | 12 ++++++++++++ sensors/aidl/default/multihal/include/HalProxyAidl.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/sensors/aidl/default/multihal/HalProxyAidl.cpp b/sensors/aidl/default/multihal/HalProxyAidl.cpp index 64805e6638..327db124c8 100644 --- a/sensors/aidl/default/multihal/HalProxyAidl.cpp +++ b/sensors/aidl/default/multihal/HalProxyAidl.cpp @@ -206,6 +206,18 @@ static ::android::hardware::sensors::V1_0::SharedMemInfo convertSharedMemInfo( resultToBinderStatus(HalProxy::unregisterDirectChannel(in_channelHandle))); } +binder_status_t HalProxyAidl::dump(int fd, const char ** /* args */, + uint32_t /* numArgs */) { + native_handle_t *nativeHandle = + native_handle_create(1 /* numFds */, 0 /* numInts */); + nativeHandle->data[0] = fd; + + HalProxy::debug(nativeHandle, {} /* args */); + + native_handle_delete(nativeHandle); + return STATUS_OK; +} + } // namespace implementation } // namespace sensors } // namespace hardware diff --git a/sensors/aidl/default/multihal/include/HalProxyAidl.h b/sensors/aidl/default/multihal/include/HalProxyAidl.h index 7401726cf9..5c81715933 100644 --- a/sensors/aidl/default/multihal/include/HalProxyAidl.h +++ b/sensors/aidl/default/multihal/include/HalProxyAidl.h @@ -55,6 +55,8 @@ class HalProxyAidl : public ::android::hardware::sensors::V2_1::implementation:: ::ndk::ScopedAStatus setOperationMode( ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) override; ::ndk::ScopedAStatus unregisterDirectChannel(int32_t in_channelHandle) override; + + binder_status_t dump(int fd, const char **args, uint32_t numArgs) override; }; } // namespace implementation