summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-03-28 10:18:51 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-28 11:23:02 -0700
commitc6b28a1fc9956a6ebf0257b11b28e6fe9313c936 (patch)
tree96f8ddc23d0cb7d8d3d5fa83b186836cdd86df82 /java/com/android/dialer/voicemail
parent801046a73d9608f23a26638b584ae4ff8a794e6a (diff)
When declining Transcription ToS, we should hide the feature ToS.
When a user declines the transcription, we should turn off transcription and never show the transcription promo ever again. Bug: 74033229 Test: N/A PiperOrigin-RevId: 190790323 Change-Id: Ida60592b0550b18b28e7f7a7a22d19100f56231a
Diffstat (limited to 'java/com/android/dialer/voicemail')
-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(