diff options
author | Nancy Chen <nancychen@google.com> | 2015-03-09 16:24:08 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2015-03-23 11:01:30 -0700 |
commit | 164d9d5cd6d6e723b1af9a565f588cc1b5b09c6c (patch) | |
tree | a5067bbbda2379644d53a7cd742b48046f4dd4b0 /src | |
parent | 87dc7309388941ec0017f3ff1aee329364dec484 (diff) |
Fix NPE in call detail activity for voicemails.
Because the call detail activity is being used for playing voicemails,
this happens when playing voicemails but not looking at more details for
a non-voicemail call because the "details" option is not available for
non-voicemail entries. If the voicemail comes from an unknown number,
the activity attempts to get the number and convert it to a string for
use in intents within the call details activity, but since the number
does not exist, the app crashes instead.
Bug: 19627341
Change-Id: I5302527c1c51c620a66ead85984b2e2399839086
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 3 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 69242d3da..5dae9d07d 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -367,7 +367,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware // We know that all calls are from the same number and the same contact, so pick the // first. PhoneCallDetails firstDetails = details[0]; - mNumber = firstDetails.number.toString(); + mNumber = TextUtils.isEmpty(firstDetails.number) ? + null : firstDetails.number.toString(); final int numberPresentation = firstDetails.numberPresentation; final Uri contactUri = firstDetails.contactUri; final Uri photoUri = firstDetails.photoUri; diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java index 0dffd868a..c1a5abfe1 100644 --- a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java +++ b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java @@ -75,7 +75,6 @@ public class PhoneNumberDisplayHelper { */ public CharSequence getDisplayNumber(PhoneAccountHandle accountHandle, CharSequence number, int presentation, CharSequence formattedNumber) { - final CharSequence displayName = getDisplayName(accountHandle, number, presentation); if (!TextUtils.isEmpty(displayName)) { return displayName; |