diff options
author | 2025-02-28 11:26:38 -0800 | |
---|---|---|
committer | 2025-02-28 11:26:38 -0800 | |
commit | 9aa43de1af68ee2b00e2b1446e25ad50d5c87750 (patch) | |
tree | 4332dd8133aad36533468d1a42973a715649b358 /native/android/thermal.cpp | |
parent | da3c41b2464c2eeffd55a256d20c63120815d031 (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.cpp | 14 |
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; } } |