Added in API level 19

UriPermission


class UriPermission : Parcelable

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
Int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

Int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel: the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point.

Public methods
Int

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

Unit
writeToParcel(dest: Parcel, flags: Int)

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
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

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
Return
String a string representation of the object.

writeToParcel

Added in API level 19
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

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