UsageAccess

Usage access (PACKAGE_USAGE_STATS), a special access granted in Settings, not at runtime.

Functions

Link copied to clipboard
fun isGranted(context: Context): Boolean

True if this app has Usage access: the GET_USAGE_STATS app op is allowed (the Settings toggle), or left at its default with PACKAGE_USAGE_STATS granted (e.g. adb shell pm grant), which the system's usage-stats service accepts too.