diff options
author | roldenburg <roldenburg@google.com> | 2017-07-26 17:40:19 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-27 07:30:00 -0700 |
commit | 83258c2b5b6e68b3f603e5cfb9cf82992f46953b (patch) | |
tree | 93037d32bab3525f05bc69daee07ec854fdaba27 /java/com/android | |
parent | fa4f202fe194280a93b68e639228fa2d2097a55f (diff) |
Do not show voicemail transcription ToS if feature is disabled
We'll want to cherry-pick this onto v11.
Bug: 64073371
Test: manual, verified with QA across multiple scenarios (Fi, Verizon, forced flag enabled)
PiperOrigin-RevId: 163282286
Change-Id: I4b9456ec9a8ed978e93866a5c9dcab46848fee58
Diffstat (limited to 'java/com/android')
-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); |