Merge "Migrate battery mitigation to Thermal AIDL" into udc-dev am: 131a418398

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/21996504

Change-Id: Ie79eb2450b3c7b685008e47d83dd5af8e99977bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Xiang Wang 2023-03-23 19:39:35 +00:00 committed by Automerger Merge Worker
commit 4c5028f812
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;