PackageManagerCompat

Added in 1.7.0

class PackageManagerCompat


Helper for accessing features in PackageManager.

Summary

Constants

const String!
ACTION_PERMISSION_REVOCATION_SETTINGS = "android.intent.action.AUTO_REVOKE_PERMISSIONS"

Activity action: creates an intent to redirect the user to UI to turn on/off their permission revocation settings.

Public functions

java-static ListenableFuture<Int!>

Returns the status of Unused App Restrictions for the current application.

Constants

ACTION_PERMISSION_REVOCATION_SETTINGS

Added in 1.7.0
const val ACTION_PERMISSION_REVOCATION_SETTINGS = "android.intent.action.AUTO_REVOKE_PERMISSIONS": String!

Activity action: creates an intent to redirect the user to UI to turn on/off their permission revocation settings.

Public functions

getUnusedAppRestrictionsStatus

Added in 1.7.0
java-static fun getUnusedAppRestrictionsStatus(context: Context): ListenableFuture<Int!>

Returns the status of Unused App Restrictions for the current application. In other words, whether the features are available and if so, enabled for the application. The returned value is a ListenableFuture with an Integer corresponding to a value in UnusedAppRestrictionsConstants. The possible values are as follows:

  • ERROR: an error occurred when fetching the availability and status of Unused App Restrictions. Check the logs for the reason (e.g. if the app's target SDK version <30 or the user is in locked device boot mode).
  • FEATURE_NOT_AVAILABLE: there are no available Unused App Restrictions for this app.
  • DISABLED: any available Unused App Restrictions on the device are disabled for this app.
  • API_30_BACKPORT: Unused App Restrictions introduced by Android API 30, and since made available on earlier (API 23-29) devices are enabled for this app: permission auto-reset.
  • API_30: Unused App Restrictions introduced by Android API 30 are enabled for this app: permission auto-reset.
  • API_31: Unused App Restrictions introduced by Android API 31 are enabled for this app: permission auto-reset and app hibernation.
Compatibility behavior: