Merge "health impl: compare interfaces with their binders" am: 1f5c57c965 am: e1bc376ed4 am: 2faf3adc25 am: f23ab16751 am: a9c420d770

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

Change-Id: I53859b8fde62e359bf6756350de14b9d4f6c53fa
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index 2d91ce0..812e64a 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -261,7 +261,7 @@
     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());