From ea2ab0b7b4c129f30357609ea77a317613439324 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 31 Mar 2020 14:27:20 -0700 Subject: Document linkToDeath behavior on object cleanup. Note, this is documentation for behavior that was changed in R (for sanity but also to make things consistent with Java). Bug: 152627219 Test: n/A Change-Id: If48fa48db20b0158989ae8181eb9d4d0b22ce4b8 --- libs/binder/include/binder/IBinder.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/binder/include/binder/IBinder.h b/libs/binder/include/binder/IBinder.h index 64604b74f0..eea0e89738 100644 --- a/libs/binder/include/binder/IBinder.h +++ b/libs/binder/include/binder/IBinder.h @@ -173,6 +173,10 @@ public: * The @a cookie is optional -- if non-NULL, it should be a * memory address that you own (that is, you know it is unique). * + * @note When all references to the binder being linked to are dropped, the + * recipient is automatically unlinked. So, you must hold onto a binder in + * order to receive death notifications about it. + * * @note You will only receive death notifications for remote binders, * as local binders by definition can't die without you dying as well. * Trying to use this function on a local binder will result in an -- cgit v1.2.3-59-g8ed1b