summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
authorSarmad Hashmi <mhashmi@google.com>2016-03-17 18:26:25 -0700
committerSarmad Hashmi <mhashmi@google.com>2016-03-18 10:14:48 -0700
commit2c39bea963856aaab76716dd2da7540be0562a8e (patch)
tree8c1631847ed3f1de4d57df7567ae0d59d07d5c38 /src/com
parent8196a91d00afb10864d43bc9433bc08b355a03bd (diff)
Fix dialer crash on unknown number call.
+Number is set to empty string if null +Added 11 tests for getContactInfo method, mainly testing various combinations of inputs BUG=27725458 BUG=27724999 Change-Id: Ic64fbdb7490a3c07145310cf02249555bfc963a3
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/dialer/calllog/CallLogNotificationsHelper.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/dialer/calllog/CallLogNotificationsHelper.java b/src/com/android/dialer/calllog/CallLogNotificationsHelper.java
index 189263199..9a5028460 100644
--- a/src/com/android/dialer/calllog/CallLogNotificationsHelper.java
+++ b/src/com/android/dialer/calllog/CallLogNotificationsHelper.java
@@ -16,6 +16,8 @@
package com.android.dialer.calllog;
+import com.google.common.base.Strings;
+
import android.Manifest;
import android.content.ContentResolver;
import android.content.ContentUris;
@@ -112,12 +114,13 @@ public class CallLogNotificationsHelper {
* Otherwise attempt to look it up in the cache.
* If that fails, fall back to displaying the number.
*/
- public @NonNull ContactInfo getContactInfo(@Nullable String number, int numberPresentation,
+ public ContactInfo getContactInfo(@Nullable String number, int numberPresentation,
@Nullable String countryIso) {
if (countryIso == null) {
countryIso = mCurrentCountryIso;
}
+ number = Strings.nullToEmpty(number);
ContactInfo contactInfo = new ContactInfo();
contactInfo.number = number;
contactInfo.formattedNumber = PhoneNumberUtils.formatNumber(number, countryIso);