mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "health impl: compare interfaces with their binders"
This commit is contained in:
@@ -261,7 +261,7 @@ ndk::ScopedAStatus Health::unregisterCallback(
|
||||
std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
|
||||
|
||||
auto matches = [callback](const auto& linked) {
|
||||
return linked->callback() == callback; // compares shared_ptr
|
||||
return linked->callback()->asBinder() == callback->asBinder(); // compares binder object
|
||||
};
|
||||
auto it = std::remove_if(callbacks_.begin(), callbacks_.end(), matches);
|
||||
bool removed = (it != callbacks_.end());
|
||||
|
||||
Reference in New Issue
Block a user