diff options
author | Nancy Chen <nancychen@google.com> | 2015-07-17 16:37:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-17 16:37:43 +0000 |
commit | 660322d8259cb256745f15219af0b9004063ea8d (patch) | |
tree | 6eb42b12564724011ab42d282c8aaf93a9f90bcb /telecomm | |
parent | 593aca12c2f7bf39ca8d4ae944f36a88bd4a48cf (diff) | |
parent | 5bd3e73a21975166fe39ccdfaf3376ad4f8fb369 (diff) | |
download | frameworks_base-660322d8259cb256745f15219af0b9004063ea8d.zip frameworks_base-660322d8259cb256745f15219af0b9004063ea8d.tar.gz frameworks_base-660322d8259cb256745f15219af0b9004063ea8d.tar.bz2 |
Merge "Add transcription field to voicemail object and related changes." into mnc-dev
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/Voicemail.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/telecomm/java/android/telecom/Voicemail.java b/telecomm/java/android/telecom/Voicemail.java index 151917e..ca235bf 100644 --- a/telecomm/java/android/telecom/Voicemail.java +++ b/telecomm/java/android/telecom/Voicemail.java @@ -36,10 +36,11 @@ public class Voicemail implements Parcelable { private final Uri mUri; private final Boolean mIsRead; private final Boolean mHasContent; + private final String mTranscription; private Voicemail(Long timestamp, String number, PhoneAccountHandle phoneAccountHandle, Long id, Long duration, String source, String providerData, Uri uri, Boolean isRead, - Boolean hasContent) { + Boolean hasContent, String transcription) { mTimestamp = timestamp; mNumber = number; mPhoneAccount = phoneAccountHandle; @@ -50,6 +51,7 @@ public class Voicemail implements Parcelable { mUri = uri; mIsRead = isRead; mHasContent = hasContent; + mTranscription = transcription; } /** @@ -88,6 +90,7 @@ public class Voicemail implements Parcelable { private Uri mBuilderUri; private Boolean mBuilderIsRead; private boolean mBuilderHasContent; + private String mBuilderTranscription; /** You should use the correct factory method to construct a builder. */ private Builder() { @@ -143,6 +146,11 @@ public class Voicemail implements Parcelable { return this; } + public Builder setTranscription(String transcription) { + mBuilderTranscription = transcription; + return this; + } + public Voicemail build() { mBuilderId = mBuilderId == null ? -1 : mBuilderId; mBuilderTimestamp = mBuilderTimestamp == null ? 0 : mBuilderTimestamp; @@ -150,7 +158,7 @@ public class Voicemail implements Parcelable { mBuilderIsRead = mBuilderIsRead == null ? false : mBuilderIsRead; return new Voicemail(mBuilderTimestamp, mBuilderNumber, mBuilderPhoneAccount, mBuilderId, mBuilderDuration, mBuilderSourcePackage, mBuilderSourceData, - mBuilderUri, mBuilderIsRead, mBuilderHasContent); + mBuilderUri, mBuilderIsRead, mBuilderHasContent, mBuilderTranscription); } } @@ -230,6 +238,13 @@ public class Voicemail implements Parcelable { return mHasContent; } + /** + * Returns the text transcription of this voicemail, or null if this field is not set. + */ + public String getTranscription() { + return mTranscription; + } + @Override public int describeContents() { return 0; @@ -265,6 +280,7 @@ public class Voicemail implements Parcelable { } else { dest.writeInt(0); } + dest.writeCharSequence(mTranscription); } public static final Creator<Voicemail> CREATOR @@ -299,5 +315,6 @@ public class Voicemail implements Parcelable { } mIsRead = in.readInt() > 0 ? true : false; mHasContent = in.readInt() > 0 ? true : false; + mTranscription = (String) in.readCharSequence(); } } |