UriPermissionpublic final class UriPermission extends Object implements android.os.ParcelableDescription of a single Uri permission grant. This grants may have been
created via {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}, etc when sending
an {@link Intent}, or explicitly through
{@link Context#grantUriPermission(String, android.net.Uri, int)}. |
Fields Summary |
---|
private final android.net.Uri | mUri | private final int | mModeFlags | private final long | mPersistedTime | public static final long | INVALID_TIMEValue returned when a permission has not been persisted. | public static final Creator | CREATOR |
Constructors Summary |
---|
public UriPermission(android.net.Uri uri, int modeFlags, long persistedTime){@hide}
mUri = uri;
mModeFlags = modeFlags;
mPersistedTime = persistedTime;
| public UriPermission(android.os.Parcel in){@hide}
mUri = in.readParcelable(null);
mModeFlags = in.readInt();
mPersistedTime = in.readLong();
|
Methods Summary |
---|
public int | describeContents()
return 0;
| public long | getPersistedTime()Return the time when this permission was first persisted, in milliseconds
since January 1, 1970 00:00:00.0 UTC. Returns {@link #INVALID_TIME} if
not persisted.
return mPersistedTime;
| public android.net.Uri | getUri()Return the Uri this permission pertains to.
return mUri;
| public boolean | isReadPermission()Returns if this permission offers read access.
return (mModeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0;
| public boolean | isWritePermission()Returns if this permission offers write access.
return (mModeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0;
| public java.lang.String | toString()
return "UriPermission {uri=" + mUri + ", modeFlags=" + mModeFlags + ", persistedTime="
+ mPersistedTime + "}";
| public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeParcelable(mUri, flags);
dest.writeInt(mModeFlags);
dest.writeLong(mPersistedTime);
|
|