Android.Test.Mock.MockContext.EnforceCallingUriPermission Method
If the calling process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException.

Syntax

[Android.Runtime.Register("enforceCallingUriPermission", "(Landroid/net/Uri;ILjava/lang/String;)V", "GetEnforceCallingUriPermission_Landroid_net_Uri_ILjava_lang_String_Handler")]
public override void EnforceCallingUriPermission (Android.Net.Uri uri, [Android.Runtime.GeneratedEnum] Android.Content.ActivityFlags modeFlags, string message)

Parameters

uri
The uri that is being checked.
modeFlags
The type of access to grant. May be one or both of Android.Content.Intent.FLAG_GRANT_READ_URI_PERMISSION or Android.Content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION.
message
A message to include in the exception if it is thrown.

Remarks

If the calling process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException. This is basically the same as calling Android.Content.Context.EnforceUriPermission(Android.Net.Uri, System.Int32, System.Int32, System.Int32, System.Int32) with the pid and uid returned by Android.OS.Binder.CallingPid and Android.OS.Binder.CallingUid. One important difference is that if you are not currently processing an IPC, this function will always throw a SecurityException.

[Android Documentation]

Requirements

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