summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--native/android/thermal.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/native/android/thermal.cpp b/native/android/thermal.cpp
index cefcaf7766bb..93e6ed814c34 100644
--- a/native/android/thermal.cpp
+++ b/native/android/thermal.cpp
@@ -139,7 +139,12 @@ AThermalManager::~AThermalManager() {
mStatusListeners.clear();
if (mServiceStatusListener != nullptr) {
bool success = false;
- mThermalSvc->unregisterThermalStatusListener(mServiceStatusListener, &success);
+ auto ret =
+ mThermalSvc->unregisterThermalStatusListener(mServiceStatusListener, &success);
+ if (!success || !ret.isOk()) {
+ ALOGE("Failed in unregisterThermalStatusListener when AThermalManager is being "
+ "destroyed %d", success);
+ }
mServiceStatusListener = nullptr;
}
}
@@ -148,7 +153,12 @@ AThermalManager::~AThermalManager() {
mHeadroomListeners.clear();
if (mServiceHeadroomListener != nullptr) {
bool success = false;
- mThermalSvc->unregisterThermalHeadroomListener(mServiceHeadroomListener, &success);
+ auto ret = mThermalSvc->unregisterThermalHeadroomListener(mServiceHeadroomListener,
+ &success);
+ if (!success || !ret.isOk()) {
+ ALOGE("Failed in unregisterThermalHeadroomListener when AThermalManager is being "
+ "destroyed %d", success);
+ }
mServiceHeadroomListener = nullptr;
}
}