mirror of
https://github.com/Evolution-X-Devices/device_google_gs201
synced 2026-02-01 05:38:17 +00:00
device: gs201: add speaker health stats
Add the sysfs that required by the new ATOM of VendorSpeakerStatsReported. Copy the file sysfs from ag/15659556 Bug: 201250553 Test: Manually test with ATOM Signed-off-by: Roger Fang <rogerfang@google.com> Change-Id: Ic98d26ebb384e567f7016868777f951f00a0b27d
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#define LOG_TAG "pixelstats"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <pixelstats/SysfsCollector.h>
|
||||
#include <pixelstats/UeventListener.h>
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include <pixelstats/SysfsCollector.h>
|
||||
@@ -38,6 +41,9 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
|
||||
.F2fsStatsPath = "/sys/fs/f2fs/",
|
||||
.ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance",
|
||||
.CodecPath = "/sys/devices/platform/audiometrics/codec_state",
|
||||
.SpeakerTemperaturePath = "/sys/devices/platform/audiometrics/speaker_temp",
|
||||
.SpeakerExcursionPath = "/sys/devices/platform/audiometrics/speaker_excursion",
|
||||
.SpeakerHeartBeatPath = "/sys/devices/platform/audiometrics/speaker_heartbeat",
|
||||
.UFSErrStatsPath = {
|
||||
UFS_ERR_PATH(pa_err_count),
|
||||
UFS_ERR_PATH(dl_err_count),
|
||||
@@ -49,12 +55,14 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
|
||||
},
|
||||
};
|
||||
|
||||
const char *const kAudioUevent = "/devices/virtual/amcs/amcs";
|
||||
const struct UeventListener::UeventPaths ueventPaths = {
|
||||
.AudioUevent = "/devices/virtual/amcs/amcs",
|
||||
};
|
||||
|
||||
int main() {
|
||||
LOG(INFO) << "starting PixelStats";
|
||||
|
||||
UeventListener ueventListener(kAudioUevent);
|
||||
UeventListener ueventListener(ueventPaths);
|
||||
std::thread listenThread(&UeventListener::ListenForever, &ueventListener);
|
||||
listenThread.detach();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user