commit | de9dde6a0b9362187a9b44c0c2603bf968017064 | [log] [tgz] |
---|---|---|
author | twyen <twyen@google.com> | Tue Feb 06 14:43:28 2018 -0800 |
committer | Copybara-Service <copybara-piper@google.com> | Tue Feb 06 14:57:50 2018 -0800 |
tree | 2c66fbd543a3d59d7baa9fd2feb924b7ee22739c | |
parent | 325a50b527debd7dfe109b21d90c5b5ccd657d40 [diff] |
Fix NPE when querying preferred without an account Bug: 72986691 Test: Unit tests PiperOrigin-RevId: 184743227 Change-Id: I2e37c2916ce05a72324f68c4530b7f6f3daf23eb
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index f014b27..43f6680 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java
@@ -388,7 +388,7 @@ if (cursor == null || !cursor.moveToFirst()) { return Optional.absent(); } - return Optional.of(cursor.getString(0)); + return Optional.fromNullable(cursor.getString(0)); } }
diff --git a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java index abb6e98..0a91d15 100644 --- a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java +++ b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java
@@ -38,6 +38,8 @@ USER_SET, // The user has selected the SIM for all contacts on the account. ACCOUNT, + // Unspecified reason. + OTHER, } /** The suggestion. */