Merge "health impl: compare interfaces with their binders" am: 1f5c57c965
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1875175 Change-Id: I9e926639f105fac49cee127b60f8c24d8ede2354
This commit is contained in:
commit
e1bc376ed4
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue