From 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Thu, 4 May 2017 08:23:17 -0700 Subject: Update Dialer to V10 RC16 This release was created following the instructions at: go/dialer-aosp-release Subsequent dialer releases will follow as O bugs are fixed, until we reach our final RC. Version: 10 Candidate: RC16 Branch: dialer-android_release_branch/153304843.1 dialer-android/dialer-android_20170416.00/dialer-android_20170416.00_RC16 This release contains the following bug fixes since RC00: Bug: 37324705 35304403 36067503 35304446 33203808 37280992 37346084 35766990 37481880 37424493 36470282 37347691 37519015 37168472 35805360 37545472 27704934 36515614 35766990 37577470 34739750 35801628 36788693 35264204 36708536 37628370 36904650 37314436 37642171 37530847 37637799 37666625 37548549 37648036 37636412 37323529 37630507 35919141 37198343 37548572 36178218 37640315 37663896 37720467 37275944 37710497 31634477 37744796 37348506 37744796 37568534 37672424 34872683 34873026 37681461 34873295 37748373 37526812 37618638 37663896 37536088 37727455 37165687 36651204 36900708 37323529 36902926 37256480 37328353 37432034 37436952 34093562 37720889 37321935 37780300 37781115 37755902 36588206 34258266 37290464 37698062 37618638 37473004 37432034 37918676 37870494 37722091 Test: make, on device Change-Id: I99e1a484ccd578c1f8a13e7a6a4b4952f0791297 --- .../incallui/sessiondata/MultimediaFragment.java | 40 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'java/com/android/incallui/sessiondata/MultimediaFragment.java') diff --git a/java/com/android/incallui/sessiondata/MultimediaFragment.java b/java/com/android/incallui/sessiondata/MultimediaFragment.java index 14aa0a3aa..85a60b6e3 100644 --- a/java/com/android/incallui/sessiondata/MultimediaFragment.java +++ b/java/com/android/incallui/sessiondata/MultimediaFragment.java @@ -46,7 +46,7 @@ import com.bumptech.glide.request.target.Target; * Displays info from {@link MultimediaData MultimediaData}. * *

Currently displays image, location (as a map), and message that come bundled with - * MultimediaData when calling {@link #newInstance(MultimediaData, boolean, boolean)}. + * MultimediaData when calling {@link #newInstance(MultimediaData, boolean, boolean, boolean)}. */ public class MultimediaFragment extends Fragment implements AvatarPresenter { @@ -55,18 +55,24 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { private static final String ARG_LOCATION = "location"; private static final String ARG_INTERACTIVE = "interactive"; private static final String ARG_SHOW_AVATAR = "show_avatar"; + private static final String ARG_IS_SPAM = "is_spam"; private ImageView avatarImageView; private boolean showAvatar; + private boolean isSpam; public static MultimediaFragment newInstance( - @NonNull MultimediaData multimediaData, boolean isInteractive, boolean showAvatar) { + @NonNull MultimediaData multimediaData, + boolean isInteractive, + boolean showAvatar, + boolean isSpam) { return newInstance( multimediaData.getText(), multimediaData.getImageUri(), multimediaData.getLocation(), isInteractive, - showAvatar); + showAvatar, + isSpam); } @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) @@ -75,13 +81,15 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { @Nullable Uri imageUri, @Nullable Location location, boolean isInteractive, - boolean showAvatar) { + boolean showAvatar, + boolean isSpam) { Bundle args = new Bundle(); args.putString(ARG_SUBJECT, subject); args.putParcelable(ARG_IMAGE, imageUri); args.putParcelable(ARG_LOCATION, location); args.putBoolean(ARG_INTERACTIVE, isInteractive); args.putBoolean(ARG_SHOW_AVATAR, showAvatar); + args.putBoolean(ARG_IS_SPAM, isSpam); MultimediaFragment fragment = new MultimediaFragment(); fragment.setArguments(args); return fragment; @@ -91,12 +99,17 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { public void onCreate(@Nullable Bundle bundle) { super.onCreate(bundle); showAvatar = getArguments().getBoolean(ARG_SHOW_AVATAR); + isSpam = getArguments().getBoolean(ARG_IS_SPAM); } @Nullable @Override public View onCreateView( LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) { + if (isSpam) { + return layoutInflater.inflate(R.layout.fragment_spam, viewGroup, false); + } + boolean hasImage = getImageUri() != null; boolean hasSubject = !TextUtils.isEmpty(getSubject()); boolean hasMap = getLocation() != null; @@ -127,6 +140,21 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { @Override public void onViewCreated(View view, @Nullable Bundle bundle) { super.onViewCreated(view, bundle); + View container = view.findViewById(R.id.answer_message_container); + if (container != null) { + container.setClipToOutline(true); + } + + // If the call is spam and only has a subject, update the view to reflect that. + if (isSpam + && getLocation() == null + && getImageUri() == null + && !TextUtils.isEmpty(getSubject())) { + ((ImageView) view.findViewById(R.id.spam_image)) + .setImageResource(R.drawable.quantum_ic_message_white_24); + ((TextView) view.findViewById(R.id.spam_text)).setText(R.string.spam_message_text); + } + TextView messageText = (TextView) view.findViewById(R.id.answer_message_text); if (messageText != null) { messageText.setText(getSubject()); @@ -175,7 +203,9 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { .commitNow(); } avatarImageView = ((ImageView) view.findViewById(R.id.answer_message_avatar)); - avatarImageView.setVisibility(showAvatar ? View.VISIBLE : View.GONE); + if (avatarImageView != null) { + avatarImageView.setVisibility(showAvatar ? View.VISIBLE : View.GONE); + } Holder parent = FragmentUtils.getParent(this, Holder.class); if (parent != null) { -- cgit v1.2.3