Added in API level 19

UriPermission


class UriPermission : Parcelable
kotlin.Any
   ↳ android.content.UriPermission

Description of a single Uri permission grant. This grants may have been created via Intent.FLAG_GRANT_READ_URI_PERMISSION, etc when sending an Intent, or explicitly through Context.grantUriPermission(String, android.net.Uri, int).

Summary

Constants
static Long

Value returned when a permission has not been persisted.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Long

Return the time when this permission was first persisted, in milliseconds since January 1, 1970 00:00:00.

Uri!

Return the Uri this permission pertains to.

Boolean

Returns if this permission offers read access.

Boolean

Returns if this permission offers write access.

String

Returns a string representation of the object.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<UriPermission!>

Constants

INVALID_TIME

Added in API level 19
static val INVALID_TIME: Long

Value returned when a permission has not been persisted.

Value: -9223372036854775808L

Public methods

describeContents

Added in API level 19
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getPersistedTime

Added in API level 19
fun getPersistedTime(): Long

Return the time when this permission was first persisted, in milliseconds since January 1, 1970 00:00:00.0 UTC. Returns INVALID_TIME if not persisted.

getUri

Added in API level 19
fun getUri(): Uri!

Return the Uri this permission pertains to.

isReadPermission

Added in API level 19
fun isReadPermission(): Boolean

Returns if this permission offers read access.

isWritePermission

Added in API level 19
fun isWritePermission(): Boolean

Returns if this permission offers write access.

toString

Added in API level 19
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

Added in API level 19
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 19
static val CREATOR: Parcelable.Creator<UriPermission!>