Android.Content.ContextWrapper.EnforceUriPermission Method
If a particular process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException.

Syntax

[Android.Runtime.Register("enforceUriPermission", "(Landroid/net/Uri;IIILjava/lang/String;)V", "GetEnforceUriPermission_Landroid_net_Uri_IIILjava_lang_String_Handler")]
public override void EnforceUriPermission (Android.Net.Uri uri, int pid, int uid, [Android.Runtime.GeneratedEnum] ActivityFlags modeFlags, string message)

Parameters

uri
The uri that is being checked.
pid
The process ID being checked against. Must be > 0.
uid
The user ID being checked against. A uid of 0 is the root user, which will pass every permission check.
modeFlags
The type of access to grant. May be one or both of Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION.
message
A message to include in the exception if it is thrown.

Remarks

If a particular process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException. This only checks for permissions that have been explicitly granted -- if the given process/uid has more general access to the URI's content provider then this check will always fail.

[Android Documentation]

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1