summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-03-27 16:50:56 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-27 18:15:07 -0700
commit68cf8dc4e305d7d27bbff93dc24a02bca1b13f8c (patch)
tree742e4489f590eb34e3d4f3de6eb3034255a25bda /java/com/android/dialer/voicemail
parent540385d1fb39df3e5cbf6553e988089739ef92d1 (diff)
Turn on transcription when existing dialer user accepts ToS and transcription is available.
Also updated the isVoicemailAvailable helper method, since just checking if the flag and OS is not enough (we have other things such as is VVM enabled, is VM activated), if we don't do this, it doesnt make sense to turn on transcription e.g Why what would happen if transcription is turned on but vvm is disabled Bug: 74033229 Test: Added a todo, will be added later (there are a few more similar CL's that I am sending for other ToS conditions) to ensure the logic is correct for all ToS conditions first and I can add a test right at the end for all conditions. PiperOrigin-RevId: 190696695 Change-Id: I9cb063a97e11943abeb1f823dc661efe88dfa3f1
Diffstat (limited to 'java/com/android/dialer/voicemail')
-rw-r--r--java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java
index ba9e35012..382118fca 100644
--- a/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java
+++ b/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java
@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
@@ -144,6 +143,12 @@ public class VoicemailTosMessageCreator {
@Override
public void onClick(View v) {
LogUtil.i("VoicemailTosMessageCreator.getPromoMessage", "acknowledge clicked");
+ if (isVoicemailTranscriptionAvailable()) {
+ VoicemailComponent.get(context)
+ .getVoicemailClient()
+ .setVoicemailTranscriptionEnabled(
+ context, status.getPhoneAccountHandle(), true);
+ }
// Feature acknowledgement also means accepting TOS
recordTosAcceptance();
recordFeatureAcknowledgement();
@@ -222,9 +227,9 @@ public class VoicemailTosMessageCreator {
}
private boolean isVoicemailTranscriptionAvailable() {
- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
- && ConfigProviderBindings.get(context)
- .getBoolean("voicemail_transcription_available", false);
+ return VoicemailComponent.get(context)
+ .getVoicemailClient()
+ .isVoicemailTranscriptionAvailable(context, status.getPhoneAccountHandle());
}
private void showDeclineTosDialog(final PhoneAccountHandle handle) {