diff options
author | Eric Erfanian <erfanian@google.com> | 2017-07-27 10:45:54 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-27 11:16:14 -0700 |
commit | ff2ad7ffdba7c74077eae3016b32174f0f2dad30 (patch) | |
tree | 978e817617700854b5e2ed6f166f883c3bf6ffe9 /java/com/android/dialer/app/voicemail | |
parent | 0602dd0831eb782890f74861b20075c76f503571 (diff) |
Update oc-dr1-dev to v11 RC17
This change updates the oc-dr1-dev branch to v11 RC17,
from the previous state synced @160679286.
This contains:
- A ROLLUP from 161342943
- Fixes for the following bugs:
Bug: 33490149 36608790 37846172 62294499
62338925 63013427 63089358 63104326
63112642 63143138 63161630 63405063
63415147 63450835 63494010 63522618
63523694 63523776 63524435 63575857
63594129 63634700 63642638 63643370
63709810 63710739 63716219 63757003
64009408 64025042 64060628 64073371
Test: make
Merged-In: I69ba6cbadbd1a02f05405ca0f5273b0a5ea0e5e9
Change-Id: Iaad73fa51796f62f4947571ddb744bbdadcca64e
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); |