1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 package com.android.dialer.compat.android.provider;
17 
18 /**
19  * Provide access to Voicemail Transcription API constants as they won't be publicly available.
20  *
21  * <p>Copied from android.provider.VoicemailContract.Voicemails. These do not plan to become public
22  * in O-MR1 or in the near future.
23  */
24 public class VoicemailCompat {
25 
26   /**
27    * The state of the voicemail transcription.
28    *
29    * <p>Possible values: {@link #TRANSCRIPTION_NOT_STARTED}, {@link #TRANSCRIPTION_IN_PROGRESS},
30    * {@link #TRANSCRIPTION_FAILED}, {@link #TRANSCRIPTION_AVAILABLE}.
31    *
32    * <p>Type: INTEGER
33    */
34   public static final String TRANSCRIPTION_STATE = "transcription_state";
35 
36   /**
37    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has not yet been
38    * attempted.
39    */
40   public static final int TRANSCRIPTION_NOT_STARTED = 0;
41 
42   /**
43    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has begun but is not yet
44    * complete.
45    */
46   public static final int TRANSCRIPTION_IN_PROGRESS = 1;
47 
48   /**
49    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has been attempted and
50    * failed for an unspecified reason.
51    */
52   public static final int TRANSCRIPTION_FAILED = 2;
53 
54   /**
55    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has completed and the
56    * result has been stored in the {@link #TRANSCRIPTION} column.
57    */
58   public static final int TRANSCRIPTION_AVAILABLE = 3;
59 
60   /**
61    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has been attempted and
62    * failed because no speech was detected.
63    *
64    * <p>Internal dialer use only, not part of the public SDK.
65    */
66   public static final int TRANSCRIPTION_FAILED_NO_SPEECH_DETECTED = -1;
67 
68   /**
69    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has been attempted and
70    * failed because the language was not supported.
71    *
72    * <p>Internal dialer use only, not part of the public SDK.
73    */
74   public static final int TRANSCRIPTION_FAILED_LANGUAGE_NOT_SUPPORTED = -2;
75 
76   /**
77    * Value of {@link #TRANSCRIPTION_STATE} when the voicemail transcription has completed and the
78    * result has been stored in the {@link #TRANSCRIPTION} column of the database, and the user has
79    * provided a quality rating for the transcription.
80    */
81   public static final int TRANSCRIPTION_AVAILABLE_AND_RATED = -3;
82 
83   /**
84    * Voicemail transcription quality rating value sent to the server indicating a good transcription
85    */
86   public static final int TRANSCRIPTION_QUALITY_RATING_GOOD = 1;
87 
88   /**
89    * Voicemail transcription quality rating value sent to the server indicating a bad transcription
90    */
91   public static final int TRANSCRIPTION_QUALITY_RATING_BAD = 2;
92 }
93