diff options
| author | 2024-05-28 21:00:21 +0000 | |
|---|---|---|
| committer | 2024-05-28 21:00:21 +0000 | |
| commit | eacb2c6312c7b7419b0572d3cca655861ad4a503 (patch) | |
| tree | d3bebc8472c9da22a588c65ea5361a78ab890728 | |
| parent | c5355450867a556bfc9db8af414d657783ca5196 (diff) | |
| parent | 7645a96396acc6a30e502ecfa8f35816b7fc6ad7 (diff) | |
Merge "Clarify details in docs for binderDied()" into main
| -rw-r--r-- | core/java/android/os/IBinder.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/core/java/android/os/IBinder.java b/core/java/android/os/IBinder.java index 91c2965c2505..c9f207cf26e8 100644 --- a/core/java/android/os/IBinder.java +++ b/core/java/android/os/IBinder.java @@ -305,15 +305,28 @@ public interface IBinder { /** * Interface for receiving a callback when the process hosting an IBinder * has gone away. - * + * * @see #linkToDeath */ public interface DeathRecipient { public void binderDied(); /** - * Interface for receiving a callback when the process hosting an IBinder + * The function called when the process hosting an IBinder * has gone away. + * + * This callback will be called from any binder thread like any other binder + * transaction. If the process receiving this notification is multithreaded + * then synchronization may be required because other threads may be executing + * at the same time. + * + * No locks are held in libbinder when {@link binderDied} is called. + * + * There is no need to call {@link unlinkToDeath} in the binderDied callback. + * The binder is already dead so {@link unlinkToDeath} is a no-op. + * It will be unlinked when the last local reference of that binder proxy is + * dropped. + * * @param who The IBinder that has become invalid */ default void binderDied(@NonNull IBinder who) { |