summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIhab Awad <ihab@google.com>2014-11-13 09:34:43 -0800
committerNatiq Ahmed <mnatiq@codeaurora.org>2015-03-13 15:00:29 +0530
commitdd835cc4548ba181c158ce547c4106ecb42e24cb (patch)
treea58d3eb0e982e66765da75f8c2708419339f0b6b
parent5d2f0da089735a734b30f9a2f4a314f823a36d59 (diff)
downloadandroid_packages_apps_Dialer-dd835cc4548ba181c158ce547c4106ecb42e24cb.tar.gz
android_packages_apps_Dialer-dd835cc4548ba181c158ce547c4106ecb42e24cb.tar.bz2
android_packages_apps_Dialer-dd835cc4548ba181c158ce547c4106ecb42e24cb.zip
Telecom API updates (2/6)
Bug: 18292176 Conflicts: src/com/android/dialer/PhoneCallDetailsHelper.java Change-Id: I3d5229a44bff032178bf2eb9fde633a10db8c7d8
-rw-r--r--src/com/android/dialer/PhoneCallDetailsHelper.java22
-rw-r--r--src/com/android/dialer/calllog/PhoneAccountUtils.java2
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();
}
/**