summaryrefslogtreecommitdiff
path: root/native/android/thermal.cpp
diff options
context:
space:
mode:
author Xiang Wang <xwxw@google.com> 2025-02-28 11:26:38 -0800
committer Xiang Wang <xwxw@google.com> 2025-02-28 11:26:38 -0800
commit9aa43de1af68ee2b00e2b1446e25ad50d5c87750 (patch)
tree4332dd8133aad36533468d1a42973a715649b358 /native/android/thermal.cpp
parentda3c41b2464c2eeffd55a256d20c63120815d031 (diff)
Add error logging in destructor
Bug: 399754366 Change-Id: I89a8130b76085f188ffc713fa5a8aa87c18f695e Test: n/a Flag: EXEMPT ndk
Diffstat (limited to 'native/android/thermal.cpp')
-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;
}
}