diff options
author | Tyler Gunn <tgunn@google.com> | 2015-01-22 19:59:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-22 19:59:53 +0000 |
commit | 41de09ed166180a190f830f3f4c554a14acaa17f (patch) | |
tree | 6daa6b03cbcd39ed1a7f34ccca7754d89ac9aaf1 | |
parent | 8dd7ab8dd07641dd1b82ef39127f2f5c8edd341b (diff) | |
parent | 8f211310d8b1df4af69fb59056702af198ef5586 (diff) |
am 8f211310: am 2752f32c: Merge "Ensure sim color is shown on multi-sim devices when only one sim installed." into lmp-mr1-dev
* commit '8f211310d8b1df4af69fb59056702af198ef5586':
Ensure sim color is shown on multi-sim devices when only one sim installed.
-rw-r--r-- | src/com/android/dialer/calllog/PhoneAccountUtils.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/dialer/calllog/PhoneAccountUtils.java b/src/com/android/dialer/calllog/PhoneAccountUtils.java index adeec0f2b..f9bd9ad4a 100644 --- a/src/com/android/dialer/calllog/PhoneAccountUtils.java +++ b/src/com/android/dialer/calllog/PhoneAccountUtils.java @@ -75,21 +75,19 @@ public class PhoneAccountUtils { */ public static int getAccountColor(Context context, PhoneAccountHandle accountHandle) { PhoneAccount account = getAccountOrNull(context, accountHandle); + // For single-sim devices the PhoneAccount will be NO_HIGHLIGHT_COLOR by default, so it is + // safe to always use the account highlight color. return account == null ? PhoneAccount.NO_HIGHLIGHT_COLOR : account.getHighlightColor(); } /** - * Retrieve the account metadata, but if the account does not exist or the device has only a - * single registered and enabled account, return null. + * Retrieve the account metadata. */ private static PhoneAccount getAccountOrNull(Context context, PhoneAccountHandle accountHandle) { TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE); final PhoneAccount account = telecomManager.getPhoneAccount(accountHandle); - if (account == null || !telecomManager.hasMultipleCallCapableAccounts()) { - return null; - } return account; } } |