From 16687cbce9e17930852f19f937fc2c073c2c8769 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 31 Mar 2020 14:21:01 -0700 Subject: Document linkToDeath behavior on object cleanup. In Java, this has always been the case, but it wasn't documented. Bug: 152627219 Test: n/A Change-Id: I8d93d2876bac8f16101a30afdf06699ece653d25 --- core/java/android/os/IBinder.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/java/android/os/IBinder.java b/core/java/android/os/IBinder.java index c43644dbd960..f6eb8c2799ea 100644 --- a/core/java/android/os/IBinder.java +++ b/core/java/android/os/IBinder.java @@ -293,13 +293,16 @@ public interface IBinder { * then the given {@link DeathRecipient}'s * {@link DeathRecipient#binderDied DeathRecipient.binderDied()} method * will be called. - * + * + *

This will automatically be unlinked when all references to the linked + * binder proxy are dropped.

+ * *

You will only receive death notifications for remote binders, - * as local binders by definition can't die without you dying as well. - * + * as local binders by definition can't die without you dying as well.

+ * * @throws RemoteException if the target IBinder's * process has already died. - * + * * @see #unlinkToDeath */ public void linkToDeath(@NonNull DeathRecipient recipient, int flags) -- cgit v1.2.3-59-g8ed1b