diff options
author | Tony Mak <tonymak@google.com> | 2016-01-13 23:58:49 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-13 23:58:49 +0000 |
commit | 1cabcd4e51ced18dd8dbd0c68b16e3804b7a8d0c (patch) | |
tree | 182264e966279af499797b34ab687eb06347bb2d /InCallUI/src/com | |
parent | 2cdd5ac23ba4b057fd88edf2c686dd08d010a525 (diff) | |
parent | f9aea95a921900b552bc808513f7c42c15e16f6c (diff) |
Showing badge icon in incall ui if it is a work call
am: 59978d307c
* commit '59978d307c8bf37d8ae7e333f0844aee5fedb329':
Showing badge icon in incall ui if it is a work call
Diffstat (limited to 'InCallUI/src/com')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 6 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 12 |
2 files changed, 12 insertions, 6 deletions
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<CallCardPresenter, CallCardPr * @param isSipCall {@code true} if this is a SIP call. * @param isContactPhotoShown {@code true} if the contact photo should be shown (it will be * updated even if it is not shown). + * @param isWorkCall Whether the call is placed through a work phone account or caller is a work + contact. */ @Override public 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) { Log.d(this, "Setting primary call"); // set the name field. setPrimaryName(name, nameIsNumber); @@ -584,7 +586,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr setDrawableToImageViews(photo); showImageView(mPhotoLarge, isContactPhotoShown); - showImageView(mWorkProfileIcon, isWorkContact); + showImageView(mWorkProfileIcon, isWorkCall); } @Override diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index a52a36d01..fed229d76 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -56,6 +56,7 @@ import com.android.incalluibind.ObjectFactory; import java.lang.ref.WeakReference; +import static com.android.contacts.common.compat.CallSdkCompat.Details.PROPERTY_WORK_CALL; /** * Presenter for the Call Card Fragment. * <p> @@ -722,6 +723,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> 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<CallCardPresenter.CallCardUi> 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<CallCardPresenter.CallCardUi> 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<CallCardPresenter.CallCardUi> mPrimaryContactInfo.photo, mPrimaryContactInfo.isSipCall, showContactPhoto, - isWorkContact); + hasWorkCallProperty || isWorkContact); updateContactInteractions(); } else { @@ -1095,8 +1100,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> 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); |