diff options
-rw-r--r-- | java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java index 56de4e91a..02b2a64aa 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java @@ -33,8 +33,8 @@ import android.view.View; import android.view.View.OnClickListener; import com.android.contacts.common.compat.TelephonyManagerCompat; import com.android.dialer.app.voicemail.error.VoicemailErrorMessage.Action; -import com.android.dialer.buildtype.BuildType; import com.android.dialer.common.LogUtil; +import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.voicemail.VisualVoicemailTypeExtensions; @@ -79,13 +79,11 @@ public class VoicemailTosMessageCreator { if (hasAcceptedTos()) { return null; } - // TODO(mdooley): temporarily skip the terms of service for dogfood builds - if (BuildType.get() == BuildType.DOGFOOD) { - LogUtil.i( - "VoicemailTosMessageCreator.maybeCreateTosMessage", - "Skipping voicemail ToS for dogfood build"); + + if (!shouldShowTos()) { return null; } + logTosCreatedImpression(); return new VoicemailTosMessage( @@ -121,6 +119,25 @@ public class VoicemailTosMessageCreator { .setImageResourceId(getTosImageId()); } + private boolean shouldShowTos() { + if (isVvm3()) { + LogUtil.i("VoicemailTosMessageCreator.shouldShowTos", "showing TOS for verizon"); + return true; + } + + if (isVoicemailTranscriptionEnabled()) { + LogUtil.i( + "VoicemailTosMessageCreator.shouldShowTos", "showing TOS for Google transcription users"); + return true; + } + + return false; + } + + private boolean isVoicemailTranscriptionEnabled() { + return ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false); + } + private void showDeclineTosDialog(final PhoneAccountHandle handle) { if (isVvm3() && Vvm3VoicemailMessageCreator.PIN_NOT_SET == status.configurationState) { LogUtil.i( @@ -249,6 +266,10 @@ public class VoicemailTosMessageCreator { } private CharSequence getDialerTos() { + if (!isVoicemailTranscriptionEnabled()) { + return ""; + } + return useSpanish() ? context.getString(R.string.dialer_terms_and_conditions_1_0_spanish) : context.getString(R.string.dialer_terms_and_conditions_1_0_english); |