Android.Test.Mock.MockContext.RevokeUriPermission Method
Remove all permissions to access a particular content provider Uri that were previously added with Android.Content.Context.GrantUriPermission(string, Android.Net.Uri, Android.Net.Uri).

Syntax

[Android.Runtime.Register("revokeUriPermission", "(Landroid/net/Uri;I)V", "GetRevokeUriPermission_Landroid_net_Uri_IHandler")]
public override void RevokeUriPermission (Android.Net.Uri uri, [Android.Runtime.GeneratedEnum] Android.Content.ActivityFlags modeFlags)

Parameters

uri
The Uri you would like to revoke access to.
modeFlags
The desired access modes. Any combination of Android.Content.Intent.FLAG_GRANT_READ_URI_PERMISSION or Android.Content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION.

Remarks

Remove all permissions to access a particular content provider Uri that were previously added with Android.Content.Context.GrantUriPermission(string, Android.Net.Uri, Android.Net.Uri). The given Uri will match all previously granted Uris that are the same or a sub-path of the given Uri. That is, revoking "content://foo/target" will revoke both "content://foo/target" and "content://foo/target/sub", but not "content://foo". It will not remove any prefix grants that exist at a higher level.

Prior to NoType:android/os/Build$VERSION_CODES;Href=../../../../reference/android/os/Build.VERSION_CODES.html#LOLLIPOP, if you did not have regular permission access to a Uri, but had received access to it through a specific Uri permission grant, you could not revoke that grant with this function and a Java.Lang.SecurityException would be thrown. As of NoType:android/os/Build$VERSION_CODES;Href=../../../../reference/android/os/Build.VERSION_CODES.html#LOLLIPOP, this function will not throw a security exception, but will remove whatever permission grants to the Uri had been given to the app (or none).

[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