summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-03-28 18:50:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-03-28 18:50:59 +0000
commit3f8c00a7759fcd29c603f3f886d4fc9ad983c485 (patch)
tree96f8ddc23d0cb7d8d3d5fa83b186836cdd86df82 /java
parent801046a73d9608f23a26638b584ae4ff8a794e6a (diff)
parentc6b28a1fc9956a6ebf0257b11b28e6fe9313c936 (diff)
Merge "When declining Transcription ToS, we should hide the feature ToS."
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java21
1 files changed, 17 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 382118fca..15eaa423e 100644
--- a/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java
+++ b/java/com/android/dialer/voicemail/listui/error/VoicemailTosMessageCreator.java
@@ -131,10 +131,23 @@ public class VoicemailTosMessageCreator {
public void onClick(View v) {
LogUtil.i(
"VoicemailTosMessageCreator.getPromoMessage", "declined transcription");
- VoicemailClient voicemailClient =
- VoicemailComponent.get(context).getVoicemailClient();
- voicemailClient.setVoicemailTranscriptionEnabled(
- context, status.getPhoneAccountHandle(), false);
+ if (isVoicemailTranscriptionAvailable()) {
+ VoicemailClient voicemailClient =
+ VoicemailComponent.get(context).getVoicemailClient();
+ voicemailClient.setVoicemailTranscriptionEnabled(
+ context, status.getPhoneAccountHandle(), false);
+ // Feature acknowledgement also means accepting TOS, otherwise after removing
+ // the feature ToS, we'll end up showing the ToS
+ // TODO(uabdullah): Consider separating the ToS acceptance and feature
+ // acknowledgment.
+ recordTosAcceptance();
+ recordFeatureAcknowledgement();
+ statusReader.refresh();
+ } else {
+ LogUtil.e(
+ "VoicemailTosMessageCreator.getPromoMessage",
+ "voicemail transcription not available");
+ }
}
}),
new Action(