From 1221ed57328714d85bb53d1b9a5351cc6519943e Mon Sep 17 00:00:00 2001 From: yueg Date: Tue, 6 Mar 2018 15:16:25 -0800 Subject: Make user able to set default sim when there is no account. Test: CallingAccountSelectorTest, manual PiperOrigin-RevId: 188089149 Change-Id: Id1be88124e243e46ac9b0277f40de142af6bb5a9 --- java/com/android/dialer/precall/impl/CallingAccountSelector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index 43f668084..afc1eadf1 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -355,7 +355,8 @@ public class CallingAccountSelector implements PreCallAction { while (cursor.moveToNext()) { Optional accountType = getAccountType(context.getContentResolver(), cursor.getLong(0)); - if (!accountType.isPresent() || !validAccountTypes.contains(accountType.get())) { + if (accountType.isPresent() && !validAccountTypes.contains(accountType.get())) { + // Empty accountType is treated as writable LogUtil.i("CallingAccountSelector.getDataId", "ignoring non-writable " + accountType); continue; } -- cgit v1.2.3