Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bcb6184 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge "health impl: compare interfaces with their binders" am: 1f5c57c9 am:...

Merge "health impl: compare interfaces with their binders" am: 1f5c57c9 am: e1bc376e am: 2faf3adc am: f23ab167 am: a9c420d7

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1875175

Change-Id: I53859b8fde62e359bf6756350de14b9d4f6c53fa
parents c1bfa2db a9c420d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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());