blob: 39620b22bb1d7ea942f68383aaf50e9538db8b53 [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;
Flavio Lerda9a208cc2011-07-12 21:05:47 +010038 /** The duration of the call in milliseconds, or 0 for missed calls. */
39 public final long duration;
Flavio Lerda9de38682011-07-08 20:38:07 +010040 /** The name of the contact, or the empty string. */
41 public final CharSequence name;
42 /** The type of phone, e.g., {@link Phone#TYPE_HOME}, 0 if not available. */
43 public final int numberType;
44 /** The custom label associated with the phone number in the contact, or the empty string. */
45 public final CharSequence numberLabel;
46
47 /** Create the details for a call with a number not associated with a contact. */
Flavio Lerda223a8432011-07-11 18:40:25 +010048 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
Flavio Lerda9a208cc2011-07-12 21:05:47 +010049 long date, long duration) {
50 this(number, formattedNumber, callTypes, date, duration, "", 0, "");
Flavio Lerda9de38682011-07-08 20:38:07 +010051 }
52
53 /** Create the details for a call with a number associated with a contact. */
Flavio Lerda223a8432011-07-11 18:40:25 +010054 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
Flavio Lerda9a208cc2011-07-12 21:05:47 +010055 long date, long duration, CharSequence name, int numberType, CharSequence numberLabel) {
Flavio Lerda9de38682011-07-08 20:38:07 +010056 this.number = number;
Flavio Lerda371d5f92011-07-09 19:45:32 +010057 this.formattedNumber = formattedNumber;
Flavio Lerda223a8432011-07-11 18:40:25 +010058 this.callTypes = callTypes;
Flavio Lerda9de38682011-07-08 20:38:07 +010059 this.date = date;
Flavio Lerda9a208cc2011-07-12 21:05:47 +010060 this.duration = duration;
Flavio Lerda9de38682011-07-08 20:38:07 +010061 this.name = name;
62 this.numberType = numberType;
63 this.numberLabel = numberLabel;
64 }
65}