diff options
author | Tyler Gunn <tgunn@google.com> | 2015-01-20 15:45:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-01-20 15:45:57 +0000 |
commit | 3cc6df5a6f45be60cf4f4cd9b228e2761bea2c33 (patch) | |
tree | 515b2e351a87edd2e572a06fd6a762adba0f1a48 /src | |
parent | 613d03171579561b964865a190c0b4e5551671c8 (diff) | |
parent | 4068703a40847c72fa55d78dd0ae320673119e81 (diff) |
Merge "Ensure sim color is shown on multi-sim devices when only one sim installed."
Diffstat (limited to 'src')
-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; } } |