From d3e28b78a3107dd5eb00ac3f6130d9fcbc2116ad Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Fri, 13 Mar 2015 17:29:40 -0700 Subject: [PATCH] Add voicemail builder method for updating/syncing. The id of the voicemail is necessary to update a voicemail in the database and the source data (or unique remote identifier for the voicemail) is necessary for syncing remotely. Whenever performing a sync either of data to the server or vise versa, create a voicemail object using this new method. Bug: 19236241 Change-Id: Ibc1fd8c1922be13605987d9a3dcd327c438951c8 --- api/current.txt | 1 + api/system-current.txt | 1 + telecomm/java/android/telecom/Voicemail.java | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/api/current.txt b/api/current.txt index 4e5162181597e..8c58a02ca86b5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29056,6 +29056,7 @@ package android.telecom { public class Voicemail implements android.os.Parcelable { method public static android.telecom.Voicemail.Builder createForInsertion(long, java.lang.String); + method public static android.telecom.Voicemail.Builder createForUpdate(long, java.lang.String); method public int describeContents(); method public long getDuration(); method public long getId(); diff --git a/api/system-current.txt b/api/system-current.txt index d0dd852804958..fa68b80447fb5 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31374,6 +31374,7 @@ package android.telecom { public class Voicemail implements android.os.Parcelable { method public static android.telecom.Voicemail.Builder createForInsertion(long, java.lang.String); + method public static android.telecom.Voicemail.Builder createForUpdate(long, java.lang.String); method public int describeContents(); method public long getDuration(); method public long getId(); diff --git a/telecomm/java/android/telecom/Voicemail.java b/telecomm/java/android/telecom/Voicemail.java index 864c6b1765e5a..a884c5f5ad8f9 100644 --- a/telecomm/java/android/telecom/Voicemail.java +++ b/telecomm/java/android/telecom/Voicemail.java @@ -56,6 +56,16 @@ public class Voicemail implements Parcelable { return new Builder().setNumber(number).setTimestamp(timestamp); } + /** + * Create a {@link Builder} for a {@link 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 static Builder createForUpdate(long id, String sourceData) { + return new Builder().setId(id).setSourceData(sourceData); + } + /** * Builder pattern for creating a {@link Voicemail}. The builder must be created with the * {@link #createForInsertion(long, String)} method.