diff options
Diffstat (limited to 'src/com/android/dialer/PhoneCallDetails.java')
| -rw-r--r-- | src/com/android/dialer/PhoneCallDetails.java | 142 |
1 files changed, 49 insertions, 93 deletions
diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java index 843e19352..68fdadc0c 100644 --- a/src/com/android/dialer/PhoneCallDetails.java +++ b/src/com/android/dialer/PhoneCallDetails.java @@ -16,7 +16,6 @@ package com.android.dialer; -import com.google.common.annotations.VisibleForTesting; import com.android.dialer.calllog.PhoneNumberDisplayUtil; import android.content.Context; @@ -29,124 +28,81 @@ 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. */ - public final CharSequence number; - /** The number presenting rules set by the network, e.g., {@link Calls#PRESENTATION_ALLOWED} */ - public final int numberPresentation; - /** The formatted version of {@link #number}. */ - public final CharSequence formattedNumber; - /** The country corresponding with the phone number. */ - public final String countryIso; - /** The geocoded location for the phone number. */ - public final String geocode; + // The number of the other party involved in the call. + public CharSequence number; + // The number presenting rules set by the network, e.g., {@link Calls#PRESENTATION_ALLOWED} + public int numberPresentation; + // The formatted version of {@link #number}. + public CharSequence formattedNumber; + // The country corresponding with the phone number. + public String countryIso; + // The geocoded location for the phone number. + public String geocode; + /** * The type of calls, as defined in the call log table, e.g., {@link Calls#INCOMING_TYPE}. * <p> * There might be multiple types if this represents a set of entries grouped together. */ - public final int[] callTypes; - /** The date of the call, in milliseconds since the epoch. */ - public final long date; - /** The duration of the call in milliseconds, or 0 for missed calls. */ - public final long duration; - /** The name of the contact, or the empty string. */ - public final CharSequence name; - /** The type of phone, e.g., {@link Phone#TYPE_HOME}, 0 if not available. */ - public final int numberType; - /** The custom label associated with the phone number in the contact, or the empty string. */ - public final CharSequence numberLabel; - /** The URI of the contact associated with this phone call. */ - public final Uri contactUri; + public int[] callTypes; + + // The date of the call, in milliseconds since the epoch. + public long date; + // The duration of the call in milliseconds, or 0 for missed calls. + public long duration; + // The name of the contact, or the empty string. + public CharSequence name; + // The type of phone, e.g., {@link Phone#TYPE_HOME}, 0 if not available. + public int numberType; + // The custom label associated with the phone number in the contact, or the empty string. + public CharSequence numberLabel; + // The URI of the contact associated with this phone call. + public Uri contactUri; /** * The photo URI of the picture of the contact that is associated with this phone call or * null if there is none. * <p> * This is meant to store the high-res photo only. */ - public final Uri photoUri; - /** - * The source type of the contact associated with this call. - */ - public final int sourceType; + public Uri photoUri; - /** - * The unique identifier for the account associated with the call. - */ - public final PhoneAccountHandle accountHandle; - /** - * Features applicable to this call. - */ - public final int features; - /** - * Total data usage for this call. - */ - public final Long dataUsage; - /** - * Voicemail transcription - */ - public final String transcription; + // The source type of the contact associated with this call. + public int sourceType; + + // The unique identifier for the account associated with the call. + public PhoneAccountHandle accountHandle; + + // Features applicable to this call. + public int features; + + // Total data usage for this call. + public Long dataUsage; - public final String displayNumber; - public final boolean isVoicemail; + // Voicemail transcription + public String transcription; + + public String displayNumber; + public boolean isVoicemail; /** - * Create the details for a call, with empty defaults specified for extra fields that are - * not necessary for testing. + * Constructor with required fields for the details of a call with a number associated with a + * contact. */ - @VisibleForTesting - public PhoneCallDetails(Context context, CharSequence number, int numberPresentation, - CharSequence formattedNumber, String countryIso, String geocode, - 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(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, + public PhoneCallDetails( + Context context, + CharSequence number, + int numberPresentation, + CharSequence formattedNumber, 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(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, boolean isVoicemail) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; - this.countryIso = countryIso; - this.geocode = geocode; - this.callTypes = callTypes; - this.date = date; - this.duration = duration; - this.name = name; - this.numberType = numberType; - this.numberLabel = numberLabel; - this.contactUri = contactUri; - this.photoUri = photoUri; - this.sourceType = sourceType; - this.accountHandle = accountHandle; - 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, |
