blob: 7b02a88adf6fe888a68134616685cac8add748b2 [file] [log] [blame]
Flavio Lerda9de38682011-07-08 20:38:07 +01001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.contacts;
18
19import android.provider.CallLog.Calls;
20import android.provider.ContactsContract.CommonDataKinds.Phone;
21
22/**
23 * The details of a phone call to be shown in the UI.
24 */
25public class PhoneCallDetails {
26 /** The number of the other party involved in the call. */
27 public final CharSequence number;
Flavio Lerda371d5f92011-07-09 19:45:32 +010028 /** The formatted version of {@link #number}. */
29 public final CharSequence formattedNumber;
Flavio Lerda223a8432011-07-11 18:40:25 +010030 /**
31 * The type of calls, as defined in the call log table, e.g., {@link Calls#INCOMING_TYPE}.
32 * <p>
33 * There might be multiple types if this represents a set of entries grouped together.
34 */
35 public final int[] callTypes;
Flavio Lerda9de38682011-07-08 20:38:07 +010036 /** The date of the call, in milliseconds since the epoch. */
37 public final long date;
38 /** The name of the contact, or the empty string. */
39 public final CharSequence name;
40 /** The type of phone, e.g., {@link Phone#TYPE_HOME}, 0 if not available. */
41 public final int numberType;
42 /** The custom label associated with the phone number in the contact, or the empty string. */
43 public final CharSequence numberLabel;
44
45 /** Create the details for a call with a number not associated with a contact. */
Flavio Lerda223a8432011-07-11 18:40:25 +010046 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
Flavio Lerda371d5f92011-07-09 19:45:32 +010047 long date) {
Flavio Lerda223a8432011-07-11 18:40:25 +010048 this(number, formattedNumber, callTypes, date, "", 0, "");
Flavio Lerda9de38682011-07-08 20:38:07 +010049 }
50
51 /** Create the details for a call with a number associated with a contact. */
Flavio Lerda223a8432011-07-11 18:40:25 +010052 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
Flavio Lerda371d5f92011-07-09 19:45:32 +010053 long date, CharSequence name, int numberType, CharSequence numberLabel) {
Flavio Lerda9de38682011-07-08 20:38:07 +010054 this.number = number;
Flavio Lerda371d5f92011-07-09 19:45:32 +010055 this.formattedNumber = formattedNumber;
Flavio Lerda223a8432011-07-11 18:40:25 +010056 this.callTypes = callTypes;
Flavio Lerda9de38682011-07-08 20:38:07 +010057 this.date = date;
58 this.name = name;
59 this.numberType = numberType;
60 this.numberLabel = numberLabel;
61 }
62}