blob: c5c37dfbbfb92ddcc89b75bfbf61446a31a49e68 [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 Lerda9de38682011-07-08 20:38:07 +010030 /** The type of call, as defined in the call log table, e.g., {@link Calls#INCOMING_TYPE}. */
31 public final int callType;
32 /** The date of the call, in milliseconds since the epoch. */
33 public final long date;
34 /** The name of the contact, or the empty string. */
35 public final CharSequence name;
36 /** The type of phone, e.g., {@link Phone#TYPE_HOME}, 0 if not available. */
37 public final int numberType;
38 /** The custom label associated with the phone number in the contact, or the empty string. */
39 public final CharSequence numberLabel;
40
41 /** Create the details for a call with a number not associated with a contact. */
Flavio Lerda371d5f92011-07-09 19:45:32 +010042 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int callType,
43 long date) {
44 this(number, formattedNumber, callType, date, "", 0, "");
Flavio Lerda9de38682011-07-08 20:38:07 +010045 }
46
47 /** Create the details for a call with a number associated with a contact. */
Flavio Lerda371d5f92011-07-09 19:45:32 +010048 public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int callType,
49 long date, CharSequence name, int numberType, CharSequence numberLabel) {
Flavio Lerda9de38682011-07-08 20:38:07 +010050 this.number = number;
Flavio Lerda371d5f92011-07-09 19:45:32 +010051 this.formattedNumber = formattedNumber;
Flavio Lerda9de38682011-07-08 20:38:07 +010052 this.callType = callType;
53 this.date = date;
54 this.name = name;
55 this.numberType = numberType;
56 this.numberLabel = numberLabel;
57 }
58}