From f9aea95a921900b552bc808513f7c42c15e16f6c Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Wed, 13 Jan 2016 23:03:26 +0000 Subject: Showing badge icon in incall ui if it is a work call Work call means the call is placed through work phone account or it is an outgoing call initiated from work dialer. Please notice that both personal and work call is handled by personal in-call UI, that's why we need to add a badge to indicate it. There is another scenario we need to add badge, ie. having a work contact caller, and it will be handled in ag/836110. BUG=26022174 Change-Id: I96e72068f70674dbeabfbbf7bfffc6c15c3203bf --- InCallUI/src/com/android/incallui/CallCardFragment.java | 6 ++++-- InCallUI/src/com/android/incallui/CallCardPresenter.java | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 93d499e38..efd4818a4 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -559,10 +559,12 @@ public class CallCardFragment extends BaseFragment @@ -722,6 +723,9 @@ public class CallCardPresenter extends Presenter boolean showContactPhoto = !VideoCallPresenter .showIncomingVideo(mPrimary.getVideoState(), mPrimary.getState()); + // Call placed through a work phone account. + boolean hasWorkCallProperty = mPrimary.hasProperty(PROPERTY_WORK_CALL); + if (mPrimary.isConferenceCall()) { Log.d(TAG, "Update primary display info for conference call."); @@ -733,7 +737,7 @@ public class CallCardPresenter extends Presenter getConferencePhoto(mPrimary), false /* isSipCall */, showContactPhoto, - false /* isWorkContact */); + hasWorkCallProperty); } else if (mPrimaryContactInfo != null) { Log.d(TAG, "Update primary display info for " + mPrimaryContactInfo); @@ -765,6 +769,7 @@ public class CallCardPresenter extends Presenter maybeShowHdAudioIcon(); boolean nameIsNumber = name != null && name.equals(mPrimaryContactInfo.number); + // Call with caller that is a work contact. boolean isWorkContact = (mPrimaryContactInfo.userType == ContactsUtils.USER_TYPE_WORK); ui.setPrimary( number, @@ -774,7 +779,7 @@ public class CallCardPresenter extends Presenter mPrimaryContactInfo.photo, mPrimaryContactInfo.isSipCall, showContactPhoto, - isWorkContact); + hasWorkCallProperty || isWorkContact); updateContactInteractions(); } else { @@ -1095,8 +1100,7 @@ public class CallCardPresenter extends Presenter void showContactContext(boolean show); void setCallCardVisible(boolean visible); void setPrimary(String number, String name, boolean nameIsNumber, String label, - Drawable photo, boolean isSipCall, boolean isContactPhotoShown, - boolean isWorkContact); + Drawable photo, boolean isSipCall, boolean isContactPhotoShown, boolean isWorkCall); void setSecondary(boolean show, String name, boolean nameIsNumber, String label, String providerLabel, boolean isConference, boolean isVideoCall, boolean isFullscreen); -- cgit v1.2.3