PackageInstaller.SessionParams.SetPermissionState Method

Definition

Sets the state of permissions for the package at installation.

[Android.Runtime.Register("setPermissionState", "(Ljava/lang/String;I)Landroid/content/pm/PackageInstaller$SessionParams;", "GetSetPermissionState_Ljava_lang_String_IHandler", ApiSince=34)]
public virtual Android.Content.PM.PackageInstaller.SessionParams SetPermissionState(string permissionName, Android.Content.PM.PackageInstallerPermissionState state);
[<Android.Runtime.Register("setPermissionState", "(Ljava/lang/String;I)Landroid/content/pm/PackageInstaller$SessionParams;", "GetSetPermissionState_Ljava_lang_String_IHandler", ApiSince=34)>]
abstract member SetPermissionState : string * Android.Content.PM.PackageInstallerPermissionState -> Android.Content.PM.PackageInstaller.SessionParams
override this.SetPermissionState : string * Android.Content.PM.PackageInstallerPermissionState -> Android.Content.PM.PackageInstaller.SessionParams

Parameters

permissionName
String

The permission to change state for. This value cannot be null.

state
PackageInstallerPermissionState

Either PERMISSION_STATE_DEFAULT, PERMISSION_STATE_GRANTED, or PERMISSION_STATE_DENIED to set the permission to. Value is one of the following: PERMISSION_STATE_DEFAULT; PERMISSION_STATE_GRANTED; PERMISSION_STATE_DENIED

Returns

This object for easier chaining. This value cannot be null.

Attributes

Remarks

Sets the state of permissions for the package at installation. Granting any runtime permissions require the android.Manifest.permission#INSTALL_GRANT_RUNTIME_PERMISSIONS permission to be held by the caller. Revoking runtime permissions is not allowed, even during app update sessions.

Android reference for android.content.pm.PackageInstaller.SessionParams.setPermissionState.

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