Stay organized with collections
Save and categorize content based on your preferences.
IBinder.DeathRecipient
public
static
interface
IBinder.DeathRecipient
android.os.IBinder.DeathRecipient
|
Interface for receiving a callback when the process hosting an IBinder
has gone away.
Summary
Public methods |
abstract
void
|
binderDied()
|
default
void
|
binderDied(IBinder who)
The function called when the process hosting an IBinder
has gone away.
|
Public methods
binderDied
public abstract void binderDied ()
binderDied
public void binderDied (IBinder who)
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 ERROR(/binderDied)
is called.
There is no need to call ERROR(/unlinkToDeath)
in the binderDied callback.
The binder is already dead so ERROR(/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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nIBinder.DeathRecipient\n======================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/os/IBinder.DeathRecipient \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nIBinder.DeathRecipient\n`\n\n\n`\n\n\n`\n\n|-----------------------------------|\n| android.os.IBinder.DeathRecipient |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for receiving a callback when the process hosting an IBinder\nhas gone away. \n**See also:**\n\n- [IBinder.linkToDeath(DeathRecipient, int)](/reference/android/os/IBinder#linkToDeath(android.os.IBinder.DeathRecipient,%20int))\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[binderDied](/reference/android/os/IBinder.DeathRecipient#binderDied())`() ` |\n| ` default void` | ` `[binderDied](/reference/android/os/IBinder.DeathRecipient#binderDied(android.os.IBinder))`(`[IBinder](/reference/android/os/IBinder)` who) ` 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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void binderDied ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### binderDied\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void binderDied (IBinder who)\n```\n\nThe function called when the process hosting an IBinder\nhas gone away.\n\nThis callback will be called from any binder thread like any other binder\ntransaction. If the process receiving this notification is multithreaded\nthen synchronization may be required because other threads may be executing\nat the same time.\n\nNo locks are held in libbinder when [ERROR(/binderDied)](/) is called.\n\nThere is no need to call [ERROR(/unlinkToDeath)](/) in the binderDied callback.\nThe binder is already dead so [ERROR(/unlinkToDeath)](/) is a no-op.\nIt will be unlinked when the last local reference of that binder proxy is\ndropped.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|------------------------------------------------------------------------------------|\n| `who` | `IBinder`: The IBinder that has become invalid This value cannot be `null`. \u003cbr /\u003e |"]]