Stay organized with collections
Save and categorize content based on your preferences.
DeathRecipient
interface DeathRecipient
Interface for receiving a callback when the process hosting an IBinder has gone away.
Summary
Public methods |
abstract Unit |
|
open Unit |
The function called when the process hosting an IBinder has gone away.
|
Public methods
binderDied
abstract fun binderDied(): Unit
binderDied
open fun binderDied(who: IBinder): Unit
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 binderDied is called. There is no need to call unlinkToDeath in the binderDied callback. The binder is already dead so unlinkToDeath is a no-op. It will be unlinked when the last local reference of that binder proxy is dropped.
Parameters |
who |
IBinder: The IBinder that has become invalid This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# IBinder.DeathRecipient\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDeathRecipient\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/IBinder.DeathRecipient \"View this page in Java\") \n\n```\ninterface DeathRecipient\n```\n\n|----------------------------------------|\n| [android.os.IBinder.DeathRecipient](#) |\n\nInterface for receiving a callback when the process hosting an IBinder has gone away.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [binderDied](#binderDied())`()` \u003cbr /\u003e |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [binderDied](#binderDied(android.os.IBinder))`(`who:` `[IBinder](/reference/kotlin/android/os/IBinder)`)` The function called when the process hosting an IBinder has gone away. |\n\nPublic methods\n--------------\n\n### binderDied\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun binderDied(): Unit\n``` \n\n### binderDied\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun binderDied(who: IBinder): Unit\n```\n\nThe 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 binderDied is called. There is no need to call unlinkToDeath in the binderDied callback. The binder is already dead so unlinkToDeath is a no-op. It will be unlinked when the last local reference of that binder proxy is dropped.\n\n| Parameters ||\n|-------|-------------------------------------------------------------------------------------------------------------------|\n| `who` | [IBinder](/reference/kotlin/android/os/IBinder): The IBinder that has become invalid This value cannot be `null`. |"]]