ContextWrapper.RevokeUriPermission Method

Definition

Overloads

Name Description
RevokeUriPermission(Uri, ActivityFlags)

Remove all permissions to access a particular content provider Uri that were previously added with M:Android.Content.Context.GrantUriPermission(System.String,Android.Net.Uri,Android.Net.Uri).

RevokeUriPermission(String, Uri, ActivityFlags)

Remove permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) for a specific target package. 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. Unlike revokeUriPermission(Uri,int) , this method will only revoke permissions that had been explicitly granted through grantUriPermission(String, Uri, int) and only for the package specified. Any matching grants that have happened through other mechanisms (clipboard, activity launching, service starting, etc) will not be removed.

RevokeUriPermission(Uri, ActivityFlags)

Remove all permissions to access a particular content provider Uri that were previously added with M:Android.Content.Context.GrantUriPermission(System.String,Android.Net.Uri,Android.Net.Uri).

[Android.Runtime.Register("revokeUriPermission", "(Landroid/net/Uri;I)V", "GetRevokeUriPermission_Landroid_net_Uri_IHandler")]
public override void RevokeUriPermission(Android.Net.Uri? uri, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("revokeUriPermission", "(Landroid/net/Uri;I)V", "GetRevokeUriPermission_Landroid_net_Uri_IHandler")>]
override this.RevokeUriPermission : Android.Net.Uri * Android.Content.ActivityFlags -> unit

Parameters

uri
Uri

The Uri you would like to revoke access to.

modeFlags
ActivityFlags

The desired access modes. Any combination of GrantReadUriPermission or GrantWriteUriPermission.

Attributes

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

RevokeUriPermission(String, Uri, ActivityFlags)

Remove permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) for a specific target package. 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. Unlike revokeUriPermission(Uri,int) , this method will only revoke permissions that had been explicitly granted through grantUriPermission(String, Uri, int) and only for the package specified. Any matching grants that have happened through other mechanisms (clipboard, activity launching, service starting, etc) will not be removed.

[Android.Runtime.Register("revokeUriPermission", "(Ljava/lang/String;Landroid/net/Uri;I)V", "GetRevokeUriPermission_Ljava_lang_String_Landroid_net_Uri_IHandler", ApiSince=26)]
public override void RevokeUriPermission(string? targetPackage, Android.Net.Uri? uri, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("revokeUriPermission", "(Ljava/lang/String;Landroid/net/Uri;I)V", "GetRevokeUriPermission_Ljava_lang_String_Landroid_net_Uri_IHandler", ApiSince=26)>]
override this.RevokeUriPermission : string * Android.Net.Uri * Android.Content.ActivityFlags -> unit

Parameters

targetPackage
String

The package you had previously granted access to.

uri
Uri

The Uri you would like to revoke access to.

modeFlags
ActivityFlags

The access modes to revoke. Value is either 0 or a combination of the following: Intent.FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION

Attributes

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.

Java documentation for android.content.ContextWrapper.revokeUriPermission(java.lang.String, android.net.Uri, int).

Applies to