summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/precall
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2018-03-06 15:16:25 -0800
committerCopybara-Service <copybara-piper@google.com>2018-03-06 15:24:26 -0800
commit1221ed57328714d85bb53d1b9a5351cc6519943e (patch)
treec23486da15d55a393e6670e0d3f0dbfeab83f3bd /java/com/android/dialer/precall
parentabd0dcd67ce2f448dab26cbb11de6263ba40e1cf (diff)
Make user able to set default sim when there is no account.
Test: CallingAccountSelectorTest, manual PiperOrigin-RevId: 188089149 Change-Id: Id1be88124e243e46ac9b0277f40de142af6bb5a9
Diffstat (limited to 'java/com/android/dialer/precall')
-rw-r--r--java/com/android/dialer/precall/impl/CallingAccountSelector.java3
1 files changed, 2 insertions, 1 deletions
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<String> 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;
}