Migrate battery mitigation to Thermal AIDL

Bug: b/269163592
Test: Thermal AIDL service restart test + pmic file test
Change-Id: I4922b0f7c6c2583143fcdd24e3039e17ced4a68b
This commit is contained in:
Xiang Wang 2023-02-21 15:14:42 -08:00
parent 75a5c5dceb
commit f060fe353c
2 changed files with 5 additions and 2 deletions

View File

@ -36,10 +36,10 @@ cc_binary {
"libbinder_ndk",
"libcutils",
"libhardware",
"libhidlbase",
"liblog",
"libutils",
"android.hardware.thermal@2.0"
"android.hardware.thermal@2.0",
"android.hardware.thermal-V1-ndk"
],
srcs: [
"battery_mitigation.cpp",

View File

@ -17,6 +17,7 @@
#define LOG_TAG "battery-mitigation"
#include <battery_mitigation/BatteryMitigation.h>
#include <android/binder_process.h>
using android::hardware::google::pixel::BatteryMitigation;
using android::hardware::google::pixel::MitigationConfig;
@ -73,6 +74,8 @@ const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
int main(int /*argc*/, char ** /*argv*/) {
auto batteryMitigationStartTime = std::chrono::system_clock::now();
ABinderProcess_setThreadPoolMaxThreadCount(1);
ABinderProcess_startThreadPool();
bmSp = new BatteryMitigation(cfg);
if (!bmSp) {
return 0;