From c6b28a1fc9956a6ebf0257b11b28e6fe9313c936 Mon Sep 17 00:00:00 2001 From: uabdullah Date: Wed, 28 Mar 2018 10:18:51 -0700 Subject: 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 --- .../listui/error/VoicemailTosMessageCreator.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'java') 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( -- cgit v1.2.3