Share via


Context.CheckCallingOrSelfPermission(String) Method

Definition

Determine whether the calling process of an IPC <em>or you</em> have been granted a particular permission.

[Android.Runtime.Register("checkCallingOrSelfPermission", "(Ljava/lang/String;)I", "GetCheckCallingOrSelfPermission_Ljava_lang_String_Handler")]
public abstract Android.Content.PM.Permission CheckCallingOrSelfPermission (string permission);
[<Android.Runtime.Register("checkCallingOrSelfPermission", "(Ljava/lang/String;)I", "GetCheckCallingOrSelfPermission_Ljava_lang_String_Handler")>]
abstract member CheckCallingOrSelfPermission : string -> Android.Content.PM.Permission

Parameters

permission
String

The name of the permission being checked.

Returns

PackageManager#PERMISSION_GRANTED if the calling pid/uid is allowed that permission, or PackageManager#PERMISSION_DENIED if it is not.

Attributes

Remarks

Determine whether the calling process of an IPC <em>or you</em> have been granted a particular permission. This is the same as #checkCallingPermission, except it grants your own permissions if you are not currently processing an IPC. Use with care!

Java documentation for android.content.Context.checkCallingOrSelfPermission(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.PM.PackageManager.CheckPermission(System.String%2c+System.String)>
  • <xref:Android.Content.Context.CheckPermission(System.String%2c+System.Int32%2c+System.Int32)>
  • CheckCallingPermission(String)