public final class InputContentInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<InputContentInfo> |
CREATOR
Used to make this class parcelable.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
InputContentInfo(Uri contentUri,
ClipDescription description)
Constructs
InputContentInfo object only with mandatory data. |
InputContentInfo(Uri contentUri,
ClipDescription description,
Uri linkUri)
Constructs
InputContentInfo object with additional link URI. |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
Uri |
getContentUri() |
ClipDescription |
getDescription() |
Uri |
getLinkUri() |
void |
releasePermission()
Releases a temporary read-only access permission for content URI associated with this object.
|
void |
requestPermission()
Requests a temporary read-only access permission for content URI associated with this object.
|
boolean |
validate() |
void |
writeToParcel(Parcel dest,
int flags)
Used to package this object into a
Parcel . |
public static final Parcelable.Creator<InputContentInfo> CREATOR
public InputContentInfo(Uri contentUri, ClipDescription description)
InputContentInfo
object only with mandatory data.contentUri
- Content URI to be exported from the input method.
This cannot be null
.description
- A ClipDescription
object that contains the metadata of
contentUri
such as MIME type(s). This object cannot be null
. Also
ClipDescription.getLabel()
should be describing the content specified by
contentUri
for accessibility reasons.public InputContentInfo(Uri contentUri, ClipDescription description, Uri linkUri)
InputContentInfo
object with additional link URI.contentUri
- Content URI to be exported from the input method.
This cannot be null
.description
- A ClipDescription
object that contains the metadata of
contentUri
such as MIME type(s). This object cannot be null
. Also
ClipDescription.getLabel()
should be describing the content specified by
contentUri
for accessibility reasons.linkUri
- An optional http
or https
URI. The editor author may provide
a way to navigate the user to the specified web page if this is not null
.InvalidParameterException
- if any invalid parameter is specified.public boolean validate()
true
if all the fields are valid.public Uri getContentUri()
public ClipDescription getDescription()
ClipDescription
object that contains the metadata of #getContentUri()
such as MIME type(s). ClipDescription.getLabel()
can be used for accessibility
purpose.public Uri getLinkUri()
http
or https
URI that is related to this content.public void requestPermission()
Does nothing if the temporary permission is already granted.
public void releasePermission()
Does nothing if the temporary permission is not granted.
public void writeToParcel(Parcel dest, int flags)
Parcel
.writeToParcel
in interface Parcelable
dest
- The Parcel
to be written.flags
- The flags used for parceling.public int describeContents()
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR