Language

PackageManager.AddPermissionAsync(PermissionInfo) Method

Definition

Like #addPermission(PermissionInfo) but asynchronously persists the package manager state after returning from the call, allowing it to return quicker and batch a series of adds at the expense of no guarantee the added permission will be retained if the device is rebooted before it is written.

[Android.Runtime.Register("addPermissionAsync", "(Landroid/content/pm/PermissionInfo;)Z", "GetAddPermissionAsync_Landroid_content_pm_PermissionInfo_Handler")]
public abstract bool AddPermissionAsync(Android.Content.PM.PermissionInfo info);
[<Android.Runtime.Register("addPermissionAsync", "(Landroid/content/pm/PermissionInfo;)Z", "GetAddPermissionAsync_Landroid_content_pm_PermissionInfo_Handler")>]
abstract member AddPermissionAsync : Android.Content.PM.PermissionInfo -> bool

Parameters

info
PermissionInfo

The dynamic permission declaration to add or update.

Returns

true if a new permission was created; false if an existing definition was updated.

Attributes

Remarks

Like #addPermission(PermissionInfo) but asynchronously persists the package manager state after returning from the call, allowing it to return quicker and batch a series of adds at the expense of no guarantee the added permission will be retained if the device is rebooted before it is written.

This member is deprecated. Support for dynamic permissions is going to be removed, and apps that use dynamic permissions should declare their permissions statically inside their app manifest instead. This method will become a no-op in a future Android release and eventually be removed from the SDK.

Java documentation for android.content.pm.PackageManager.addPermissionAsync(android.content.pm.PermissionInfo).

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.

Applies to