summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/app
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-06-30 15:26:17 -0700
committerEric Erfanian <erfanian@google.com>2017-07-01 03:17:31 +0000
commitd538e0b42004524abe36ac17606d3915a14f5dae (patch)
tree04638b64ff49c88d13ca3471eea44c30681489dd /java/com/android/dialer/app
parent842a9777de13bebb1c82f9d57222c52f9ddec558 (diff)
downloadandroid_packages_apps_Dialer-d538e0b42004524abe36ac17606d3915a14f5dae.tar.gz
android_packages_apps_Dialer-d538e0b42004524abe36ac17606d3915a14f5dae.tar.bz2
android_packages_apps_Dialer-d538e0b42004524abe36ac17606d3915a14f5dae.zip
Update AOSP Dialer source from internal google3 repository at
cl/160679286. Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/159771812 (6/22/2017) to 160679286 (6/30/2017). These changes track the dialer V11 release. This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Change-Id: I7e7b41ce472b85a9d5a6728d5c8b3c045c09e095 Merged-In: Ie2eb735a92c577b5ae5a5e8b7efa2d699fc964bc
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogAdapter.java17
-rw-r--r--java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java35
-rw-r--r--java/com/android/dialer/app/calllog/IntentProvider.java5
-rw-r--r--java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java17
-rw-r--r--java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java8
-rw-r--r--java/com/android/dialer/app/res/values-sq/strings.xml4
-rw-r--r--java/com/android/dialer/app/res/values-ur/strings.xml4
-rw-r--r--java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java8
-rw-r--r--java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java11
-rw-r--r--java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java37
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml20
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.pngbin0 -> 43527 bytes
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml23
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/values/dimens.xml20
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/values/strings.xml8
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/values/styles.xml37
16 files changed, 202 insertions, 52 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java
index 5241d9c80..f4c8c90f8 100644
--- a/java/com/android/dialer/app/calllog/CallLogAdapter.java
+++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java
@@ -63,6 +63,7 @@ import com.android.dialer.app.voicemail.VoicemailPlaybackPresenter.OnVoicemailDe
import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler;
import com.android.dialer.calldetails.CallDetailsEntries;
import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry;
+import com.android.dialer.callintent.CallIntentBuilder;
import com.android.dialer.calllogutils.PhoneAccountUtils;
import com.android.dialer.calllogutils.PhoneCallDetails;
import com.android.dialer.common.Assert;
@@ -293,6 +294,11 @@ public class CallLogAdapter extends GroupingListAdapter
}
};
+ @VisibleForTesting
+ public View.OnClickListener getExpandCollapseListener() {
+ return mExpandCollapseListener;
+ }
+
/** The OnClickListener used to expand or collapse the action buttons of a call log entry. */
private final View.OnClickListener mExpandCollapseListener =
new View.OnClickListener() {
@@ -361,6 +367,17 @@ public class CallLogAdapter extends GroupingListAdapter
}
}
expandViewHolderActions(viewHolder);
+
+ if (viewHolder.videoCallButtonView.getVisibility() == View.VISIBLE
+ && LightbringerComponent.get(mActivity)
+ .getLightbringer()
+ .getPackageName()
+ .equals(
+ ((IntentProvider) viewHolder.videoCallButtonView.getTag())
+ .getIntent(mActivity)
+ .getPackage())) {
+ CallIntentBuilder.increaseLightbringerCallButtonAppearInExpandedCallLogItemCount();
+ }
}
}
};
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
index b8b029f7b..27aa82577 100644
--- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
+++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
@@ -34,6 +34,8 @@ import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
+import android.telecom.TelecomManager;
+import android.telecom.VideoProfile;
import android.telephony.PhoneNumberUtils;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
@@ -66,6 +68,7 @@ import com.android.dialer.blocking.FilteredNumbersUtil;
import com.android.dialer.callcomposer.CallComposerActivity;
import com.android.dialer.calldetails.CallDetailsActivity;
import com.android.dialer.calldetails.CallDetailsEntries;
+import com.android.dialer.callintent.CallIntentBuilder;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.CompatUtils;
@@ -85,6 +88,7 @@ import com.android.dialer.phonenumbercache.CachedNumberLookupService;
import com.android.dialer.phonenumbercache.ContactInfo;
import com.android.dialer.phonenumbercache.PhoneNumberCache;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
+import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.util.CallUtil;
import com.android.dialer.util.DialerUtils;
import java.lang.annotation.Retention;
@@ -117,6 +121,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
public final ImageView primaryActionButtonView;
private final Context mContext;
+ @Nullable private final PhoneAccountHandle mDefaultPhoneAccountHandle;
private final CallLogCache mCallLogCache;
private final CallLogListItemHelper mCallLogListItemHelper;
private final CachedNumberLookupService mCachedNumberLookupService;
@@ -255,6 +260,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
mBlockReportListener = blockReportListener;
mCachedNumberLookupService = PhoneNumberCache.get(mContext).getCachedNumberLookupService();
+ // Cache this to avoid having to look it up each time we bind to a call log entry
+ mDefaultPhoneAccountHandle =
+ TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL);
+
this.rootView = rootView;
this.quickContactView = dialerQuickContactView;
this.primaryActionView = primaryActionView;
@@ -336,11 +345,13 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
}
public static CallLogListItemViewHolder createForTest(Context context) {
- return createForTest(context, null);
+ return createForTest(context, null, null);
}
- static CallLogListItemViewHolder createForTest(
- Context context, VoicemailPlaybackPresenter voicemailPlaybackPresenter) {
+ public static CallLogListItemViewHolder createForTest(
+ Context context,
+ View.OnClickListener expandCollapseListener,
+ VoicemailPlaybackPresenter voicemailPlaybackPresenter) {
Resources resources = context.getResources();
CallLogCache callLogCache = CallLogCache.getCallLogCache(context);
PhoneCallDetailsHelper phoneCallDetailsHelper =
@@ -350,7 +361,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
new CallLogListItemViewHolder(
context,
null,
- null /* expandCollapseListener */,
+ expandCollapseListener /* expandCollapseListener */,
null,
null,
callLogCache,
@@ -503,6 +514,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number);
if (!isVoicemailNumber && showLightbringerPrimaryButton()) {
+ CallIntentBuilder.increaseLightbringerCallButtonAppearInCollapsedCallLogItemCount();
primaryActionButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number));
primaryActionButtonView.setContentDescription(
TextUtils.expandTemplate(
@@ -594,7 +606,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
callButtonView.setVisibility(View.VISIBLE);
}
- if (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall()) {
+ if (CallUtil.isVideoEnabled(mContext)
+ && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) {
videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number));
videoCallButtonView.setVisibility(View.VISIBLE);
} else if (showLightbringerPrimaryButton()) {
@@ -709,10 +722,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
if (accountHandle == null) {
return false;
}
- if (accountHandle.getComponentName().equals(getLightbringer().getPhoneAccountComponentName())) {
+ if (mDefaultPhoneAccountHandle == null) {
return false;
}
- return true;
+ return accountHandle.getComponentName().equals(mDefaultPhoneAccountHandle.getComponentName());
}
private boolean canSupportCarrierVideoCall() {
@@ -878,12 +891,20 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
// intents need to be started using startActivityForResult instead of the usual startActivity
String packageName = intent.getPackage();
if (packageName != null && packageName.equals(getLightbringer().getPackageName())) {
+ Logger.get(mContext)
+ .logImpression(DialerImpression.Type.LIGHTBRINGER_VIDEO_REQUESTED_FROM_CALL_LOG);
startLightbringerActivity(intent);
} else if (CallDetailsActivity.isLaunchIntent(intent)) {
PerformanceReport.recordClick(UiAction.Type.OPEN_CALL_DETAIL);
((Activity) mContext)
.startActivityForResult(intent, DialtactsActivity.ACTIVITY_REQUEST_CODE_CALL_DETAILS);
} else {
+ if (Intent.ACTION_CALL.equals(intent.getAction())
+ && intent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, -1)
+ == VideoProfile.STATE_BIDIRECTIONAL) {
+ Logger.get(mContext)
+ .logImpression(DialerImpression.Type.IMS_VIDEO_REQUESTED_FROM_CALL_LOG);
+ }
DialerUtils.startActivityWithErrorToast(mContext, intent);
}
}
diff --git a/java/com/android/dialer/app/calllog/IntentProvider.java b/java/com/android/dialer/app/calllog/IntentProvider.java
index e1ec9f509..55fdbbace 100644
--- a/java/com/android/dialer/app/calllog/IntentProvider.java
+++ b/java/com/android/dialer/app/calllog/IntentProvider.java
@@ -30,8 +30,6 @@ import com.android.dialer.callintent.CallInitiationType;
import com.android.dialer.callintent.CallIntentBuilder;
import com.android.dialer.dialercontact.DialerContact;
import com.android.dialer.lightbringer.LightbringerComponent;
-import com.android.dialer.logging.DialerImpression;
-import com.android.dialer.logging.Logger;
import com.android.dialer.util.CallUtil;
import com.android.dialer.util.IntentUtil;
import java.util.ArrayList;
@@ -70,7 +68,6 @@ public abstract class IntentProvider {
return new IntentProvider() {
@Override
public Intent getIntent(Context context) {
- Logger.get(context).logImpression(DialerImpression.Type.IMS_VIDEO_REQUESTED_FROM_CALL_LOG);
return new CallIntentBuilder(number, CallInitiationType.Type.CALL_LOG)
.setPhoneAccountHandle(accountHandle)
.setIsVideoCall(true)
@@ -83,8 +80,6 @@ public abstract class IntentProvider {
return new IntentProvider() {
@Override
public Intent getIntent(Context context) {
- Logger.get(context)
- .logImpression(DialerImpression.Type.LIGHTBRINGER_VIDEO_REQUESTED_FROM_CALL_LOG);
return LightbringerComponent.get(context).getLightbringer().getIntent(context, number);
}
};
diff --git a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java
index 6728dfb38..2e7c9339a 100644
--- a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java
+++ b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java
@@ -17,6 +17,7 @@
package com.android.dialer.app.calllog.calllogcache;
import android.content.Context;
+import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import com.android.dialer.app.calllog.CallLogAdapter;
import com.android.dialer.util.CallUtil;
@@ -57,20 +58,8 @@ public abstract class CallLogCache {
* Returns true if the given number is the number of the configured voicemail. To be able to
* mock-out this, it is not a static method.
*/
- public abstract boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number);
-
- /**
- * Returns {@code true} when the current sim supports video calls, regardless of the value in a
- * contact's {@link android.provider.ContactsContract.CommonDataKinds.Phone#CARRIER_PRESENCE}
- * column.
- */
- public boolean isVideoEnabled() {
- if (!mHasCheckedForVideoAvailability) {
- mVideoAvailability = CallUtil.getVideoCallingAvailability(mContext);
- mHasCheckedForVideoAvailability = true;
- }
- return (mVideoAvailability & CallUtil.VIDEO_CALLING_ENABLED) != 0;
- }
+ public abstract boolean isVoicemailNumber(
+ PhoneAccountHandle accountHandle, @Nullable CharSequence number);
/**
* Returns {@code true} when the current sim supports checking video calling capabilities via the
diff --git a/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java b/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java
index f85680649..2424b6dbd 100644
--- a/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java
+++ b/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java
@@ -17,7 +17,9 @@
package com.android.dialer.app.calllog.calllogcache;
import android.content.Context;
+import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
+import android.text.TextUtils;
import android.util.ArrayMap;
import com.android.dialer.calllogutils.PhoneAccountUtils;
import com.android.dialer.telecom.TelecomUtil;
@@ -50,7 +52,11 @@ class CallLogCacheLollipopMr1 extends CallLogCache {
}
@Override
- public boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number) {
+ public boolean isVoicemailNumber(
+ PhoneAccountHandle accountHandle, @Nullable CharSequence number) {
+ if (TextUtils.isEmpty(number)) {
+ return false;
+ }
return TelecomUtil.isVoicemailNumber(mContext, accountHandle, number.toString());
}
diff --git a/java/com/android/dialer/app/res/values-sq/strings.xml b/java/com/android/dialer/app/res/values-sq/strings.xml
index ca3d52236..8f43ba72c 100644
--- a/java/com/android/dialer/app/res/values-sq/strings.xml
+++ b/java/com/android/dialer/app/res/values-sq/strings.xml
@@ -236,6 +236,6 @@
<string name="call_composer_connection_failed" msgid="6776461585447831242">"<xliff:g id="NAME">%1$s</xliff:g> është jashtë linje dhe nuk mund të kontaktohet"</string>
<string name="about_phone_label" msgid="582991354677973731">"Rreth"</string>
<string name="view_conversation" msgid="7895904782094119702">"Shiko"</string>
- <string name="ec_data_deleted" msgid="4794880345545827107">"Telefonata u fshi. Shiko dhe fshi bashkëngjitjet e ndara gjatë kësaj telefonate te \"Mesazhet\"."</string>
- <string name="multiple_ec_data_deleted" msgid="2971579891973176316">"Telefonatat u fshinë. Shiko dhe fshi bashkëngjitjet e ndara gjatë telefonatave te \"Mesazhet\"."</string>
+ <string name="ec_data_deleted" msgid="4794880345545827107">"Telefonata u fshi. Shiko dhe fshi bashkëngjitjet e ndara gjatë kësaj telefonate te Messages."</string>
+ <string name="multiple_ec_data_deleted" msgid="2971579891973176316">"Telefonatat u fshinë. Shiko dhe fshi bashkëngjitjet e ndara gjatë telefonatave te Messages."</string>
</resources>
diff --git a/java/com/android/dialer/app/res/values-ur/strings.xml b/java/com/android/dialer/app/res/values-ur/strings.xml
index 2b6a3eb07..f713f4c56 100644
--- a/java/com/android/dialer/app/res/values-ur/strings.xml
+++ b/java/com/android/dialer/app/res/values-ur/strings.xml
@@ -236,6 +236,6 @@
<string name="call_composer_connection_failed" msgid="6776461585447831242">"<xliff:g id="NAME">%1$s</xliff:g> آف لائن ہے اور اس تک پہنچا نہیں جا سکتا"</string>
<string name="about_phone_label" msgid="582991354677973731">"تفصیل"</string>
<string name="view_conversation" msgid="7895904782094119702">"دیکھیں"</string>
- <string name="ec_data_deleted" msgid="4794880345545827107">"کال حذف ہو گئی۔ اس کال کے دوران پیغامات کے اندر اشتراک کردہ منسلکہ جات ملاحظہ کریں اور حذف کریں۔"</string>
- <string name="multiple_ec_data_deleted" msgid="2971579891973176316">"کالیں حذف ہو گئیں۔ کالوں کے دوران پیغامات کے اندر اشتراک کردہ منسلکہ جات ملاحظہ کریں اور حذف کریں۔"</string>
+ <string name="ec_data_deleted" msgid="4794880345545827107">"کال حذف ہو گئی۔ اس کال کے دوران اشتراک کردہ منسلکہ جات کو \'پیغامات \' میں ملاحظہ کریں اور حذف کریں۔"</string>
+ <string name="multiple_ec_data_deleted" msgid="2971579891973176316">"کالیں حذف ہو گئیں۔ کالوں کے دوران اشتراک کردہ منسلکہ جات کو \'پیغامات \' میں ملاحظہ کریں اور حذف کریں۔"</string>
</resources>
diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java
index d045b1bd3..dbdf0f067 100644
--- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java
+++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.support.annotation.VisibleForTesting;
import android.text.util.Linkify;
import android.view.View;
+import android.widget.ImageView;
import android.widget.TextView;
import com.android.dialer.app.alert.AlertManager;
import com.android.dialer.app.voicemail.error.VoicemailErrorMessage.Action;
@@ -132,6 +133,13 @@ public class VoicemailErrorAlert {
TextView secondaryButton = (TextView) view.findViewById(R.id.voicemail_tos_button_accept);
secondaryButton.setText(secondaryAction.getText());
secondaryButton.setOnClickListener(secondaryAction.getListener());
+
+ if (message.getImageResourceId() != null) {
+ ImageView voicemailTosImage = (ImageView) view.findViewById(R.id.voicemail_image);
+ voicemailTosImage.setImageResource(message.getImageResourceId());
+ voicemailTosImage.setVisibility(View.VISIBLE);
+ }
+
return view;
}
diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java
index a0dd30f0b..92c787d2d 100644
--- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java
+++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java
@@ -47,6 +47,7 @@ public class VoicemailErrorMessage {
private final List<Action> actions;
private boolean modal;
+ private Integer imageResourceId;
/** Something the user can click on to resolve an error, such as retrying or calling voicemail */
public static class Action {
@@ -100,6 +101,16 @@ public class VoicemailErrorMessage {
return this;
}
+ @Nullable
+ public Integer getImageResourceId() {
+ return imageResourceId;
+ }
+
+ public VoicemailErrorMessage setImageResourceId(Integer imageResourceId) {
+ this.imageResourceId = imageResourceId;
+ return this;
+ }
+
public VoicemailErrorMessage(CharSequence title, CharSequence description, Action... actions) {
this(title, description, Arrays.asList(actions));
}
diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
index 3f0ed1f58..f2cdaf644 100644
--- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
+++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
@@ -22,10 +22,13 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.graphics.Typeface;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import android.telephony.TelephonyManager;
+import android.text.SpannableString;
+import android.text.style.StyleSpan;
import android.view.View;
import android.view.View.OnClickListener;
import com.android.contacts.common.compat.TelephonyManagerCompat;
@@ -114,7 +117,8 @@ public class VoicemailTosMessageCreator {
}
},
true /* raised */))
- .setModal(true);
+ .setModal(true)
+ .setImageResourceId(getTosImageId());
}
private void showDeclineTosDialog(final PhoneAccountHandle handle) {
@@ -274,17 +278,32 @@ public class VoicemailTosMessageCreator {
}
}
- private String getTosTitle() {
+ private CharSequence getTosTitle() {
return isVvm3()
? context.getString(R.string.verizon_terms_and_conditions_title)
: context.getString(R.string.dialer_terms_and_conditions_title);
}
- private String getTosMessage() {
- return isVvm3()
- ? context.getString(
- R.string.verizon_terms_and_conditions_message, getDialerTos(), getVvm3Tos())
- : context.getString(R.string.dialer_terms_and_conditions_message, getDialerTos());
+ private CharSequence getTosMessage() {
+ if (isVvm3()) {
+ // For verizon the TOS consist of three pieces: google dialer TOS, Verizon TOS message and
+ // Verizon TOS details.
+ CharSequence vvm3Details = getVvm3Tos();
+ CharSequence tos =
+ context.getString(
+ R.string.verizon_terms_and_conditions_message, getDialerTos(), vvm3Details);
+ // Make all text bold except the details.
+ SpannableString spannableTos = new SpannableString(tos);
+ spannableTos.setSpan(new StyleSpan(Typeface.BOLD), 0, tos.length() - vvm3Details.length(), 0);
+ return spannableTos;
+ } else {
+ // The TOS for everyone else there are no details, so just make everything bold.
+ CharSequence tos =
+ context.getString(R.string.dialer_terms_and_conditions_message, getDialerTos());
+ SpannableString spannableTos = new SpannableString(tos);
+ spannableTos.setSpan(new StyleSpan(Typeface.BOLD), 0, tos.length(), 0);
+ return spannableTos;
+ }
}
private int getTosDeclinedDialogMessageId() {
@@ -298,4 +317,8 @@ public class VoicemailTosMessageCreator {
? R.string.verizon_terms_and_conditions_decline_dialog_downgrade
: R.string.dialer_terms_and_conditions_decline_dialog_downgrade;
}
+
+ private Integer getTosImageId() {
+ return isVvm3() ? null : R.drawable.voicemail_tos_image;
+ }
}
diff --git a/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml b/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml
new file mode 100644
index 000000000..681c795f5
--- /dev/null
+++ b/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <solid android:color="#42000000" />
+</shape>
diff --git a/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png b/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png
new file mode 100644
index 000000000..2e076c69a
--- /dev/null
+++ b/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png
Binary files differ
diff --git a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml b/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml
index a082e8e67..ec8abed6d 100644
--- a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml
+++ b/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml
@@ -23,13 +23,21 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
android:orientation="vertical">
+ <ImageView
+ android:id="@+id/voicemail_image"
+ android:layout_width="@dimen/voicemail_tos_image_size"
+ android:layout_height="@dimen/voicemail_tos_image_size"
+ android:layout_gravity="center"
+ android:paddingTop="24dp"
+ android:visibility="gone"
+ android:importantForAccessibility="no"/>
<TextView
android:id="@+id/tos_message_title"
android:textStyle="bold"
@@ -53,8 +61,9 @@
<View
android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="#D2D2D2"/>
+ android:layout_height="0.5dp"
+ android:elevation="1dp"
+ android:background="@drawable/shadow"/>
<LinearLayout
android:id="@+id/voicemail_tos_button"
@@ -62,10 +71,12 @@
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/voicemail_tos_button_decline"
- style="@style/ErrorActionStyle"
+ style="@style/ErrorActionDeclineStyle"
android:background="?android:attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -76,7 +87,7 @@
android:layout_weight="1"/>
<TextView
android:id="@+id/voicemail_tos_button_accept"
- style="@style/RaisedErrorActionStyle"
+ style="@style/ErrorActionStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/verizon_terms_and_conditions_accept_english"/>
diff --git a/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml b/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml
index 090311f15..dd815ca12 100644
--- a/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml
+++ b/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
<resources>
<dimen name="alert_icon_size">24dp</dimen>
<dimen name="alert_start_padding">16dp</dimen>
@@ -22,4 +38,6 @@
<dimen name="voicemail_promo_card_line_spacing">4dp</dimen>
<dimen name="voicemail_promo_card_title_text_size">16sp</dimen>
<dimen name="voicemail_promo_card_message_size">14sp</dimen>
-</resources> \ No newline at end of file
+
+ <dimen name="voicemail_tos_image_size">200dp</dimen>
+</resources>
diff --git a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
index ad5240b9d..80349e168 100644
--- a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
+++ b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
@@ -174,16 +174,16 @@ Si no acepta todos estos términos y condiciones, no use el buzón de voz visual
</string>
<string translatable="false" name="dialer_terms_and_conditions_1.0_english">
- See and listen to your messages, without having to call voicemail.\n\nGet transcripts of your voicemail using Google’s transcription service.
+ See and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service.
</string>
<string translatable="false" name="dialer_terms_and_conditions_1.0_spanish">
- ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\n\nGet transcripts of your voicemail using Google’s transcription service.
+ ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service.
</string>
- <string translatable="false" name="verizon_terms_and_conditions_accept_english">Accept</string>
+ <string translatable="false" name="verizon_terms_and_conditions_accept_english">Turn On</string>
<string translatable="false" name="verizon_terms_and_conditions_accept_spanish">Aceptar</string>
- <string translatable="false" name="verizon_terms_and_conditions_decline_english">Decline</string>
+ <string translatable="false" name="verizon_terms_and_conditions_decline_english">No Thanks</string>
<string translatable="false" name="verizon_terms_and_conditions_decline_spanish">Rechazar</string>
<string translatable="false" name="dialer_terms_and_conditions_accept_english">Turn On</string>
diff --git a/java/com/android/dialer/app/voicemail/error/res/values/styles.xml b/java/com/android/dialer/app/voicemail/error/res/values/styles.xml
index c4a8542f1..257e93d1b 100644
--- a/java/com/android/dialer/app/voicemail/error/res/values/styles.xml
+++ b/java/com/android/dialer/app/voicemail/error/res/values/styles.xml
@@ -1,6 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<resources>
+<!--
+ ~ Copyright (C) 2017 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+<resources>
<style name="ErrorActionStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">48dp</item>
@@ -9,7 +24,23 @@
<item name="android:paddingEnd">8dp</item>
<item name="android:layout_marginStart">8dp</item>
<item name="android:layout_marginEnd">8dp</item>
- <item name="android:textColor">@color/dialtacts_theme_color</item>
+ <item name="android:textColor">@color/dialer_theme_color</item>
+ <item name="android:fontFamily">"sans-serif-medium"</item>
+ <item name="android:focusable">true</item>
+ <item name="android:singleLine">true</item>
+ <item name="android:textAllCaps">true</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+
+ <style name="ErrorActionDeclineStyle">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">48dp</item>
+ <item name="android:gravity">end|center_vertical</item>
+ <item name="android:paddingStart">8dp</item>
+ <item name="android:paddingEnd">8dp</item>
+ <item name="android:layout_marginStart">8dp</item>
+ <item name="android:layout_marginEnd">8dp</item>
+ <item name="android:textColor">@color/dialer_secondary_text_color</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:focusable">true</item>
<item name="android:singleLine">true</item>
@@ -23,4 +54,4 @@
<item name="android:textSize">14sp</item>
<item name="android:layout_height">@dimen/call_log_action_height</item>
</style>
-</resources> \ No newline at end of file
+</resources>