diff options
author | Denny cy Lee <dennycylee@google.com> | 2021-06-23 09:17:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-06-23 09:17:35 +0000 |
commit | aeb35cbf2469d7e0f770ae5911b708389ac410b2 (patch) | |
tree | 20311cb4dc6392786e478b91bf724b028660319b /pixelstats | |
parent | 3ac1c7b9b45993c68ace23ed0888f1c35d4f61fd (diff) | |
parent | 40b6d84d5e634b981f3ce84582a941e8a4c07cb5 (diff) | |
download | gs101-aeb35cbf2469d7e0f770ae5911b708389ac410b2.tar.gz |
Pixestat: add battery info am: 1cf072038b am: ee78240150 am: 72fe3ef95b
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/14617774
Change-Id: I152b0bf39e13224f7b72b7954edab08c3b195d42
Diffstat (limited to 'pixelstats')
-rw-r--r-- | pixelstats/service.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index 2bc19b85..cc96789c 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -17,35 +17,37 @@ #define LOG_TAG "pixelstats" #include <android-base/logging.h> -#include <thread> - #include <pixelstats/SysfsCollector.h> #include <pixelstats/UeventListener.h> +#include <thread> + using android::hardware::google::pixel::SysfsCollector; using android::hardware::google::pixel::UeventListener; #define UFSHC_PATH(filename) "/dev/sys/block/bootdevice/" #filename const struct SysfsCollector::SysfsPaths sysfs_paths = { - .SlowioReadCntPath = UFSHC_PATH(slowio_read_cnt), - .SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt), - .SlowioUnmapCntPath = UFSHC_PATH(slowio_unmap_cnt), - .SlowioSyncCntPath = UFSHC_PATH(slowio_sync_cnt), - .UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a), - .UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b), - .UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c), - .UFSHostResetPath = UFSHC_PATH(err_stats/dev_reset_count), - .F2fsStatsPath = "/sys/fs/f2fs/", - .ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance", - .CodecPath = "/sys/devices/platform/audiometrics/codec_state", -}; + .SlowioReadCntPath = UFSHC_PATH(slowio_read_cnt), + .SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt), + .SlowioUnmapCntPath = UFSHC_PATH(slowio_unmap_cnt), + .SlowioSyncCntPath = UFSHC_PATH(slowio_sync_cnt), + .CycleCountBinsPath = "/sys/class/power_supply/battery/cycle_counts", + .UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a), + .UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b), + .UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c), + .UFSHostResetPath = UFSHC_PATH(err_stats/dev_reset_count), + .F2fsStatsPath = "/sys/fs/f2fs/", + .ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance", + .CodecPath = "/sys/devices/platform/audiometrics/codec_state", + .EEPROMPath = "/dev/battery_history"}; const char *const kAudioUevent = "/devices/virtual/amcs/amcs"; +const char *const kSSOCDetailsPath = "/sys/class/power_supply/battery/ssoc_details"; int main() { LOG(INFO) << "starting PixelStats"; - UeventListener ueventListener(kAudioUevent); + UeventListener ueventListener(kAudioUevent, kSSOCDetailsPath); std::thread listenThread(&UeventListener::ListenForever, &ueventListener); listenThread.detach(); |