From f48d5ce63095524724f084183d97453f943ff453 Mon Sep 17 00:00:00 2001 From: Ta-wei Yen Date: Thu, 19 Jan 2017 16:20:43 -0800 Subject: [PATCH] Add voicemail backup/restore columns BACKED_UP and RESTORED are required for dialer voicemail backup/restore feature for N MR2. As there are no API bump the fields will be hidden in NMR2. These fields will be made public in O. ARCHIVED and IS_OMTP_VOICEMAIL is not used for NMR2, but added in advance to avoid multiple database upgrades. IS_OMTP_VOICEMAIL will be used in O to dedupe multiple apps implementing VisualVoicemailService. All voicemail inserted by the service should set this field to 1. The UI should only display voicemails with this field set to 1 when the source_package is also the current active VisualVoicemailService, as other sources represents the same source of truth(the carrier) but is outdated. For example, the query should be WHERE (is_omtp_voicemail == 0) OR (is_omtp_voicemail == 1 AND source_package = "current.vvm.package") Test: VoicemailProviderTest Bug: 34463609 Change-Id: I0f3e58fabff2102adf5bc29d81dac46c7e71d410 --- .../android/provider/VoicemailContract.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/core/java/android/provider/VoicemailContract.java b/core/java/android/provider/VoicemailContract.java index 5099eebf6eb16..7d5941e0300ec 100644 --- a/core/java/android/provider/VoicemailContract.java +++ b/core/java/android/provider/VoicemailContract.java @@ -30,6 +30,7 @@ import android.provider.CallLog.Calls; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.Voicemail; + import java.util.List; /** @@ -317,6 +318,48 @@ public class VoicemailContract { */ public static final String LAST_MODIFIED = "last_modified"; + /** + * Flag to indicate the voicemail was backed up. The value will be 1 if backed up, 0 if + * not. + * + *

Type: INTEGER (boolean)

+ * + * @hide + */ + public static final String BACKED_UP = "backed_up"; + + /** + * Flag to indicate the voicemail was restored from a backup. The value will be 1 if + * restored, 0 if not. + * + *

Type: INTEGER (boolean)

+ * + * @hide + */ + public static final String RESTORED = "restored"; + + /** + * Flag to indicate the voicemail was marked as archived. Archived voicemail should not be + * deleted even if it no longer exist on the server. The value will be 1 if archived true, 0 + * if not. + * + *

Type: INTEGER (boolean)

+ * + * @hide + */ + public static final String ARCHIVED = "archived"; + + /** + * Flag to indicate the voicemail is a OMTP voicemail handled by the {@link + * android.telephony.VisualVoicemailService}. The UI should only show OMTP voicemails from + * the current visual voicemail package. + * + *

Type: INTEGER (boolean)

+ * + * @hide + */ + public static final String IS_OMTP_VOICEMAIL = "is_omtp_voicmail"; + /** * A convenience method to build voicemail URI specific to a source package by appending * {@link VoicemailContract#PARAM_KEY_SOURCE_PACKAGE} param to the base URI.