AppLabels

class AppLabels(packageManager: PackageManager)

App display names for one tool call, cached so each package is looked up once.

Constructors

Link copied to clipboard
constructor(packageManager: PackageManager)

Functions

Link copied to clipboard
fun labelFor(packageName: String, appInfo: ApplicationInfo? = null): String?

The display name of packageName, or null when it can't be resolved. Pass appInfo when the caller already has it (a notification carries its app's): that works even when Android 11+ package visibility hides the app from getApplicationInfo.