From b175d252b8801c4219343d7bff1b76ca1f2eb030 Mon Sep 17 00:00:00 2001 From: wangqi Date: Wed, 11 Apr 2018 12:45:07 -0700 Subject: Add RTT badge to new call log. Bug: 77717594 Test: ContactPhotoViewTest PiperOrigin-RevId: 192492913 Change-Id: I6db36017fde2cf9dca580d60d5c88bf2ad2dfe16 --- java/com/android/dialer/widget/ContactPhotoView.java | 12 ++++++++++++ .../android/dialer/widget/res/layout/contact_photo_view.xml | 8 ++++++++ 2 files changed, 20 insertions(+) (limited to 'java/com/android/dialer/widget') diff --git a/java/com/android/dialer/widget/ContactPhotoView.java b/java/com/android/dialer/widget/ContactPhotoView.java index 5020875dc..03d25de7d 100644 --- a/java/com/android/dialer/widget/ContactPhotoView.java +++ b/java/com/android/dialer/widget/ContactPhotoView.java @@ -37,6 +37,7 @@ public final class ContactPhotoView extends FrameLayout { private final QuickContactBadge contactPhoto; private final FrameLayout contactBadgeContainer; private final ImageView videoCallBadge; + private final ImageView rttCallBadge; private final GlidePhotoManager glidePhotoManager; @@ -61,6 +62,7 @@ public final class ContactPhotoView extends FrameLayout { contactPhoto = findViewById(R.id.quick_contact_photo); contactBadgeContainer = findViewById(R.id.contact_badge_container); videoCallBadge = findViewById(R.id.video_call_badge); + rttCallBadge = findViewById(R.id.rtt_call_badge); glidePhotoManager = GlidePhotoManagerComponent.get(context).glidePhotoManager(); @@ -75,6 +77,7 @@ public final class ContactPhotoView extends FrameLayout { private void hideBadge() { contactBadgeContainer.setVisibility(View.INVISIBLE); videoCallBadge.setVisibility(View.INVISIBLE); + rttCallBadge.setVisibility(View.INVISIBLE); } /** Sets the contact photo and its badge to be displayed. */ @@ -93,6 +96,15 @@ public final class ContactPhotoView extends FrameLayout { if (photoInfo.getIsVideo()) { contactBadgeContainer.setVisibility(View.VISIBLE); videoCallBadge.setVisibility(View.VISIBLE); + // Normally a video call can't be RTT call and vice versa. + // (a bug): In theory a video call could be downgraded to voice and upgraded to RTT call + // again, this might end up a call with video and RTT features both set. Update logic here if + // that could happen. Also update {@link Coalescer#meetsCallFeatureCriteria}. + rttCallBadge.setVisibility(INVISIBLE); + } else if (photoInfo.getIsRtt()) { + contactBadgeContainer.setVisibility(View.VISIBLE); + videoCallBadge.setVisibility(INVISIBLE); + rttCallBadge.setVisibility(View.VISIBLE); } else { hideBadge(); } diff --git a/java/com/android/dialer/widget/res/layout/contact_photo_view.xml b/java/com/android/dialer/widget/res/layout/contact_photo_view.xml index 2f5cd9e3d..a825ce38b 100644 --- a/java/com/android/dialer/widget/res/layout/contact_photo_view.xml +++ b/java/com/android/dialer/widget/res/layout/contact_photo_view.xml @@ -47,5 +47,13 @@ android:layout_height="13dp" android:layout_gravity="center" android:src="@drawable/quantum_ic_videocam_vd_white_24"/> + + \ No newline at end of file -- cgit v1.2.3