summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-03-28 20:57:33 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-28 20:57:33 +0000
commit1dc6d6722590fd38431d56f3d7bef6407342bc23 (patch)
tree96f8ddc23d0cb7d8d3d5fa83b186836cdd86df82
parentdc4f4455ff7428a4096c2a2253be7fdcb3513e68 (diff)
parent3f8c00a7759fcd29c603f3f886d4fc9ad983c485 (diff)
Merge "When declining Transcription ToS, we should hide the feature ToS."
am: 3f8c00a775 Change-Id: I63af67f2d9ccbb1e167291f08882ab6089310f55
-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(