Pixestat: add battery info am: 1cf072038b

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/14617774

Change-Id: Idc11b511b67e2c25bcc22831a8da0ef240cee89c
This commit is contained in:
Denny cy Lee 2021-06-23 08:33:26 +00:00 committed by Automerger Merge Worker
commit 6fb6154097

View file

@ -17,11 +17,11 @@
#define LOG_TAG "pixelstats" #define LOG_TAG "pixelstats"
#include <android-base/logging.h> #include <android-base/logging.h>
#include <thread>
#include <pixelstats/SysfsCollector.h> #include <pixelstats/SysfsCollector.h>
#include <pixelstats/UeventListener.h> #include <pixelstats/UeventListener.h>
#include <thread>
using android::hardware::google::pixel::SysfsCollector; using android::hardware::google::pixel::SysfsCollector;
using android::hardware::google::pixel::UeventListener; using android::hardware::google::pixel::UeventListener;
@ -31,6 +31,7 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
.SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt), .SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt),
.SlowioUnmapCntPath = UFSHC_PATH(slowio_unmap_cnt), .SlowioUnmapCntPath = UFSHC_PATH(slowio_unmap_cnt),
.SlowioSyncCntPath = UFSHC_PATH(slowio_sync_cnt), .SlowioSyncCntPath = UFSHC_PATH(slowio_sync_cnt),
.CycleCountBinsPath = "/sys/class/power_supply/battery/cycle_counts",
.UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a), .UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a),
.UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b), .UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b),
.UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c), .UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c),
@ -38,14 +39,15 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
.F2fsStatsPath = "/sys/fs/f2fs/", .F2fsStatsPath = "/sys/fs/f2fs/",
.ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance", .ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance",
.CodecPath = "/sys/devices/platform/audiometrics/codec_state", .CodecPath = "/sys/devices/platform/audiometrics/codec_state",
}; .EEPROMPath = "/dev/battery_history"};
const char *const kAudioUevent = "/devices/virtual/amcs/amcs"; const char *const kAudioUevent = "/devices/virtual/amcs/amcs";
const char *const kSSOCDetailsPath = "/sys/class/power_supply/battery/ssoc_details";
int main() { int main() {
LOG(INFO) << "starting PixelStats"; LOG(INFO) << "starting PixelStats";
UeventListener ueventListener(kAudioUevent); UeventListener ueventListener(kAudioUevent, kSSOCDetailsPath);
std::thread listenThread(&UeventListener::ListenForever, &ueventListener); std::thread listenThread(&UeventListener::ListenForever, &ueventListener);
listenThread.detach(); listenThread.detach();