Added in API level 1

DeathRecipient


interface DeathRecipient
android.os.IBinder.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

Added in API level 1
abstract fun binderDied(): Unit

binderDied

Added in API level 34
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.