diff options
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsHelper.java | 22 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/PhoneAccountUtils.java | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index f6ae7da41..031a87737 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -114,19 +114,21 @@ public class PhoneCallDetailsHelper { // Set the call count, location and date. setCallCountAndDate(views, callCount, callLocationAndDate); - // set the account icon if it exists - if (details.accountIcon != null) { - if (MoreContactUtils.shouldShowOperator(mResources)) { - views.operator.setVisibility(View.VISIBLE); - views.operator.setText(details.operator); - views.callAccountIcon.setVisibility(View.GONE); + // Set the account label if it exists. + String accountLabel = PhoneAccountUtils.getAccountLabel(mContext, details.accountHandle); + + if (accountLabel != null) { + views.callAccountLabel.setVisibility(View.VISIBLE); + views.callAccountLabel.setText(accountLabel); + int color = PhoneAccountUtils.getAccountColor(mContext, details.accountHandle); + if (color == PhoneAccount.NO_HIGHLIGHT_COLOR) { + int defaultColor = R.color.dialtacts_secondary_text_color; + views.callAccountLabel.setTextColor(mContext.getResources().getColor(defaultColor)); } else { - views.operator.setVisibility(View.GONE); - views.callAccountIcon.setVisibility(View.VISIBLE); - views.callAccountIcon.setImageDrawable(details.accountIcon); + views.callAccountLabel.setTextColor(color); } } else { - views.callAccountIcon.setVisibility(View.GONE); + views.callAccountLabel.setVisibility(View.GONE); } CharSequence nameText; diff --git a/src/com/android/dialer/calllog/PhoneAccountUtils.java b/src/com/android/dialer/calllog/PhoneAccountUtils.java index aadc6e867..3493ce1d6 100644 --- a/src/com/android/dialer/calllog/PhoneAccountUtils.java +++ b/src/com/android/dialer/calllog/PhoneAccountUtils.java @@ -67,7 +67,7 @@ public class PhoneAccountUtils { */ public static int getAccountColor(Context context, PhoneAccountHandle accountHandle) { PhoneAccount account = getAccountOrNull(context, accountHandle); - return account == null ? PhoneAccount.NO_COLOR : account.getIconTint(); + return account == null ? PhoneAccount.NO_HIGHLIGHT_COLOR : account.getHighlightColor(); } /** |