Share via


Context.EnforceCallingUriPermission(Uri, ActivityFlags, String) Method

Definition

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

[Android.Runtime.Register("enforceCallingUriPermission", "(Landroid/net/Uri;ILjava/lang/String;)V", "GetEnforceCallingUriPermission_Landroid_net_Uri_ILjava_lang_String_Handler")]
public abstract void EnforceCallingUriPermission (Android.Net.Uri? uri, Android.Content.ActivityFlags modeFlags, string? message);
[<Android.Runtime.Register("enforceCallingUriPermission", "(Landroid/net/Uri;ILjava/lang/String;)V", "GetEnforceCallingUriPermission_Landroid_net_Uri_ILjava_lang_String_Handler")>]
abstract member EnforceCallingUriPermission : Android.Net.Uri * Android.Content.ActivityFlags * string -> unit

Parameters

uri
Uri

The uri that is being checked.

modeFlags
ActivityFlags

The access modes to enforce.

message
String

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

Attributes

Remarks

If the calling process and user ID has not been granted permission to access a specific URI, throw SecurityException. This is basically the same as calling #enforceUriPermission(Uri, int, int, int, String) with the pid and uid returned by android.os.Binder#getCallingPid and android.os.Binder#getCallingUid. One important difference is that if you are not currently processing an IPC, this function will always throw a SecurityException.

Java documentation for android.content.Context.enforceCallingUriPermission(android.net.Uri, int, java.lang.String).

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

See also

  • <xref:Android.Content.Context.CheckCallingUriPermission(Android.Net.Uri%2c+Android.Content.ActivityFlags)>