CallerAttribution

Names the app on the other end of a binder transaction.

Every guarded verb reads the caller here, on the binder thread, before it hands the work to a coroutine: Binder.getCallingUid() is only meaningful while the transaction is in flight. A UID resolves to a package once and is remembered, because the same app calls thousands of times. install has to run before the first transaction; HostService does it in onCreate.

Functions

Link copied to clipboard

The calling app's package name, or null when the UID resolves to no package or nothing was installed. The host's own process resolves to its own package name.

Link copied to clipboard
fun install(context: Context)

Remembers the application context the package lookups go through.