Add UeventListener to pixelstats in gs101
Bug: 171793497 Test: Ensure that uevent listener reports data to statsd Change-Id: I9e90f8483298934a78320f37dbf5eb1ac38e8f97
This commit is contained in:
parent
d95bbb9740
commit
33a1ce7421
2 changed files with 10 additions and 0 deletions
|
@ -17,10 +17,13 @@
|
|||
#define LOG_TAG "pixelstats"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <thread>
|
||||
|
||||
#include <pixelstats/SysfsCollector.h>
|
||||
#include <pixelstats/UeventListener.h>
|
||||
|
||||
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 = {
|
||||
|
@ -38,6 +41,10 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
|
|||
int main() {
|
||||
LOG(INFO) << "starting PixelStats";
|
||||
|
||||
UeventListener ueventListener("");
|
||||
std::thread listenThread(&UeventListener::ListenForever, &ueventListener);
|
||||
listenThread.detach();
|
||||
|
||||
SysfsCollector collector(sysfs_paths);
|
||||
collector.collect(); // This blocks forever.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue