to top
Android APIs
public final class

UriPermission

extends Object
implements Parcelable
java.lang.Object
   ↳ android.content.UriPermission

Class Overview

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

Summary

Constants
long INVALID_TIME Value returned when a permission has not been persisted.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<UriPermission> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
long getPersistedTime()
Return the time when this permission was first persisted, in milliseconds since January 1, 1970 00:00:00.0 UTC.
Uri getUri()
Return the Uri this permission pertains to.
boolean isReadPermission()
Returns if this permission offers read access.
boolean isWritePermission()
Returns if this permission offers write access.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final long INVALID_TIME

Added in API level 19

Value returned when a permission has not been persisted.

Constant Value: -9223372036854775808 (0x8000000000000000)

Fields

public static final Creator<UriPermission> CREATOR

Added in API level 19

Public Methods

public int describeContents ()

Added in API level 19

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

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public long getPersistedTime ()

Added in API level 19

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.

public Uri getUri ()

Added in API level 19

Return the Uri this permission pertains to.

public boolean isReadPermission ()

Added in API level 19

Returns if this permission offers read access.

public boolean isWritePermission ()

Added in API level 19

Returns if this permission offers write access.

public String toString ()

Added in API level 19

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 19

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.