diff options
Diffstat (limited to 'src/com/android/dialer/PhoneCallDetails.java')
| -rw-r--r-- | src/com/android/dialer/PhoneCallDetails.java | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java index ec9657ed8..843e19352 100644 --- a/src/com/android/dialer/PhoneCallDetails.java +++ b/src/com/android/dialer/PhoneCallDetails.java @@ -17,15 +17,20 @@ package com.android.dialer; import com.google.common.annotations.VisibleForTesting; +import com.android.dialer.calllog.PhoneNumberDisplayUtil; +import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri; import android.provider.CallLog.Calls; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.telecom.PhoneAccountHandle; +import android.text.TextUtils; /** * The details of a phone call to be shown in the UI. + * + * TODO: Create a builder, to make it easier to construct an instance. */ public class PhoneCallDetails { /** The number of the other party involved in the call. */ @@ -85,35 +90,40 @@ public class PhoneCallDetails { */ public final String transcription; + public final String displayNumber; + public final boolean isVoicemail; + /** * Create the details for a call, with empty defaults specified for extra fields that are * not necessary for testing. */ @VisibleForTesting - public PhoneCallDetails(CharSequence number, int numberPresentation, + public PhoneCallDetails(Context context, CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, - int[] callTypes, long date, long duration) { - this (number, numberPresentation, formattedNumber, countryIso, geocode, - callTypes, date, duration, "", 0, "", null, null, 0, null, 0, null, null); + int[] callTypes, long date, long duration, boolean isVoicemail) { + this(context, number, numberPresentation, formattedNumber, countryIso, geocode, + callTypes, date, duration, "", 0, "", null, null, 0, null, 0, null, null, + isVoicemail); } /** Create the details for a call with a number not associated with a contact. */ - public PhoneCallDetails(CharSequence number, int numberPresentation, + public PhoneCallDetails(Context context, CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, - PhoneAccountHandle accountHandle, int features, Long dataUsage, String transcription) { - this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, - duration, "", 0, "", null, null, 0, accountHandle, features, dataUsage, - transcription); + PhoneAccountHandle accountHandle, int features, Long dataUsage, String transcription, + boolean isVoicemail) { + this(context, number, numberPresentation, formattedNumber, countryIso, geocode, + callTypes, date, duration, "", 0, "", null, null, 0, accountHandle, features, + dataUsage, transcription, isVoicemail); } /** Create the details for a call with a number associated with a contact. */ - public PhoneCallDetails(CharSequence number, int numberPresentation, + public PhoneCallDetails(Context context, CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, CharSequence name, int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri, int sourceType, PhoneAccountHandle accountHandle, int features, Long dataUsage, - String transcription) { + String transcription, boolean isVoicemail) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; @@ -132,5 +142,14 @@ public class PhoneCallDetails { this.features = features; this.dataUsage = dataUsage; this.transcription = transcription; + this.isVoicemail = isVoicemail; + + this.displayNumber = PhoneNumberDisplayUtil.getDisplayNumber( + context, + this.accountHandle, + this.number, + this.numberPresentation, + this.formattedNumber, + this.isVoicemail).toString(); } } |
