Aracılığıyla paylaş


Context.CheckPermission(String, Int32, Int32) Method

Definition

Determine whether the given permission is allowed for a particular process and user ID running in the system.

[Android.Runtime.Register("checkPermission", "(Ljava/lang/String;II)I", "GetCheckPermission_Ljava_lang_String_IIHandler")]
public abstract Android.Content.PM.Permission CheckPermission (string permission, int pid, int uid);
[<Android.Runtime.Register("checkPermission", "(Ljava/lang/String;II)I", "GetCheckPermission_Ljava_lang_String_IIHandler")>]
abstract member CheckPermission : string * int * int -> Android.Content.PM.Permission

Parameters

permission
String

The name of the permission being checked.

pid
Int32

The process ID being checked against. Must be > 0.

uid
Int32

The UID being checked against. A uid of 0 is the root user, which will pass every permission check.

Returns

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

Attributes

Remarks

Determine whether the given permission is allowed for a particular process and user ID running in the system.

Java documentation for android.content.Context.checkPermission(java.lang.String, int, int).

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