共用方式為


Context.EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String) Method

Definition

If the calling process of an IPC <em>or you</em> has not been granted permission to access a specific URI, throw SecurityException.

[Android.Runtime.Register("enforceCallingOrSelfUriPermission", "(Landroid/net/Uri;ILjava/lang/String;)V", "GetEnforceCallingOrSelfUriPermission_Landroid_net_Uri_ILjava_lang_String_Handler")]
public abstract void EnforceCallingOrSelfUriPermission (Android.Net.Uri? uri, Android.Content.ActivityFlags modeFlags, string? message);
[<Android.Runtime.Register("enforceCallingOrSelfUriPermission", "(Landroid/net/Uri;ILjava/lang/String;)V", "GetEnforceCallingOrSelfUriPermission_Landroid_net_Uri_ILjava_lang_String_Handler")>]
abstract member EnforceCallingOrSelfUriPermission : 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 of an IPC <em>or you</em> has not been granted permission to access a specific URI, throw SecurityException. This is the same as #enforceCallingUriPermission, except it grants your own permissions if you are not currently processing an IPC. Use with care!

Java documentation for android.content.Context.enforceCallingOrSelfUriPermission(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.CheckCallingOrSelfUriPermission(Android.Net.Uri%2c+Android.Content.ActivityFlags)>