Context.EnforceUriPermission Context.EnforceUriPermission Method

Definition

Overloads

EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String) EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String)

If a particular process and user ID has not been granted permission to access a specific URI, throw SecurityException.

EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String) EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String)

Enforce both a Uri and normal permission.

EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String) EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String)

If a particular process and user ID has not been granted permission to access a specific URI, throw SecurityException.

[Android.Runtime.Register("enforceUriPermission", "(Landroid/net/Uri;IIILjava/lang/String;)V", "GetEnforceUriPermission_Landroid_net_Uri_IIILjava_lang_String_Handler")]
public abstract void EnforceUriPermission (Android.Net.Uri uri, int pid, int uid, Android.Content.ActivityFlags modeFlags, string message);
abstract member EnforceUriPermission : Android.Net.Uri * int * int * Android.Content.ActivityFlags * string -> unit

Parameters

uri
Uri Uri

The uri that is being checked.

pid
Int32 Int32

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

uid
Int32 Int32

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

modeFlags
ActivityFlags ActivityFlags

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

message
String String

A message to include in the exception if it is thrown.

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.

EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String) EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String)

Enforce both a Uri and normal permission.

[Android.Runtime.Register("enforceUriPermission", "(Landroid/net/Uri;Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;)V", "GetEnforceUriPermission_Landroid_net_Uri_Ljava_lang_String_Ljava_lang_String_IIILjava_lang_String_Handler")]
public abstract void EnforceUriPermission (Android.Net.Uri uri, string readPermission, string writePermission, int pid, int uid, Android.Content.ActivityFlags modeFlags, string message);
abstract member EnforceUriPermission : Android.Net.Uri * string * string * int * int * Android.Content.ActivityFlags * string -> unit

Parameters

uri
Uri Uri

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

readPermission
String String

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

writePermission
String String

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

pid
Int32 Int32

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

uid
Int32 Int32

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

modeFlags
ActivityFlags ActivityFlags

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

message
String String

A message to include in the exception if it is thrown.

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