diff options
author | Yifan Hong | 2018-04-04 17:28:19 -0500 |
---|---|---|
committer | Yifan Hong | 2018-04-04 17:32:53 -0500 |
commit | 81b2833a2f800c69b74ed6a8c4de58322ca39b1b (patch) | |
tree | 87d06826d8b78321cc4bb2e89712d4512f4f3858 /health | |
parent | a71ab794a631fd9453ac7c4d718c69bfc323eb89 (diff) | |
download | platform-hardware-interfaces-81b2833a2f800c69b74ed6a8c4de58322ca39b1b.tar.gz platform-hardware-interfaces-81b2833a2f800c69b74ed6a8c4de58322ca39b1b.tar.xz platform-hardware-interfaces-81b2833a2f800c69b74ed6a8c4de58322ca39b1b.zip |
health: expand debug info.
Test: lshal -m android.hardware.health@2.0::IHealth/default
Test: lshal -m android.hardware.health@2.0::IHealth/backup
Bug: 74057048
Change-Id: Iaca0a7fd32209522d7d759342b98d6e6898595ac
Diffstat (limited to 'health')
-rw-r--r-- | health/2.0/default/Health.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/health/2.0/default/Health.cpp b/health/2.0/default/Health.cpp index 7a3e6504..6d3be992 100644 --- a/health/2.0/default/Health.cpp +++ b/health/2.0/default/Health.cpp | |||
@@ -16,6 +16,7 @@ | |||
16 | #define LOG_TAG "android.hardware.health@2.0-impl" | 16 | #define LOG_TAG "android.hardware.health@2.0-impl" |
17 | #include <android-base/logging.h> | 17 | #include <android-base/logging.h> |
18 | 18 | ||
19 | #include <android-base/file.h> | ||
19 | #include <health2/Health.h> | 20 | #include <health2/Health.h> |
20 | 21 | ||
21 | #include <hal_conversion.h> | 22 | #include <hal_conversion.h> |
@@ -189,6 +190,17 @@ Return<void> Health::debug(const hidl_handle& handle, const hidl_vec<hidl_string | |||
189 | if (handle != nullptr && handle->numFds >= 1) { | 190 | if (handle != nullptr && handle->numFds >= 1) { |
190 | int fd = handle->data[0]; | 191 | int fd = handle->data[0]; |
191 | battery_monitor_->dumpState(fd); | 192 | battery_monitor_->dumpState(fd); |
193 | |||
194 | getHealthInfo([fd](auto res, const auto& info) { | ||
195 | android::base::WriteStringToFd("\ngetHealthInfo -> ", fd); | ||
196 | if (res == Result::SUCCESS) { | ||
197 | android::base::WriteStringToFd(toString(info), fd); | ||
198 | } else { | ||
199 | android::base::WriteStringToFd(toString(res), fd); | ||
200 | } | ||
201 | android::base::WriteStringToFd("\n", fd); | ||
202 | }); | ||
203 | |||
192 | fsync(fd); | 204 | fsync(fd); |
193 | } | 205 | } |
194 | return Void(); | 206 | return Void(); |