Context.EnforcePermission(String, Int32, Int32, String) Context.EnforcePermission(String, Int32, Int32, String) Method


If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException.

[Android.Runtime.Register("enforcePermission", "(Ljava/lang/String;IILjava/lang/String;)V", "GetEnforcePermission_Ljava_lang_String_IILjava_lang_String_Handler")]
public abstract void EnforcePermission (string permission, int pid, int uid, string message);
abstract member EnforcePermission : string * int * int * string -> unit


String String

The name of the permission being checked.

Int32 Int32

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

Int32 Int32

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

String String

A message to include in the exception if it is thrown.


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