public class Voicemail extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
Voicemail.Builder
Builder pattern for creating a
Voicemail . |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Voicemail> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
static Voicemail.Builder |
createForInsertion(long timestamp,
String number)
Create a
Voicemail.Builder for a new Voicemail to be inserted. |
static Voicemail.Builder |
createForUpdate(long id,
String sourceData)
Create a
Voicemail.Builder for a Voicemail to be updated (or deleted). |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
long |
getDuration()
Gets the duration of the voicemail in millis, or zero if the field is not set.
|
long |
getId()
The identifier of the voicemail in the content provider.
|
String |
getNumber()
The number of the person leaving the voicemail, empty string if unknown, null if not set.
|
PhoneAccountHandle |
getPhoneAccount()
The phone account associated with the voicemail, null if not set.
|
String |
getSourceData()
Returns the application-specific data type stored with the voicemail, or null if this field
is not set.
|
String |
getSourcePackage()
Returns the package name of the source that added this voicemail, or null if this field is
not set.
|
long |
getTimestampMillis()
The timestamp the voicemail was received, in millis since the epoch, zero if not set.
|
String |
getTranscription()
Returns the text transcription of this voicemail, or null if this field is not set.
|
Uri |
getUri()
Gets the Uri that can be used to refer to this voicemail, and to make it play.
|
boolean |
hasContent()
Tells us if there is content stored at the Uri.
|
boolean |
isRead()
Tells us if the voicemail message has been marked as read.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final Parcelable.Creator<Voicemail> CREATOR
public static Voicemail.Builder createForInsertion(long timestamp, String number)
Voicemail.Builder
for a new Voicemail
to be inserted.
The number and the timestamp are mandatory for insertion.
public static Voicemail.Builder createForUpdate(long id, String sourceData)
Voicemail.Builder
for a Voicemail
to be updated (or deleted).
The id and source data fields are mandatory for update - id is necessary for updating the database and source data is necessary for updating the server.
public long getId()
This may be missing in the case of a new Voicemail
that we plan to insert into the
content provider, since until it has been inserted we don't know what id it should have. If
none is specified, we return -1.
public String getNumber()
public PhoneAccountHandle getPhoneAccount()
public long getTimestampMillis()
public long getDuration()
public String getSourcePackage()
public String getSourceData()
Source data is typically used as an identifier to uniquely identify the voicemail against the voicemail server. This is likely to be something like the IMAP UID, or some other server-generated identifying string.
public Uri getUri()
Returns null if we don't know the Uri.
public boolean isRead()
Always returns false if this field has not been set, i.e. if hasRead() returns false.
public boolean hasContent()
public String getTranscription()
public int describeContents()
Parcelable
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
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
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.PARCELABLE_WRITE_RETURN_VALUE
.