diff options
Diffstat (limited to 'java/com/android/dialer/app/voicemail')
-rw-r--r-- | java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java | 13 | ||||
-rw-r--r-- | java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java | 33 |
2 files changed, 39 insertions, 7 deletions
diff --git a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java index b86ce8229..4100521ab 100644 --- a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java +++ b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java @@ -21,6 +21,7 @@ import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.os.Build; import android.os.Build.VERSION_CODES; import android.preference.PreferenceManager; import android.support.v4.os.BuildCompat; @@ -56,7 +57,17 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { LogUtil.i( "LegacyVoicemailNotificationReceiver.onReceive", "received legacy voicemail notification"); - Assert.checkArgument(BuildCompat.isAtLeastO()); + if (!BuildCompat.isAtLeastO()) { + LogUtil.e( + "LegacyVoicemailNotificationReceiver.onReceive", + "SDK not finalized: SDK_INT=" + + Build.VERSION.SDK_INT + + ", PREVIEW_SDK_INT=" + + Build.VERSION.PREVIEW_SDK_INT + + ", RELEASE=" + + Build.VERSION.RELEASE); + return; + } PhoneAccountHandle phoneAccountHandle = Assert.isNotNull(intent.getParcelableExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE)); diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java index f2cdaf644..e3dc0b0b7 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: 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); |