Skip to content

Most visited

Recently visited

navigation
Added in API level 19

UriPermission

public final class UriPermission
extends Object implements Parcelable

java.lang.Object
   ↳ android.content.UriPermission


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

See also:

Summary

Constants

long INVALID_TIME

Value returned when a permission has not been persisted.

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.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Constants

INVALID_TIME

Added in API level 19
long INVALID_TIME

Value returned when a permission has not been persisted.

Constant Value: -9223372036854775808 (0x8000000000000000)

Fields

CREATOR

Added in API level 19
Creator<UriPermission> CREATOR

Public methods

describeContents

Added in API level 19
int describeContents ()

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

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

getPersistedTime

Added in API level 19
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.

Returns
long

See also:

getUri

Added in API level 19
Uri getUri ()

Return the Uri this permission pertains to.

Returns
Uri

isReadPermission

Added in API level 19
boolean isReadPermission ()

Returns if this permission offers read access.

Returns
boolean

isWritePermission

Added in API level 19
boolean isWritePermission ()

Returns if this permission offers write access.

Returns
boolean

toString

Added in API level 19
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
String a printable representation of this object.

writeToParcel

Added in API level 19
void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.