From 47ed9b00980faf568a8de0153de880465e650b27 Mon Sep 17 00:00:00 2001 From: mike dooley Date: Tue, 18 Apr 2017 14:16:48 -0700 Subject: [PATCH] Adding voicemail transcription state to the database The transcription-state column will be used to provide better visual feedback for users when viewing voicemails. Specifically it will help disambiguate the cases of transcription-in-progress and transcription-unavailable. For now the new public API constants are marked @hide. This database change involves 2 related cl's, one to define the new column and one to update the database schema (ag/2129944, ag/2129909) The cts test will be updated when the column is made public. Test: run cts -t android.provider.cts.contacts.VoicemailContractTest -m CtsProviderTestCases Bug: 37340510 Change-Id: I6fd5f52a81f43afda425227394f3e571c072b18f --- core/java/android/provider/CallLog.java | 7 ++++ .../android/provider/VoicemailContract.java | 33 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 8630f169952ae..5c4fe96ab7e8b 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -332,6 +332,13 @@ public class CallLog { */ public static final String TRANSCRIPTION = "transcription"; + /** + * State of voicemail transcription entry. This will only be populated for call log + * entries of type {@link #VOICEMAIL_TYPE}. + * @hide + */ + public static final String TRANSCRIPTION_STATE = "transcription_state"; + /** * Whether this item has been read or otherwise consumed by the user. *

diff --git a/core/java/android/provider/VoicemailContract.java b/core/java/android/provider/VoicemailContract.java index 4c61c2f755a0d..864a0fd7d7c56 100644 --- a/core/java/android/provider/VoicemailContract.java +++ b/core/java/android/provider/VoicemailContract.java @@ -231,6 +231,39 @@ public class VoicemailContract { *

Type: TEXT

*/ public static final String TRANSCRIPTION = "transcription"; + /** + * The state of the voicemail transcription. + *

Possible values: {@link #TRANSCRIPTION_NOT_STARTED}, + * {@link #TRANSCRIPTION_IN_PROGRESS}, {@link #TRANSCRIPTION_FAILED}, + * {@link #TRANSCRIPTION_AVAILABLE}. + *

Type: INTEGER

+ * @hide + */ + public static final String TRANSCRIPTION_STATE = "transcription_state"; + /** + * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has not yet + * been attempted. + * @hide + */ + public static final int TRANSCRIPTION_NOT_STARTED = 0; + /** + * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has begun + * but is not yet complete. + * @hide + */ + public static final int TRANSCRIPTION_IN_PROGRESS = 1; + /** + * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has + * been attempted and failed. + * @hide + */ + public static final int TRANSCRIPTION_FAILED = 2; + /** + * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has + * completed and the result has been stored in the {@link #TRANSCRIPTION} column. + * @hide + */ + public static final int TRANSCRIPTION_AVAILABLE = 3; /** * Path to the media content file. Internal only field. * @hide