summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-01-05 16:33:46 -0800
committerTyler Gunn <tgunn@google.com>2015-01-13 18:35:00 +0000
commit4068703a40847c72fa55d78dd0ae320673119e81 (patch)
treea0f99bc554fda249623fda8b78de1fdfe1488be2 /src
parentc851081f30cba53163977ec3c02b1e6281d67f67 (diff)
Ensure sim color is shown on multi-sim devices when only one sim installed.
- Removed telecomManager check hasMultipleCallCapableAccounts() which would only return 1 when a single sim is installed in a multisim phone. - For single-sim devices, the Sim color is 0 (ie not selected) for the Sim PhoneAccount, so the default behavior is to not show a sim color. Bug: 18696518 Change-Id: I8bbb956e204422e122b3c50e6fc98c2916151aa4
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/PhoneAccountUtils.java8
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;
}
}