PackageManager.SetAutoRevokeWhitelisted(String, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Marks an application exempt from having its permissions be automatically revoked when the app is unused for an extended period of time.
[Android.Runtime.Register("setAutoRevokeWhitelisted", "(Ljava/lang/String;Z)Z", "GetSetAutoRevokeWhitelisted_Ljava_lang_String_ZHandler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS")]
public virtual bool SetAutoRevokeWhitelisted (string packageName, bool whitelisted);
[<Android.Runtime.Register("setAutoRevokeWhitelisted", "(Ljava/lang/String;Z)Z", "GetSetAutoRevokeWhitelisted_Ljava_lang_String_ZHandler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS")>]
abstract member SetAutoRevokeWhitelisted : string * bool -> bool
override this.SetAutoRevokeWhitelisted : string * bool -> bool
Parameters
- packageName
- String
The app for which to set exemption.
- whitelisted
- Boolean
Whether the app should be whitelisted.
Returns
whether any change took effect.
- Attributes
Remarks
Marks an application exempt from having its permissions be automatically revoked when the app is unused for an extended period of time.
Only the installer on record that installed the given package is allowed to call this.
Packages start in whitelisted state, and it is the installer's responsibility to un-whitelist the packages it installs, unless auto-revoking permissions from that package would cause breakages beyond having to re-request the permission(s).
<strong>Note: </strong>In retrospect it would have been preferred to use more inclusive terminology when naming this API. Similar APIs added will refrain from using the term "whitelist".
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.