diff options
author | twyen <twyen@google.com> | 2017-06-27 11:35:33 -0700 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2017-06-30 14:36:09 -0700 |
commit | 163e709f0cf743e21abac89190dcfaab33ad4001 (patch) | |
tree | d41e79813e1274e6d47e225c8e0300a0a2606a33 /java/com/android/dialer/app/calllog | |
parent | e85fa664ac1e7394a7e9e5d0c8dc61ba1e33ab1c (diff) |
Fix NPE in CallLogCacheLollipopMr1.isVoicemailNumber()
Bug: 63012482
Test: CallLogCacheLollipopMr1Test
PiperOrigin-RevId: 160303077
Change-Id: I00c80a681963c5a7a25fffd04e02db32ca2386dd
Diffstat (limited to 'java/com/android/dialer/app/calllog')
-rw-r--r-- | java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java | 4 | ||||
-rw-r--r-- | java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java index 514fda57f..2e7c9339a 100644 --- a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java +++ b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java @@ -17,6 +17,7 @@ package com.android.dialer.app.calllog.calllogcache; import android.content.Context; +import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; import com.android.dialer.app.calllog.CallLogAdapter; import com.android.dialer.util.CallUtil; @@ -57,7 +58,8 @@ public abstract class CallLogCache { * Returns true if the given number is the number of the configured voicemail. To be able to * mock-out this, it is not a static method. */ - public abstract boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number); + public abstract boolean isVoicemailNumber( + PhoneAccountHandle accountHandle, @Nullable CharSequence number); /** * Returns {@code true} when the current sim supports checking video calling capabilities via the diff --git a/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java b/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java index f85680649..2424b6dbd 100644 --- a/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java +++ b/java/com/android/dialer/app/calllog/calllogcache/CallLogCacheLollipopMr1.java @@ -17,7 +17,9 @@ package com.android.dialer.app.calllog.calllogcache; import android.content.Context; +import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; +import android.text.TextUtils; import android.util.ArrayMap; import com.android.dialer.calllogutils.PhoneAccountUtils; import com.android.dialer.telecom.TelecomUtil; @@ -50,7 +52,11 @@ class CallLogCacheLollipopMr1 extends CallLogCache { } @Override - public boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number) { + public boolean isVoicemailNumber( + PhoneAccountHandle accountHandle, @Nullable CharSequence number) { + if (TextUtils.isEmpty(number)) { + return false; + } return TelecomUtil.isVoicemailNumber(mContext, accountHandle, number.toString()); } |