Context.CheckUriPermissions(IList<Uri>, Int32, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determine whether a particular process and user ID has been granted permission to access a list of URIs.
[Android.Runtime.Register("checkUriPermissions", "(Ljava/util/List;III)[I", "GetCheckUriPermissions_Ljava_util_List_IIIHandler", ApiSince=31)]
public virtual int[] CheckUriPermissions (System.Collections.Generic.IList<Android.Net.Uri> uris, int pid, int uid, int modeFlags);
[<Android.Runtime.Register("checkUriPermissions", "(Ljava/util/List;III)[I", "GetCheckUriPermissions_Ljava_util_List_IIIHandler", ApiSince=31)>]
abstract member CheckUriPermissions : System.Collections.Generic.IList<Android.Net.Uri> * int * int * int -> int[]
override this.CheckUriPermissions : System.Collections.Generic.IList<Android.Net.Uri> * int * int * int -> int[]
Parameters
- 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.
- modeFlags
- Int32
The access modes to check for the list of uris
Returns
Array of permission grants corresponding to each entry in the list of uris.
PackageManager#PERMISSION_GRANTED
if the given pid/uid is allowed to access that uri,
or PackageManager#PERMISSION_DENIED
if it is not.
- Attributes
Remarks
Determine whether a particular process and user ID has been granted permission to access a list of URIs. This only checks for permissions that have been explicitly granted -- if the given process/uid has more general access to the URI's content provider then this check will always fail.
<strong>Note:</strong> On SDK Version android.os.Build.VERSION_CODES#S
, calling this method from a secondary-user's context will incorrectly return PackageManager#PERMISSION_DENIED
for all {code uris}.
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.