Partager via


ContextWrapper.CheckUriPermission Method

Definition

Overloads

CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

Determine whether a particular process and user ID has been granted permission to access a specific URI.

CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags)

Check both a Uri and normal permission.

CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

Determine whether a particular process and user ID has been granted permission to access a specific URI.

[Android.Runtime.Register("checkUriPermission", "(Landroid/net/Uri;III)I", "GetCheckUriPermission_Landroid_net_Uri_IIIHandler")]
public override Android.Content.PM.Permission CheckUriPermission (Android.Net.Uri? uri, int pid, int uid, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("checkUriPermission", "(Landroid/net/Uri;III)I", "GetCheckUriPermission_Landroid_net_Uri_IIIHandler")>]
override this.CheckUriPermission : Android.Net.Uri * int * int * Android.Content.ActivityFlags -> Android.Content.PM.Permission

Parameters

uri
Uri

The uri that is being checked.

pid
Int32

The process ID being checked against. Must be > 0.

uid
Int32

The user ID being checked against. A uid of 0 is the root user, which will pass every permission check.

modeFlags
ActivityFlags

The type of access to grant. May be one or both of GrantReadUriPermission or GrantWriteUriPermission.

Returns

Attributes

Remarks

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

CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags)

Check both a Uri and normal permission.

[Android.Runtime.Register("checkUriPermission", "(Landroid/net/Uri;Ljava/lang/String;Ljava/lang/String;III)I", "GetCheckUriPermission_Landroid_net_Uri_Ljava_lang_String_Ljava_lang_String_IIIHandler")]
public override Android.Content.PM.Permission CheckUriPermission (Android.Net.Uri? uri, string? readPermission, string? writePermission, int pid, int uid, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("checkUriPermission", "(Landroid/net/Uri;Ljava/lang/String;Ljava/lang/String;III)I", "GetCheckUriPermission_Landroid_net_Uri_Ljava_lang_String_Ljava_lang_String_IIIHandler")>]
override this.CheckUriPermission : Android.Net.Uri * string * string * int * int * Android.Content.ActivityFlags -> Android.Content.PM.Permission

Parameters

uri
Uri

The Uri whose permission is to be checked, or null to not do this check.

readPermission
String

The permission that provides overall read access, or null to not do this check.

writePermission
String

The permission that provides overall write access, or null to not do this check.

pid
Int32

The process ID being checked against. Must be > 0.

uid
Int32

The user ID being checked against. A uid of 0 is the root user, which will pass every permission check.

modeFlags
ActivityFlags

The type of access to grant. May be one or both of GrantReadUriPermission or GrantWriteUriPermission.

Returns

Attributes

Remarks

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