thermalservice: plumb up Thermal HAL 2.0 and add dump
Thermal HAL 2.0 provides multiple levels of thermal mitigation callback,
currently mapping ThrottlingSeverity::SEVERE and above to is_throttling
to keep same behavior.
In coming CL, the thermalservice API and hardware property manager
service will be updated.
(CL formatted with frameworks/native/.clang-format)
Bug: 111086696
Fixes: 118455688
Test: manually on a b1c1 with ThermalHAL 2.0
Tets: adb shell dumpsys thermalservice
Change-Id: I523edd1bfdf70ab6af07f0a5e996db38a9ae3864
diff --git a/services/thermalservice/libthermalcallback/ThermalCallback.cpp b/services/thermalservice/libthermalcallback/ThermalCallback.cpp
index 5e094fa..0f3132c 100644
--- a/services/thermalservice/libthermalcallback/ThermalCallback.cpp
+++ b/services/thermalservice/libthermalcallback/ThermalCallback.cpp
@@ -1,11 +1,11 @@
#define LOG_TAG "android.hardware.thermal.thermalcallback@1.1-impl"
#include <log/log.h>
-#include "ThermalCallback.h"
-#include "services/thermalservice/ThermalService.h"
-#include <math.h>
#include <android/os/Temperature.h>
#include <hardware/thermal.h>
+#include <cmath>
+#include "ThermalCallback.h"
+#include "services/thermalservice/ThermalService.h"
namespace android {
namespace hardware {
@@ -57,7 +57,7 @@
android::os::Temperature thermal_svc_temp(value, type);
mThermalService->notifyThrottling(isThrottling, thermal_svc_temp);
} else {
- ALOGE("IThermalService binder service not created, drop throttling event");
+ SLOGE("IThermalService binder service not created, drop throttling event");
}
return Void();
}