Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
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

Value returned when a permission has not been persisted.

Constant Value: -9223372036854775808 (0x8000000000000000)

Fields

public static final Creator < UriPermission > CREATOR

Public Methods

public int describeContents ()

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 ()

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 ()

Return the Uri this permission pertains to.

public boolean isReadPermission ()

Returns if this permission offers read access.

public boolean isWritePermission ()

Returns if this permission offers write access.

public String toString ()

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)

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 .