blob: e48f539c841074c60d9397a25fd508411988fc02 [file] [log] [blame]
Evan Millar088b2912009-05-28 15:24:37 -07001/*
2 * Copyright (C) 2009 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 android.provider;
18
Jeff Sharkey7b6771a2009-08-17 01:59:54 -070019import android.accounts.Account;
Fred Quintana0f4e1ab2009-07-09 17:20:59 -070020import android.content.ContentProviderClient;
21import android.content.ContentProviderOperation;
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -070022import android.content.ContentResolver;
Dmitri Plotnikovf35bce42009-08-28 19:52:50 -070023import android.content.ContentUris;
Dmitri Plotnikov93032952009-08-19 11:26:57 -070024import android.content.Context;
Jeff Sharkey7b6771a2009-08-17 01:59:54 -070025import android.content.Intent;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -070026import android.content.res.Resources;
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -070027import android.database.Cursor;
Evan Millar088b2912009-05-28 15:24:37 -070028import android.graphics.BitmapFactory;
29import android.net.Uri;
Fred Quintana0f4e1ab2009-07-09 17:20:59 -070030import android.os.RemoteException;
Dmitri Plotnikov93032952009-08-19 11:26:57 -070031import android.text.TextUtils;
Evan Millar088b2912009-05-28 15:24:37 -070032
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -070033import java.io.ByteArrayInputStream;
34import java.io.InputStream;
35
Evan Millar088b2912009-05-28 15:24:37 -070036/**
37 * The contract between the contacts provider and applications. Contains definitions
38 * for the supported URIs and columns.
39 *
Dmitri Plotnikov5f123bd2009-05-28 18:06:31 -070040 * @hide
Evan Millar088b2912009-05-28 15:24:37 -070041 */
42public final class ContactsContract {
43 /** The authority for the contacts provider */
44 public static final String AUTHORITY = "com.android.contacts";
45 /** A content:// style uri to the authority for the contacts provider */
46 public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
47
Fred Quintana0f4e1ab2009-07-09 17:20:59 -070048 public interface SyncStateColumns extends SyncStateContract.Columns {
49 }
50
51 public static final class SyncState {
52 /**
53 * This utility class cannot be instantiated
54 */
55 private SyncState() {}
56
57 public static final String CONTENT_DIRECTORY =
58 SyncStateContract.Constants.CONTENT_DIRECTORY;
59
60 /**
61 * The content:// style URI for this table
62 */
63 public static final Uri CONTENT_URI =
64 Uri.withAppendedPath(AUTHORITY_URI, CONTENT_DIRECTORY);
65
66 /**
67 * @see android.provider.SyncStateContract.Helpers#get
68 */
69 public static byte[] get(ContentProviderClient provider, Account account)
70 throws RemoteException {
71 return SyncStateContract.Helpers.get(provider, CONTENT_URI, account);
72 }
73
74 /**
75 * @see android.provider.SyncStateContract.Helpers#set
76 */
77 public static void set(ContentProviderClient provider, Account account, byte[] data)
78 throws RemoteException {
79 SyncStateContract.Helpers.set(provider, CONTENT_URI, account, data);
80 }
81
82 /**
83 * @see android.provider.SyncStateContract.Helpers#newSetOperation
84 */
85 public static ContentProviderOperation newSetOperation(Account account, byte[] data) {
86 return SyncStateContract.Helpers.newSetOperation(CONTENT_URI, account, data);
87 }
88 }
89
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -070090 /**
91 * Generic columns for use by sync adapters. The specific functions of
92 * these columns are private to the sync adapter. Other clients of the API
93 * should not attempt to either read or write this column.
94 */
95 private interface BaseSyncColumns {
96
97 /** Generic column for use by sync adapters. */
98 public static final String SYNC1 = "sync1";
99 /** Generic column for use by sync adapters. */
100 public static final String SYNC2 = "sync2";
101 /** Generic column for use by sync adapters. */
102 public static final String SYNC3 = "sync3";
103 /** Generic column for use by sync adapters. */
104 public static final String SYNC4 = "sync4";
105 }
106
107 /**
108 * Columns that appear when each row of a table belongs to a specific
109 * account, including sync information that an account may need.
110 */
111 private interface SyncColumns extends BaseSyncColumns {
112 /**
113 * The name of the account instance to which this row belongs.
114 * <P>Type: TEXT</P>
115 */
116 public static final String ACCOUNT_NAME = "account_name";
117
118 /**
119 * The type of account to which this row belongs, which when paired with
120 * {@link #ACCOUNT_NAME} identifies a specific account.
121 * <P>Type: TEXT</P>
122 */
123 public static final String ACCOUNT_TYPE = "account_type";
124
125 /**
126 * String that uniquely identifies this row to its source account.
127 * <P>Type: TEXT</P>
128 */
129 public static final String SOURCE_ID = "sourceid";
130
131 /**
132 * Version number that is updated whenever this row or its related data
133 * changes.
134 * <P>Type: INTEGER</P>
135 */
136 public static final String VERSION = "version";
137
138 /**
139 * Flag indicating that {@link #VERSION} has changed, and this row needs
140 * to be synchronized by its owning account.
141 * <P>Type: INTEGER (boolean)</P>
142 */
143 public static final String DIRTY = "dirty";
144 }
145
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700146 public interface ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700147 /**
148 * The number of times a person has been contacted
149 * <P>Type: INTEGER</P>
150 */
151 public static final String TIMES_CONTACTED = "times_contacted";
152
153 /**
154 * The last time a person was contacted.
155 * <P>Type: INTEGER</P>
156 */
157 public static final String LAST_TIME_CONTACTED = "last_time_contacted";
158
159 /**
160 * Is the contact starred?
161 * <P>Type: INTEGER (boolean)</P>
162 */
163 public static final String STARRED = "starred";
164
165 /**
Dmitri Plotnikov693d50e2009-06-22 14:57:31 -0700166 * A custom ringtone associated with a person. Not always present.
167 * <P>Type: TEXT (URI to the ringtone)</P>
168 */
169 public static final String CUSTOM_RINGTONE = "custom_ringtone";
170
171 /**
172 * Whether the person should always be sent to voicemail. Not always
173 * present.
174 * <P>Type: INTEGER (0 for false, 1 for true)</P>
175 */
176 public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700177 }
178
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700179 private interface ContactsColumns {
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700180 /**
181 * The display name for the contact.
182 * <P>Type: TEXT</P>
183 */
184 public static final String DISPLAY_NAME = "display_name";
Dmitri Plotnikov693d50e2009-06-22 14:57:31 -0700185
186 /**
Evan Millar088b2912009-05-28 15:24:37 -0700187 * Reference to the row in the data table holding the photo.
188 * <P>Type: INTEGER REFERENCES data(_id)</P>
189 */
190 public static final String PHOTO_ID = "photo_id";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -0700191
192 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700193 * Lookup value that reflects the {@link Groups#GROUP_VISIBLE} state of
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700194 * any {@link CommonDataKinds.GroupMembership} for this contact.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -0700195 */
196 public static final String IN_VISIBLE_GROUP = "in_visible_group";
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700197
198 /**
199 * Contact presence status. See {@link android.provider.Im.CommonPresenceColumns}
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700200 * for individual status definitions. This column is only returned if explicitly
201 * requested in the query projection.
202 * <p>Type: NUMBER</p>
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700203 */
204 public static final String PRESENCE_STATUS = Presence.PRESENCE_STATUS;
205
206 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700207 * Contact presence custom status. This column is only returned if explicitly
208 * requested in the query projection.
209 * <p>Type: TEXT</p>
210 */
211 public static final String PRESENCE_CUSTOM_STATUS = Presence.PRESENCE_CUSTOM_STATUS;
212
213 /**
Dmitri Plotnikov074fbfe2009-08-11 13:50:21 -0700214 * An indicator of whether this contact has at least one phone number. "1" if there is
215 * at least one phone number, "0" otherwise.
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700216 * <P>Type: INTEGER</P>
217 */
Dmitri Plotnikov074fbfe2009-08-11 13:50:21 -0700218 public static final String HAS_PHONE_NUMBER = "has_phone_number";
Dmitri Plotnikovf35bce42009-08-28 19:52:50 -0700219
220 /**
221 * An opaque value that contains hints on how to find the contact if
222 * its row id changed as a result of a sync or aggregation.
223 */
224 public static final String LOOKUP_KEY = "lookup";
Evan Millar088b2912009-05-28 15:24:37 -0700225 }
226
227 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700228 * Constants for the contacts table, which contains a record per group
229 * of raw contact representing the same person.
Evan Millar088b2912009-05-28 15:24:37 -0700230 */
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700231 public static class Contacts implements BaseColumns, ContactsColumns,
Dmitri Plotnikovc9ec66b2009-08-05 12:11:22 -0700232 ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700233 /**
234 * This utility class cannot be instantiated
235 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700236 private Contacts() {}
Evan Millar088b2912009-05-28 15:24:37 -0700237
238 /**
239 * The content:// style URI for this table
240 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700241 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "contacts");
Evan Millar088b2912009-05-28 15:24:37 -0700242
243 /**
Dmitri Plotnikovf35bce42009-08-28 19:52:50 -0700244 * A content:// style URI for this table that should be used to create
245 * shortcuts or otherwise create long-term links to contacts. This URI
246 * should always be followed by a "/" and the contact's {@link #LOOKUP_KEY}.
247 * It can optionally also have a "/" and last known contact ID appended after
248 * that. This "complete" format is an important optimization and is highly recommended.
249 * <p>
250 * As long as the contact's row ID remains the same, this URI is
251 * equivalent to {@link #CONTENT_URI}. If the contact's row ID changes
252 * as a result of a sync or aggregation, this URI will look up the
253 * contact using indirect information (sync IDs or constituent raw
254 * contacts).
255 * <p>
256 * Lookup key should be appended unencoded - it is stored in the encoded
257 * form, ready for use in a URI.
258 */
259 public static final Uri CONTENT_LOOKUP_URI = Uri.withAppendedPath(CONTENT_URI,
260 "lookup");
261
262 /**
263 * Computes a complete lookup URI (see {@link #CONTENT_LOOKUP_URI}).
264 * Pass either a basic content URI with a contact ID to obtain an
265 * equivalent lookup URI. Pass a possibly stale lookup URI to get a fresh
266 * lookup URI for the same contact.
267 * <p>
268 * Returns null if the contact cannot be found.
269 */
270 public static Uri getLookupUri(ContentResolver resolver, Uri contentUri) {
271 Cursor c = resolver.query(contentUri,
272 new String[]{Contacts.LOOKUP_KEY, Contacts._ID}, null, null, null);
273 if (c == null) {
274 return null;
275 }
276
277 try {
278 if (c.moveToFirst()) {
279 String lookupKey = c.getString(0);
280 long contactId = c.getLong(1);
281 return ContentUris.withAppendedId(
282 Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey),
283 contactId);
284 }
285 } finally {
286 c.close();
287 }
288 return null;
289 }
290
291 /**
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700292 * The content:// style URI for this table joined with useful data from
Dmitri Plotnikov02c5b452009-07-22 15:13:08 -0700293 * {@link Data}.
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700294 *
295 * @deprecated Please use plain CONTENT_URI for the same result
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700296 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700297 @Deprecated
298 public static final Uri CONTENT_SUMMARY_URI = CONTENT_URI;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700299
Evan Millar161dd862009-06-12 16:02:43 -0700300 /**
301 * The content:// style URI used for "type-to-filter" functionality on the
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700302 * {@link #CONTENT_URI} URI. The filter string will be used to match
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700303 * various parts of the contact name. The filter argument should be passed
Evan Millar161dd862009-06-12 16:02:43 -0700304 * as an additional path segment after this URI.
305 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700306 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(
307 CONTENT_URI, "filter");
308
309 @Deprecated
310 public static final Uri CONTENT_SUMMARY_FILTER_URI = CONTENT_FILTER_URI;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700311
Evan Millardc2da5f2009-06-18 16:07:13 -0700312 /**
313 * The content:// style URI for this table joined with useful data from
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700314 * {@link Data}, filtered to include only starred contacts
315 * and the most frequently contacted contacts.
Evan Millardc2da5f2009-06-18 16:07:13 -0700316 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700317 public static final Uri CONTENT_STREQUENT_URI = Uri.withAppendedPath(
318 CONTENT_URI, "strequent");
319
320 @Deprecated
321 public static final Uri CONTENT_SUMMARY_STREQUENT_URI = CONTENT_STREQUENT_URI;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700322
Evan Millardc2da5f2009-06-18 16:07:13 -0700323 /**
324 * The content:// style URI used for "type-to-filter" functionality on the
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700325 * {@link #CONTENT_STREQUENT_URI} URI. The filter string will be used to match
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700326 * various parts of the contact name. The filter argument should be passed
Evan Millardc2da5f2009-06-18 16:07:13 -0700327 * as an additional path segment after this URI.
328 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700329 public static final Uri CONTENT_STREQUENT_FILTER_URI = Uri.withAppendedPath(
330 CONTENT_STREQUENT_URI, "filter");
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700331
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700332 @Deprecated
333 public static final Uri CONTENT_SUMMARY_STREQUENT_FILTER_URI = CONTENT_STREQUENT_FILTER_URI;
334
335 public static final Uri CONTENT_GROUP_URI = Uri.withAppendedPath(
336 CONTENT_URI, "group");
337
338 @Deprecated
339 public static final Uri CONTENT_SUMMARY_GROUP_URI = CONTENT_GROUP_URI;
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700340 /**
Evan Millar088b2912009-05-28 15:24:37 -0700341 * The MIME type of {@link #CONTENT_URI} providing a directory of
342 * people.
343 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700344 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact";
Evan Millar088b2912009-05-28 15:24:37 -0700345
346 /**
347 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
348 * person.
349 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700350 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
Evan Millar088b2912009-05-28 15:24:37 -0700351
352 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700353 * A sub-directory of a single contact that contains all of the constituent raw contact
Evan Millar088b2912009-05-28 15:24:37 -0700354 * {@link Data} rows.
355 */
Fred Quintana8851e162009-08-05 21:06:45 -0700356 public static final class Data implements BaseColumns, DataColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700357 /**
358 * no public constructor since this is a utility class
359 */
360 private Data() {}
361
362 /**
363 * The directory twig for this sub-table
364 */
365 public static final String CONTENT_DIRECTORY = "data";
366 }
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700367
368 /**
369 * A sub-directory of a single contact aggregate that contains all aggregation suggestions
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700370 * (other contacts). The aggregation suggestions are computed based on approximate
371 * data matches with this contact.
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700372 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700373 public static final class AggregationSuggestions implements BaseColumns, ContactsColumns {
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700374 /**
375 * No public constructor since this is a utility class
376 */
377 private AggregationSuggestions() {}
378
379 /**
380 * The directory twig for this sub-table
381 */
382 public static final String CONTENT_DIRECTORY = "suggestions";
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700383 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700384
385 /**
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700386 * A sub-directory of a single contact that contains the contact's primary photo.
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700387 */
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700388 public static final class Photo implements BaseColumns, DataColumns {
389 /**
390 * no public constructor since this is a utility class
391 */
392 private Photo() {}
Dmitri Plotnikov1c1629d2009-08-20 08:13:46 -0700393
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700394 /**
395 * The directory twig for this sub-table
396 */
397 public static final String CONTENT_DIRECTORY = "photo";
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700398 }
399
400 /**
401 * Opens an InputStream for the person's default photo and returns the
402 * photo as a Bitmap stream.
403 *
404 * @param contactUri the contact whose photo should be used
405 */
406 public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri) {
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700407 Uri photoUri = Uri.withAppendedPath(contactUri, Photo.CONTENT_DIRECTORY);
Dmitri Plotnikov1c1629d2009-08-20 08:13:46 -0700408 if (photoUri == null) {
409 return null;
410 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700411 Cursor cursor = cr.query(photoUri,
412 new String[]{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);
413 try {
Mike Lockwood7d6eb9a2009-08-24 18:12:51 -0700414 if (cursor == null || !cursor.moveToNext()) {
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700415 return null;
416 }
417 byte[] data = cursor.getBlob(0);
418 if (data == null) {
419 return null;
420 }
421 return new ByteArrayInputStream(data);
422 } finally {
Mike Lockwood7d6eb9a2009-08-24 18:12:51 -0700423 if (cursor != null) {
424 cursor.close();
425 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700426 }
427 }
Evan Millar088b2912009-05-28 15:24:37 -0700428 }
429
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700430 private interface RawContactsColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700431 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700432 * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} that this
433 * data belongs to.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700434 * <P>Type: INTEGER</P>
Evan Millar088b2912009-05-28 15:24:37 -0700435 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700436 public static final String CONTACT_ID = "contact_id";
Evan Millar088b2912009-05-28 15:24:37 -0700437
438 /**
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700439 * Flag indicating that this {@link RawContacts} entry and its children has
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700440 * been restricted to specific platform apps.
441 * <P>Type: INTEGER (boolean)</P>
442 *
443 * @hide until finalized in future platform release
444 */
445 public static final String IS_RESTRICTED = "is_restricted";
446
447 /**
448 * The aggregation mode for this contact.
449 * <P>Type: INTEGER</P>
450 */
451 public static final String AGGREGATION_MODE = "aggregation_mode";
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700452
453 /**
454 * The "deleted" flag: "0" by default, "1" if the row has been marked
455 * for deletion. When {@link android.content.ContentResolver#delete} is
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700456 * called on a raw contact, it is marked for deletion and removed from its
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700457 * aggregate contact. The sync adaptor deletes the raw contact on the server and
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700458 * then calls ContactResolver.delete once more, this time passing the
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700459 * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal.
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700460 * <P>Type: INTEGER</P>
461 */
462 public static final String DELETED = "deleted";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700463 }
464
465 /**
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700466 * Constants for the raw_contacts table, which contains the base contact
467 * information per sync source. Sync adapters and contact management apps
468 * are the primary consumers of this API.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700469 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700470 public static final class RawContacts implements BaseColumns, RawContactsColumns,
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700471 ContactOptionsColumns, SyncColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700472 /**
473 * This utility class cannot be instantiated
474 */
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700475 private RawContacts() {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700476 }
477
478 /**
Evan Millar088b2912009-05-28 15:24:37 -0700479 * The content:// style URI for this table
480 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700481 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "raw_contacts");
Evan Millar088b2912009-05-28 15:24:37 -0700482
483 /**
484 * The content:// style URL for filtering people by email address. The
485 * filter argument should be passed as an additional path segment after
486 * this URI.
Dmitri Plotnikov56927772009-05-28 17:23:39 -0700487 *
Evan Millar088b2912009-05-28 15:24:37 -0700488 * @hide
489 */
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -0700490 @Deprecated
Evan Millardc2da5f2009-06-18 16:07:13 -0700491 public static final Uri CONTENT_FILTER_EMAIL_URI =
492 Uri.withAppendedPath(CONTENT_URI, "filter_email");
Evan Millar088b2912009-05-28 15:24:37 -0700493
494 /**
495 * The MIME type of {@link #CONTENT_URI} providing a directory of
496 * people.
497 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700498 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact";
Evan Millar088b2912009-05-28 15:24:37 -0700499
500 /**
501 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
502 * person.
503 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700504 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";
Evan Millar088b2912009-05-28 15:24:37 -0700505
506 /**
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700507 * Query parameter that can be passed with the {@link #CONTENT_URI} URI
508 * to the {@link android.content.ContentResolver#delete} method to
509 * indicate that the raw contact can be deleted physically, rather than
510 * merely marked as deleted.
511 */
512 public static final String DELETE_PERMANENTLY = "delete_permanently";
513
514 /**
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700515 * Aggregation mode: aggregate asynchronously.
516 */
517 public static final int AGGREGATION_MODE_DEFAULT = 0;
518
519 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700520 * Aggregation mode: aggregate at the time the raw contact is inserted/updated.
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700521 */
522 public static final int AGGREGATION_MODE_IMMEDITATE = 1;
523
524 /**
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700525 * If {@link #AGGREGATION_MODE} is {@link #AGGREGATION_MODE_SUSPENDED}, changes
526 * to the raw contact do not cause its aggregation to be revisited. Note that changing
527 * {@link #AGGREGATION_MODE} from {@link #AGGREGATION_MODE_SUSPENDED} to
528 * {@link #AGGREGATION_MODE_DEFAULT} does not trigger an aggregation pass. Any subsequent
529 * change to the raw contact's data will.
530 */
531 public static final int AGGREGATION_MODE_SUSPENDED = 2;
532
533 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700534 * Aggregation mode: never aggregate this raw contact (note that the raw contact will not
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700535 * have a corresponding Aggregate and therefore will not be included in Aggregates
536 * query results.)
537 */
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700538 public static final int AGGREGATION_MODE_DISABLED = 3;
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700539
540 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700541 * A sub-directory of a single raw contact that contains all of their {@link Data} rows.
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700542 * To access this directory append {@link Data#CONTENT_DIRECTORY} to the contact URI.
Evan Millar088b2912009-05-28 15:24:37 -0700543 */
544 public static final class Data implements BaseColumns, DataColumns {
545 /**
546 * no public constructor since this is a utility class
547 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700548 private Data() {
549 }
Evan Millar088b2912009-05-28 15:24:37 -0700550
551 /**
552 * The directory twig for this sub-table
553 */
554 public static final String CONTENT_DIRECTORY = "data";
555 }
556 }
557
558 private interface DataColumns {
559 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700560 * The package name to use when creating {@link Resources} objects for
561 * this data row. This value is only designed for use when building user
562 * interfaces, and should not be used to infer the owner.
563 */
564 public static final String RES_PACKAGE = "res_package";
565
566 /**
567 * The MIME type of the item represented by this row.
Evan Millar088b2912009-05-28 15:24:37 -0700568 */
569 public static final String MIMETYPE = "mimetype";
570
571 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700572 * A reference to the {@link RawContacts#_ID}
Dmitri Plotnikov56927772009-05-28 17:23:39 -0700573 * that this data belongs to.
Evan Millar088b2912009-05-28 15:24:37 -0700574 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700575 public static final String RAW_CONTACT_ID = "raw_contact_id";
576
Evan Millarab5742d2009-06-02 16:21:45 -0700577 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700578 * Whether this is the primary entry of its kind for the raw contact it belongs to
Evan Millarab5742d2009-06-02 16:21:45 -0700579 * <P>Type: INTEGER (if set, non-0 means true)</P>
580 */
581 public static final String IS_PRIMARY = "is_primary";
582
583 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700584 * Whether this is the primary entry of its kind for the aggregate
585 * contact it belongs to. Any data record that is "super primary" must
586 * also be "primary".
Evan Millarab5742d2009-06-02 16:21:45 -0700587 * <P>Type: INTEGER (if set, non-0 means true)</P>
588 */
589 public static final String IS_SUPER_PRIMARY = "is_super_primary";
590
Jeff Sharkey28b68e52009-06-10 15:26:58 -0700591 /**
Fred Quintanac933fb62009-06-11 12:14:40 -0700592 * The version of this data record. This is a read-only value. The data column is
593 * guaranteed to not change without the version going up. This value is monotonically
594 * increasing.
595 * <P>Type: INTEGER</P>
596 */
597 public static final String DATA_VERSION = "data_version";
598
Evan Millar088b2912009-05-28 15:24:37 -0700599 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
600 public static final String DATA1 = "data1";
601 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
602 public static final String DATA2 = "data2";
603 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
604 public static final String DATA3 = "data3";
605 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
606 public static final String DATA4 = "data4";
607 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
608 public static final String DATA5 = "data5";
609 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
610 public static final String DATA6 = "data6";
611 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
612 public static final String DATA7 = "data7";
613 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
614 public static final String DATA8 = "data8";
615 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
616 public static final String DATA9 = "data9";
617 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
618 public static final String DATA10 = "data10";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700619 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
620 public static final String DATA11 = "data11";
621 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
622 public static final String DATA12 = "data12";
623 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
624 public static final String DATA13 = "data13";
625 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
626 public static final String DATA14 = "data14";
627 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
628 public static final String DATA15 = "data15";
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700629
Fred Quintana8851e162009-08-05 21:06:45 -0700630 /** Generic column for use by sync adapters. */
631 public static final String SYNC1 = "data_sync1";
632 /** Generic column for use by sync adapters. */
633 public static final String SYNC2 = "data_sync2";
634 /** Generic column for use by sync adapters. */
635 public static final String SYNC3 = "data_sync3";
636 /** Generic column for use by sync adapters. */
637 public static final String SYNC4 = "data_sync4";
638
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700639 /**
Dmitri Plotnikov507f1602009-08-10 17:37:36 -0700640 * An optional insert, update or delete URI parameter that determines if
641 * the corresponding raw contact should be marked as dirty. The default
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700642 * value is true.
643 */
644 public static final String MARK_AS_DIRTY = "mark_as_dirty";
Evan Millar088b2912009-05-28 15:24:37 -0700645 }
646
647 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700648 * Constants for the data table, which contains data points tied to a raw contact.
Evan Millar088b2912009-05-28 15:24:37 -0700649 * For example, a phone number or email address. Each row in this table contains a type
650 * definition and some generic columns. Each data type can define the meaning for each of
651 * the generic columns.
652 */
Fred Quintana8851e162009-08-05 21:06:45 -0700653 public static final class Data implements BaseColumns, DataColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700654 /**
655 * This utility class cannot be instantiated
656 */
657 private Data() {}
658
659 /**
660 * The content:// style URI for this table
661 */
662 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "data");
663
664 /**
665 * The MIME type of {@link #CONTENT_URI} providing a directory of data.
666 */
667 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/data";
668 }
669
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700670 private interface PhoneLookupColumns {
671 /**
672 * The phone number as the user entered it.
673 * <P>Type: TEXT</P>
674 */
675 public static final String NUMBER = "number";
676
677 /**
678 * The type of phone number, for example Home or Work.
679 * <P>Type: INTEGER</P>
680 */
681 public static final String TYPE = "type";
682
683 /**
684 * The user defined label for the phone number.
685 * <P>Type: TEXT</P>
686 */
687 public static final String LABEL = "label";
688 }
689
Evan Millar088b2912009-05-28 15:24:37 -0700690 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700691 * A table that represents the result of looking up a phone number, for
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700692 * example for caller ID. To perform a lookup you must append the number you
693 * want to find to {@link #CONTENT_FILTER_URI}.
Evan Millar088b2912009-05-28 15:24:37 -0700694 */
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700695 public static final class PhoneLookup implements BaseColumns, PhoneLookupColumns,
696 ContactsColumns, ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700697 /**
698 * This utility class cannot be instantiated
699 */
700 private PhoneLookup() {}
701
702 /**
703 * The content:// style URI for this table. Append the phone number you want to lookup
704 * to this URI and query it to perform a lookup. For example:
705 *
706 * {@code
707 * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, phoneNumber);
708 * }
709 */
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700710 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
711 "phone_lookup");
712 }
713
714 /**
715 * Additional data mixed in with {@link Im.CommonPresenceColumns} to link
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700716 * back to specific {@link ContactsContract.Contacts#_ID} entries.
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700717 */
718 private interface PresenceColumns {
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700719
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700720 /**
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700721 * The unique ID for a row.
722 * <P>Type: INTEGER (long)</P>
723 */
724 public static final String _ID = "presence_id";
725
726 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700727 * Reference to the {@link RawContacts#_ID} this presence references.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700728 * <P>Type: INTEGER</P>
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700729 *
730 * TODO remove this from public API
731 * @hide
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700732 */
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700733 @Deprecated
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -0700734 public static final String RAW_CONTACT_ID = "presence_raw_contact_id";
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700735
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700736 /**
737 * Reference to the {@link Data#_ID} entry that owns this presence.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700738 * <P>Type: INTEGER</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700739 */
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -0700740 public static final String DATA_ID = "presence_data_id";
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700741
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700742 @Deprecated
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700743 public static final String IM_PROTOCOL = "im_protocol";
744
745 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700746 * <p>Type: NUMBER</p>
747 */
748 public static final String PROTOCOL = "protocol";
749
750 /**
751 * Name of the custom protocol. Should be supplied along with the {@link #PROTOCOL} value
752 * {@link ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM}. Should be null or
753 * omitted if {@link #PROTOCOL} value is not
754 * {@link ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM}.
755 *
756 * <p>Type: NUMBER</p>
757 */
758 public static final String CUSTOM_PROTOCOL = "custom_protocol";
759
760 /**
761 * The IM handle the presence item is for. The handle is scoped to
762 * {@link #PROTOCOL}.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700763 * <P>Type: TEXT</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700764 */
765 public static final String IM_HANDLE = "im_handle";
766
767 /**
768 * The IM account for the local user that the presence data came from.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700769 * <P>Type: TEXT</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700770 */
771 public static final String IM_ACCOUNT = "im_account";
772 }
773
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700774 public static final class Presence implements PresenceColumns, Im.CommonPresenceColumns {
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700775 /**
776 * This utility class cannot be instantiated
777 */
778 private Presence() {
779 }
780
781 /**
782 * The content:// style URI for this table
783 */
784 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "presence");
785
786 /**
787 * Gets the resource ID for the proper presence icon.
788 *
789 * @param status the status to get the icon for
790 * @return the resource ID for the proper presence icon
791 */
792 public static final int getPresenceIconResourceId(int status) {
793 switch (status) {
794 case AVAILABLE:
795 return android.R.drawable.presence_online;
796 case IDLE:
797 case AWAY:
798 return android.R.drawable.presence_away;
799 case DO_NOT_DISTURB:
800 return android.R.drawable.presence_busy;
801 case INVISIBLE:
802 return android.R.drawable.presence_invisible;
803 case OFFLINE:
804 default:
805 return android.R.drawable.presence_offline;
806 }
807 }
808
809 /**
Evan Millarc0437522009-06-23 17:31:05 -0700810 * Returns the precedence of the status code the higher number being the higher precedence.
811 *
812 * @param status The status code.
813 * @return An integer representing the precedence, 0 being the lowest.
814 */
815 public static final int getPresencePrecedence(int status) {
816 // Keep this function here incase we want to enforce a different precedence than the
817 // natural order of the status constants.
818 return status;
819 }
820
821 /**
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700822 * The MIME type of {@link #CONTENT_URI} providing a directory of
823 * presence details.
824 */
825 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/im-presence";
826
827 /**
828 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
829 * presence detail.
830 */
831 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im-presence";
Evan Millar088b2912009-05-28 15:24:37 -0700832 }
833
834 /**
835 * Container for definitions of common data types stored in the {@link Data} table.
836 */
837 public static final class CommonDataKinds {
838 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700839 * The {@link Data#RES_PACKAGE} value for common data that should be
840 * shown using a default style.
Evan Millar088b2912009-05-28 15:24:37 -0700841 */
842 public static final String PACKAGE_COMMON = "common";
843
844 /**
845 * Columns common across the specific types.
846 */
847 private interface BaseCommonColumns {
848 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700849 * The package name to use when creating {@link Resources} objects for
850 * this data row. This value is only designed for use when building user
851 * interfaces, and should not be used to infer the owner.
Evan Millar088b2912009-05-28 15:24:37 -0700852 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700853 public static final String RES_PACKAGE = "res_package";
Evan Millar088b2912009-05-28 15:24:37 -0700854
855 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700856 * The MIME type of the item represented by this row.
Evan Millar088b2912009-05-28 15:24:37 -0700857 */
858 public static final String MIMETYPE = "mimetype";
859
860 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700861 * The {@link RawContacts#_ID} that this data belongs to.
Evan Millar088b2912009-05-28 15:24:37 -0700862 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700863 public static final String RAW_CONTACT_ID = "raw_contact_id";
Evan Millar088b2912009-05-28 15:24:37 -0700864 }
865
866 /**
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700867 * The base types that all "Typed" data kinds support.
868 */
869 public interface BaseTypes {
870
871 /**
872 * A custom type. The custom label should be supplied by user.
873 */
874 public static int TYPE_CUSTOM = 0;
875 }
876
877 /**
Evan Millar088b2912009-05-28 15:24:37 -0700878 * Columns common across the specific types.
879 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700880 private interface CommonColumns extends BaseTypes{
Evan Millar088b2912009-05-28 15:24:37 -0700881 /**
882 * The type of data, for example Home or Work.
883 * <P>Type: INTEGER</P>
884 */
885 public static final String TYPE = "data1";
886
887 /**
Evan Millar088b2912009-05-28 15:24:37 -0700888 * The data for the contact method.
889 * <P>Type: TEXT</P>
890 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700891 public static final String DATA = "data2";
892
893 /**
894 * The user defined label for the the contact method.
895 * <P>Type: TEXT</P>
896 */
897 public static final String LABEL = "data3";
Evan Millar088b2912009-05-28 15:24:37 -0700898 }
899
900 /**
901 * Parts of the name.
902 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700903 public static final class StructuredName implements BaseCommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700904 private StructuredName() {}
905
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700906 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -0700907 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name";
908
909 /**
Evan Millar088b2912009-05-28 15:24:37 -0700910 * The given name for the contact.
911 * <P>Type: TEXT</P>
912 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700913 public static final String GIVEN_NAME = "data1";
Evan Millar088b2912009-05-28 15:24:37 -0700914
915 /**
916 * The family name for the contact.
917 * <P>Type: TEXT</P>
918 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700919 public static final String FAMILY_NAME = "data2";
920
921 /**
922 * The contact's honorific prefix, e.g. "Sir"
923 * <P>Type: TEXT</P>
924 */
925 public static final String PREFIX = "data3";
926
927 /**
928 * The contact's middle name
929 * <P>Type: TEXT</P>
930 */
931 public static final String MIDDLE_NAME = "data4";
Evan Millar088b2912009-05-28 15:24:37 -0700932
933 /**
934 * The contact's honorific suffix, e.g. "Jr"
935 */
936 public static final String SUFFIX = "data5";
937
938 /**
939 * The phonetic version of the given name for the contact.
940 * <P>Type: TEXT</P>
941 */
942 public static final String PHONETIC_GIVEN_NAME = "data6";
943
944 /**
945 * The phonetic version of the additional name for the contact.
946 * <P>Type: TEXT</P>
947 */
948 public static final String PHONETIC_MIDDLE_NAME = "data7";
949
950 /**
951 * The phonetic version of the family name for the contact.
952 * <P>Type: TEXT</P>
953 */
954 public static final String PHONETIC_FAMILY_NAME = "data8";
955
956 /**
957 * The name that should be used to display the contact.
Jeff Sharkey62b83b72009-08-11 17:33:48 -0700958 * <i>Unstructured component of the name should be consistent with
959 * its structured representation.</i>
960 * <p>
961 * Type: TEXT
Evan Millar088b2912009-05-28 15:24:37 -0700962 */
963 public static final String DISPLAY_NAME = "data9";
964 }
965
966 /**
967 * A nickname.
968 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700969 public static final class Nickname implements CommonColumns, BaseCommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700970 private Nickname() {}
971
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700972 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -0700973 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname";
974
Evan Millar78e79ad2009-06-08 10:24:44 -0700975 public static final int TYPE_DEFAULT = 1;
976 public static final int TYPE_OTHER_NAME = 2;
977 public static final int TYPE_MAINDEN_NAME = 3;
978 public static final int TYPE_SHORT_NAME = 4;
979 public static final int TYPE_INITIALS = 5;
Evan Millar088b2912009-05-28 15:24:37 -0700980
981 /**
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700982 * The name itself
983 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700984 public static final String NAME = DATA;
Evan Millar088b2912009-05-28 15:24:37 -0700985 }
986
987 /**
988 * Common data definition for telephone numbers.
989 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700990 public static final class Phone implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700991 private Phone() {}
992
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700993 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -0700994 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone";
995
Evan Millar161dd862009-06-12 16:02:43 -0700996 /**
997 * The MIME type of {@link #CONTENT_URI} providing a directory of
998 * phones.
999 */
1000 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone";
1001
1002 /**
1003 * The content:// style URI for all data records of the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001004 * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001005 * associated raw contact and aggregate contact data.
Evan Millar161dd862009-06-12 16:02:43 -07001006 */
1007 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1008 "phones");
1009
1010 /**
1011 * The content:// style URI for filtering data records of the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001012 * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001013 * associated raw contact and aggregate contact data. The filter argument should
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001014 * be passed as an additional path segment after this URI.
Evan Millar161dd862009-06-12 16:02:43 -07001015 */
1016 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI,
1017 "filter");
1018
Evan Millar088b2912009-05-28 15:24:37 -07001019 public static final int TYPE_HOME = 1;
1020 public static final int TYPE_MOBILE = 2;
1021 public static final int TYPE_WORK = 3;
1022 public static final int TYPE_FAX_WORK = 4;
1023 public static final int TYPE_FAX_HOME = 5;
1024 public static final int TYPE_PAGER = 6;
1025 public static final int TYPE_OTHER = 7;
Fred Quintana3f867152009-08-03 11:43:16 -07001026 public static final int TYPE_CALLBACK = 8;
1027 public static final int TYPE_CAR = 9;
1028 public static final int TYPE_COMPANY_MAIN = 10;
1029 public static final int TYPE_ISDN = 11;
1030 public static final int TYPE_MAIN = 12;
1031 public static final int TYPE_OTHER_FAX = 13;
1032 public static final int TYPE_RADIO = 14;
1033 public static final int TYPE_TELEX = 15;
1034 public static final int TYPE_TTY_TDD = 16;
1035 public static final int TYPE_WORK_MOBILE = 17;
1036 public static final int TYPE_WORK_PAGER = 18;
1037 public static final int TYPE_ASSISTANT = 19;
Evan Millar088b2912009-05-28 15:24:37 -07001038
1039 /**
1040 * The phone number as the user entered it.
1041 * <P>Type: TEXT</P>
1042 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001043 public static final String NUMBER = DATA;
Dmitri Plotnikov93032952009-08-19 11:26:57 -07001044
1045 public static final CharSequence getDisplayLabel(Context context, int type,
1046 CharSequence label, CharSequence[] labelArray) {
1047 CharSequence display = "";
1048
1049 if (type != Phone.TYPE_CUSTOM) {
1050 CharSequence[] labels = labelArray != null? labelArray
1051 : context.getResources().getTextArray(
1052 com.android.internal.R.array.phoneTypes);
1053 try {
1054 display = labels[type - 1];
1055 } catch (ArrayIndexOutOfBoundsException e) {
1056 display = labels[Phone.TYPE_CUSTOM];
1057 }
1058 } else {
1059 if (!TextUtils.isEmpty(label)) {
1060 display = label;
1061 }
1062 }
1063 return display;
1064 }
1065
1066 public static final CharSequence getDisplayLabel(Context context, int type,
1067 CharSequence label) {
1068 return getDisplayLabel(context, type, label, null);
1069 }
Evan Millar088b2912009-05-28 15:24:37 -07001070 }
1071
1072 /**
1073 * Common data definition for email addresses.
1074 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001075 public static final class Email implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001076 private Email() {}
1077
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001078 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001079 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email";
1080
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001081 /**
1082 * The content:// style URI for all data records of the
1083 * {@link Email#CONTENT_ITEM_TYPE} MIME type, combined with the
1084 * associated raw contact and aggregate contact data.
1085 */
1086 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1087 "emails");
1088
1089 /**
1090 * The content:// style URL for filtering data rows by email address. The
1091 * filter argument should be passed as an additional path segment after
1092 * this URI.
1093 */
1094 public static final Uri CONTENT_FILTER_EMAIL_URI = Uri.withAppendedPath(CONTENT_URI,
1095 "filter");
1096
Evan Millar088b2912009-05-28 15:24:37 -07001097 public static final int TYPE_HOME = 1;
1098 public static final int TYPE_WORK = 2;
1099 public static final int TYPE_OTHER = 3;
Jeff Sharkey14fb1532009-08-29 15:54:26 -07001100 public static final int TYPE_MOBILE = 4;
Fred Quintana8851e162009-08-05 21:06:45 -07001101
1102 /**
1103 * The display name for the email address
1104 * <P>Type: TEXT</P>
1105 */
1106 public static final String DISPLAY_NAME = "data4";
Evan Millar088b2912009-05-28 15:24:37 -07001107 }
1108
1109 /**
1110 * Common data definition for postal addresses.
1111 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001112 public static final class StructuredPostal implements BaseCommonColumns, CommonColumns {
1113 private StructuredPostal() {
1114 }
Evan Millar088b2912009-05-28 15:24:37 -07001115
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001116 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001117 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address";
1118
Evan Millar161dd862009-06-12 16:02:43 -07001119 /**
1120 * The MIME type of {@link #CONTENT_URI} providing a directory of
1121 * postal addresses.
1122 */
1123 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address";
1124
1125 /**
1126 * The content:// style URI for all data records of the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001127 * {@link StructuredPostal#CONTENT_ITEM_TYPE} MIME type.
Evan Millar161dd862009-06-12 16:02:43 -07001128 */
1129 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1130 "postals");
1131
Evan Millar088b2912009-05-28 15:24:37 -07001132 public static final int TYPE_HOME = 1;
1133 public static final int TYPE_WORK = 2;
1134 public static final int TYPE_OTHER = 3;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001135
1136 /**
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001137 * The full, unstructured postal address. <i>This field must be
1138 * consistent with any structured data.</i>
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001139 * <p>
1140 * Type: TEXT
1141 */
1142 public static final String FORMATTED_ADDRESS = DATA;
1143
1144 /**
1145 * The agent who actually receives the mail. Used in work addresses.
1146 * Also for 'in care of' or 'c/o'.
1147 * <p>
1148 * Type: TEXT
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001149 * @deprecated since this isn't supported by gd:structuredPostalAddress
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001150 */
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001151 @Deprecated
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001152 public static final String AGENT = "data4";
1153
1154 /**
1155 * Used in places where houses or buildings have names (and not
1156 * necessarily numbers), eg. "The Pillars".
1157 * <p>
1158 * Type: TEXT
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001159 * @deprecated since this isn't supported by gd:structuredPostalAddress
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001160 */
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001161 @Deprecated
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001162 public static final String HOUSENAME = "data5";
1163
1164 /**
1165 * Can be street, avenue, road, etc. This element also includes the
1166 * house number and room/apartment/flat/floor number.
1167 * <p>
1168 * Type: TEXT
1169 */
1170 public static final String STREET = "data6";
1171
1172 /**
1173 * Covers actual P.O. boxes, drawers, locked bags, etc. This is
1174 * usually but not always mutually exclusive with street.
1175 * <p>
1176 * Type: TEXT
1177 */
1178 public static final String POBOX = "data7";
1179
1180 /**
1181 * This is used to disambiguate a street address when a city
1182 * contains more than one street with the same name, or to specify a
1183 * small place whose mail is routed through a larger postal town. In
1184 * China it could be a county or a minor city.
1185 * <p>
1186 * Type: TEXT
1187 */
Jeff Sharkeyef348c72009-07-26 14:14:34 -07001188 public static final String NEIGHBORHOOD = "data8";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001189
1190 /**
1191 * Can be city, village, town, borough, etc. This is the postal town
1192 * and not necessarily the place of residence or place of business.
1193 * <p>
1194 * Type: TEXT
1195 */
1196 public static final String CITY = "data9";
1197
1198 /**
1199 * Handles administrative districts such as U.S. or U.K. counties
1200 * that are not used for mail addressing purposes. Subregion is not
1201 * intended for delivery addresses.
1202 * <p>
1203 * Type: TEXT
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001204 * @deprecated since this isn't supported by gd:structuredPostalAddress
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001205 */
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001206 @Deprecated
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001207 public static final String SUBREGION = "data10";
1208
1209 /**
1210 * A state, province, county (in Ireland), Land (in Germany),
1211 * departement (in France), etc.
1212 * <p>
1213 * Type: TEXT
1214 */
1215 public static final String REGION = "data11";
1216
1217 /**
Jeff Sharkeyef348c72009-07-26 14:14:34 -07001218 * Postal code. Usually country-wide, but sometimes specific to the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001219 * city (e.g. "2" in "Dublin 2, Ireland" addresses).
1220 * <p>
1221 * Type: TEXT
1222 */
1223 public static final String POSTCODE = "data12";
1224
1225 /**
1226 * The name or code of the country.
1227 * <p>
1228 * Type: TEXT
1229 */
1230 public static final String COUNTRY = "data13";
Evan Millar088b2912009-05-28 15:24:37 -07001231 }
1232
Fred Quintana8851e162009-08-05 21:06:45 -07001233 /**
1234 * Common data definition for IM addresses.
1235 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001236 public static final class Im implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001237 private Im() {}
1238
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001239 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001240 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im";
1241
Evan Millar088b2912009-05-28 15:24:37 -07001242 public static final int TYPE_HOME = 1;
1243 public static final int TYPE_WORK = 2;
1244 public static final int TYPE_OTHER = 3;
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001245
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001246 /**
1247 * This column should be populated with one of the defined
1248 * constants, e.g. {@link #PROTOCOL_YAHOO}. If the value of this
1249 * column is {@link #PROTOCOL_CUSTOM}, the {@link #CUSTOM_PROTOCOL}
1250 * should contain the name of the custom protocol.
1251 */
Evan Millar088b2912009-05-28 15:24:37 -07001252 public static final String PROTOCOL = "data5";
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001253
Jeff Sharkey732da922009-07-30 09:59:31 -07001254 public static final String CUSTOM_PROTOCOL = "data6";
1255
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001256 /*
1257 * The predefined IM protocol types.
Evan Millar088b2912009-05-28 15:24:37 -07001258 */
Jeff Sharkey732da922009-07-30 09:59:31 -07001259 public static final int PROTOCOL_CUSTOM = -1;
Evan Millar088b2912009-05-28 15:24:37 -07001260 public static final int PROTOCOL_AIM = 0;
1261 public static final int PROTOCOL_MSN = 1;
1262 public static final int PROTOCOL_YAHOO = 2;
1263 public static final int PROTOCOL_SKYPE = 3;
1264 public static final int PROTOCOL_QQ = 4;
1265 public static final int PROTOCOL_GOOGLE_TALK = 5;
1266 public static final int PROTOCOL_ICQ = 6;
1267 public static final int PROTOCOL_JABBER = 7;
Fred Quintana8851e162009-08-05 21:06:45 -07001268 public static final int PROTOCOL_NETMEETING = 8;
Evan Millar088b2912009-05-28 15:24:37 -07001269 }
1270
1271 /**
1272 * Common data definition for organizations.
1273 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001274 public static final class Organization implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001275 private Organization() {}
1276
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001277 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001278 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization";
1279
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001280 public static final int TYPE_WORK = 1;
1281 public static final int TYPE_OTHER = 2;
Evan Millar088b2912009-05-28 15:24:37 -07001282
1283 /**
1284 * The company as the user entered it.
1285 * <P>Type: TEXT</P>
1286 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001287 public static final String COMPANY = DATA;
Evan Millar088b2912009-05-28 15:24:37 -07001288
1289 /**
1290 * The position title at this company as the user entered it.
1291 * <P>Type: TEXT</P>
1292 */
1293 public static final String TITLE = "data4";
Fred Quintana8851e162009-08-05 21:06:45 -07001294
1295 /**
1296 * The department at this company as the user entered it.
1297 * <P>Type: TEXT</P>
1298 */
1299 public static final String DEPARTMENT = "data5";
1300
1301 /**
1302 * The job description at this company as the user entered it.
1303 * <P>Type: TEXT</P>
1304 */
1305 public static final String JOB_DESCRIPTION = "data6";
1306
1307 /**
1308 * The symbol of this company as the user entered it.
1309 * <P>Type: TEXT</P>
1310 */
1311 public static final String SYMBOL = "data7";
1312
1313 /**
1314 * The phonetic name of this company as the user entered it.
1315 * <P>Type: TEXT</P>
1316 */
1317 public static final String PHONETIC_NAME = "data8";
1318 }
1319
1320 /**
1321 * Common data definition for miscellaneous information.
1322 */
1323 public static final class Miscellaneous implements BaseCommonColumns {
1324 private Miscellaneous() {}
1325
1326 /** MIME type used when storing this in data table. */
1327 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/misc";
1328
1329 /**
1330 * The birthday as the user entered it.
1331 * <P>Type: TEXT</P>
1332 */
1333 public static final String BIRTHDAY = "data1";
1334
1335 /**
1336 * The nickname as the user entered it.
1337 * <P>Type: TEXT</P>
1338 */
1339 public static final String NICKNAME = "data2";
1340 }
1341
1342 /**
1343 * Common data definition for relations.
1344 */
1345 public static final class Relation implements BaseCommonColumns, CommonColumns {
1346 private Relation() {}
1347
1348 /** MIME type used when storing this in data table. */
1349 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/relation";
1350
1351 public static final int TYPE_ASSISTANT = 1;
1352 public static final int TYPE_BROTHER = 2;
1353 public static final int TYPE_CHILD = 3;
1354 public static final int TYPE_DOMESTIC_PARTNER = 4;
1355 public static final int TYPE_FATHER = 5;
1356 public static final int TYPE_FRIEND = 6;
1357 public static final int TYPE_MANAGER = 7;
1358 public static final int TYPE_MOTHER = 8;
1359 public static final int TYPE_PARENT = 9;
1360 public static final int TYPE_PARTNER = 10;
1361 public static final int TYPE_REFERRED_BY = 11;
1362 public static final int TYPE_RELATIVE = 12;
1363 public static final int TYPE_SISTER = 13;
1364 public static final int TYPE_SPOUSE = 14;
1365
1366 /**
1367 * The name of the relative as the user entered it.
1368 * <P>Type: TEXT</P>
1369 */
1370 public static final String NAME = DATA;
1371 }
1372
1373 /**
1374 * Common data definition for events.
1375 */
1376 public static final class Event implements BaseCommonColumns, CommonColumns {
1377 private Event() {}
1378
1379 /** MIME type used when storing this in data table. */
1380 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/event";
1381
1382 public static final int TYPE_ANNIVERSARY = 1;
1383 public static final int TYPE_OTHER = 2;
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001384
Fred Quintana8851e162009-08-05 21:06:45 -07001385 /**
1386 * The event start date as the user entered it.
1387 * <P>Type: TEXT</P>
1388 */
1389 public static final String START_DATE = DATA;
Evan Millar088b2912009-05-28 15:24:37 -07001390 }
1391
1392 /**
1393 * Photo of the contact.
1394 */
1395 public static final class Photo implements BaseCommonColumns {
1396 private Photo() {}
1397
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001398 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001399 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo";
1400
1401 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -07001402 * Thumbnail photo of the raw contact. This is the raw bytes of an image
Evan Millar088b2912009-05-28 15:24:37 -07001403 * that could be inflated using {@link BitmapFactory}.
1404 * <p>
1405 * Type: BLOB
1406 */
1407 public static final String PHOTO = "data1";
1408 }
1409
1410 /**
1411 * Notes about the contact.
1412 */
1413 public static final class Note implements BaseCommonColumns {
1414 private Note() {}
1415
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001416 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001417 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
1418
1419 /**
1420 * The note text.
1421 * <P>Type: TEXT</P>
1422 */
1423 public static final String NOTE = "data1";
1424 }
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001425
Dmitri Plotnikovc9260542009-05-28 17:55:12 -07001426 /**
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001427 * Group Membership.
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001428 */
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001429 public static final class GroupMembership implements BaseCommonColumns {
1430 private GroupMembership() {}
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001431
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001432 /** MIME type used when storing this in data table. */
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001433 public static final String CONTENT_ITEM_TYPE =
1434 "vnd.android.cursor.item/group_membership";
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001435
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001436 /**
Fred Quintanaffc34c12009-07-14 16:02:58 -07001437 * The row id of the group that this group membership refers to. Exactly one of
1438 * this or {@link #GROUP_SOURCE_ID} must be set when inserting a row.
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001439 * <P>Type: INTEGER</P>
1440 */
1441 public static final String GROUP_ROW_ID = "data1";
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001442
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001443 /**
Fred Quintanaffc34c12009-07-14 16:02:58 -07001444 * The sourceid of the group that this group membership refers to. Exactly one of
1445 * this or {@link #GROUP_ROW_ID} must be set when inserting a row.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001446 * <P>Type: TEXT</P>
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001447 */
Fred Quintanaffc34c12009-07-14 16:02:58 -07001448 public static final String GROUP_SOURCE_ID = "group_sourceid";
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001449 }
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001450
1451 /**
1452 * Website related to the contact.
1453 */
Fred Quintana8851e162009-08-05 21:06:45 -07001454 public static final class Website implements BaseCommonColumns, CommonColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001455 private Website() {}
1456
1457 /** MIME type used when storing this in data table. */
1458 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website";
1459
Fred Quintana8851e162009-08-05 21:06:45 -07001460 public static final int TYPE_HOMEPAGE = 1;
1461 public static final int TYPE_BLOG = 2;
1462 public static final int TYPE_PROFILE = 3;
1463 public static final int TYPE_HOME = 4;
1464 public static final int TYPE_WORK = 5;
1465 public static final int TYPE_FTP = 6;
1466 public static final int TYPE_OTHER = 7;
1467
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001468 /**
1469 * The website URL string.
1470 * <P>Type: TEXT</P>
1471 */
1472 public static final String URL = "data1";
1473 }
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001474 }
Fred Quintana435e4272009-06-04 17:30:28 -07001475
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001476 // TODO: make this private before unhiding
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001477 public interface GroupsColumns {
1478 /**
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001479 * The display title of this group.
1480 * <p>
1481 * Type: TEXT
1482 */
1483 public static final String TITLE = "title";
1484
1485 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001486 * The package name to use when creating {@link Resources} objects for
1487 * this group. This value is only designed for use when building user
1488 * interfaces, and should not be used to infer the owner.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001489 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001490 public static final String RES_PACKAGE = "res_package";
1491
1492 /**
1493 * The display title of this group to load as a resource from
1494 * {@link #RES_PACKAGE}, which may be localized.
1495 * <P>Type: TEXT</P>
1496 */
1497 public static final String TITLE_RES = "title_res";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001498
1499 /**
Dmitri Plotnikov02c5b452009-07-22 15:13:08 -07001500 * Notes about the group.
1501 * <p>
1502 * Type: TEXT
1503 */
1504 public static final String NOTES = "notes";
1505
1506 /**
1507 * The ID of this group if it is a System Group, i.e. a group that has a special meaning
1508 * to the sync adapter, null otherwise.
1509 * <P>Type: TEXT</P>
1510 */
1511 public static final String SYSTEM_ID = "system_id";
1512
1513 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001514 * The total number of {@link Contacts} that have
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001515 * {@link CommonDataKinds.GroupMembership} in this group. Read-only value that is only
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001516 * present when querying {@link Groups#CONTENT_SUMMARY_URI}.
1517 * <p>
1518 * Type: INTEGER
1519 */
1520 public static final String SUMMARY_COUNT = "summ_count";
1521
1522 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001523 * The total number of {@link Contacts} that have both
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001524 * {@link CommonDataKinds.GroupMembership} in this group, and also have phone numbers.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001525 * Read-only value that is only present when querying
1526 * {@link Groups#CONTENT_SUMMARY_URI}.
1527 * <p>
1528 * Type: INTEGER
1529 */
1530 public static final String SUMMARY_WITH_PHONES = "summ_phones";
1531
1532 /**
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001533 * Flag indicating if the contacts belonging to this group should be
1534 * visible in any user interface.
1535 * <p>
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001536 * Type: INTEGER (boolean)
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001537 */
1538 public static final String GROUP_VISIBLE = "group_visible";
Fred Quintana00c89f62009-08-10 14:43:24 -07001539
1540 /**
1541 * The "deleted" flag: "0" by default, "1" if the row has been marked
1542 * for deletion. When {@link android.content.ContentResolver#delete} is
1543 * called on a raw contact, it is marked for deletion and removed from its
1544 * aggregate contact. The sync adaptor deletes the raw contact on the server and
1545 * then calls ContactResolver.delete once more, this time passing the
1546 * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal.
1547 * <P>Type: INTEGER</P>
1548 */
1549 public static final String DELETED = "deleted";
Jeff Sharkey403d7ac2009-08-16 16:34:35 -07001550
1551 /**
1552 * Whether this group should be synced if the SYNC_EVERYTHING settings
1553 * is false for this group's account.
1554 * <p>
1555 * Type: INTEGER (boolean)
1556 */
1557 public static final String SHOULD_SYNC = "should_sync";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001558 }
1559
1560 /**
1561 * Constants for the groups table.
1562 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001563 public static final class Groups implements BaseColumns, GroupsColumns, SyncColumns {
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001564 /**
1565 * This utility class cannot be instantiated
1566 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001567 private Groups() {
1568 }
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001569
1570 /**
1571 * The content:// style URI for this table
1572 */
1573 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "groups");
1574
1575 /**
1576 * The content:// style URI for this table joined with details data from
Dmitri Plotnikov02c5b452009-07-22 15:13:08 -07001577 * {@link Data}.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001578 */
1579 public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI,
1580 "groups_summary");
1581
1582 /**
1583 * The MIME type of a directory of groups.
1584 */
1585 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group";
1586
1587 /**
1588 * The MIME type of a single group.
1589 */
1590 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
Fred Quintana00c89f62009-08-10 14:43:24 -07001591
1592 /**
1593 * Query parameter that can be passed with the {@link #CONTENT_URI} URI
1594 * to the {@link android.content.ContentResolver#delete} method to
1595 * indicate that the raw contact can be deleted physically, rather than
1596 * merely marked as deleted.
1597 */
1598 public static final String DELETE_PERMANENTLY = "delete_permanently";
Dmitri Plotnikov507f1602009-08-10 17:37:36 -07001599
1600 /**
1601 * An optional update or insert URI parameter that determines if the
1602 * group should be marked as dirty. The default value is true.
1603 */
1604 public static final String MARK_AS_DIRTY = "mark_as_dirty";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001605 }
1606
Fred Quintana435e4272009-06-04 17:30:28 -07001607 /**
1608 * Constants for the contact aggregation exceptions table, which contains
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001609 * aggregation rules overriding those used by automatic aggregation. This type only
1610 * supports query and update. Neither insert nor delete are supported.
Fred Quintana435e4272009-06-04 17:30:28 -07001611 */
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -07001612 public static final class AggregationExceptions implements BaseColumns {
Fred Quintana435e4272009-06-04 17:30:28 -07001613 /**
1614 * This utility class cannot be instantiated
1615 */
1616 private AggregationExceptions() {}
1617
1618 /**
1619 * The content:// style URI for this table
1620 */
1621 public static final Uri CONTENT_URI =
1622 Uri.withAppendedPath(AUTHORITY_URI, "aggregation_exceptions");
1623
1624 /**
1625 * The MIME type of {@link #CONTENT_URI} providing a directory of data.
1626 */
1627 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
1628
1629 /**
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -07001630 * The MIME type of a {@link #CONTENT_URI} subdirectory of an aggregation exception
1631 */
1632 public static final String CONTENT_ITEM_TYPE =
1633 "vnd.android.cursor.item/aggregation_exception";
1634
1635 /**
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001636 * The type of exception: {@link #TYPE_KEEP_IN}, {@link #TYPE_KEEP_OUT} or
1637 * {@link #TYPE_AUTOMATIC}.
Fred Quintana435e4272009-06-04 17:30:28 -07001638 *
1639 * <P>Type: INTEGER</P>
1640 */
1641 public static final String TYPE = "type";
1642
Fred Quintana435e4272009-06-04 17:30:28 -07001643 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001644 * Allows the provider to automatically decide whether the aggregate
1645 * contact should include a particular raw contact or not.
Fred Quintana435e4272009-06-04 17:30:28 -07001646 */
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001647 public static final int TYPE_AUTOMATIC = 0;
Fred Quintana435e4272009-06-04 17:30:28 -07001648
1649 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001650 * Makes sure that the specified raw contact is included in the
1651 * specified aggregate contact.
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001652 */
1653 public static final int TYPE_KEEP_IN = 1;
1654
1655 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001656 * Makes sure that the specified raw contact is NOT included in the
1657 * specified aggregate contact.
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001658 */
1659 public static final int TYPE_KEEP_OUT = 2;
1660
1661 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001662 * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} of the
1663 * aggregate contact that the rule applies to.
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001664 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001665 public static final String CONTACT_ID = "contact_id";
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001666
1667 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001668 * A reference to the {@link RawContacts#_ID} of the raw contact that the rule applies to.
Fred Quintana435e4272009-06-04 17:30:28 -07001669 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -07001670 public static final String RAW_CONTACT_ID = "raw_contact_id";
Fred Quintana435e4272009-06-04 17:30:28 -07001671 }
Jeff Sharkey28b68e52009-06-10 15:26:58 -07001672
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001673 private interface SettingsColumns {
1674 /**
1675 * The name of the account instance to which this row belongs.
1676 * <P>Type: TEXT</P>
1677 */
1678 public static final String ACCOUNT_NAME = "account_name";
1679
1680 /**
1681 * The type of account to which this row belongs, which when paired with
1682 * {@link #ACCOUNT_NAME} identifies a specific account.
1683 * <P>Type: TEXT</P>
1684 */
1685 public static final String ACCOUNT_TYPE = "account_type";
1686
1687 /**
Jeff Sharkey06a03232009-08-21 17:37:56 -07001688 * Depending on the mode defined by the sync-adapter, this flag controls
1689 * the top-level sync behavior for this data source.
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001690 * <p>
1691 * Type: INTEGER (boolean)
1692 */
1693 public static final String SHOULD_SYNC = "should_sync";
1694
1695 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001696 * Flag indicating if contacts without any {@link CommonDataKinds.GroupMembership}
Jeff Sharkeya6597442009-08-19 09:23:33 -07001697 * entries should be visible in any user interface.
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001698 * <p>
1699 * Type: INTEGER (boolean)
1700 */
1701 public static final String UNGROUPED_VISIBLE = "ungrouped_visible";
Jeff Sharkey06a03232009-08-21 17:37:56 -07001702
1703 /**
1704 * Read-only count of {@link Contacts} from a specific source that have
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -07001705 * no {@link CommonDataKinds.GroupMembership} entries.
Jeff Sharkey06a03232009-08-21 17:37:56 -07001706 * <p>
1707 * Type: INTEGER
1708 */
1709 public static final String UNGROUPED_COUNT = "summ_count";
1710
1711 /**
1712 * Read-only count of {@link Contacts} from a specific source that have
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -07001713 * no {@link CommonDataKinds.GroupMembership} entries, and also have phone numbers.
Jeff Sharkey06a03232009-08-21 17:37:56 -07001714 * <p>
1715 * Type: INTEGER
1716 */
1717 public static final String UNGROUPED_WITH_PHONES = "summ_phones";
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001718 }
1719
1720 /**
1721 * Contacts-specific settings for various {@link Account}.
1722 */
Jeff Sharkey06a03232009-08-21 17:37:56 -07001723 public static final class Settings implements SettingsColumns {
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001724 /**
1725 * This utility class cannot be instantiated
1726 */
1727 private Settings() {
1728 }
1729
1730 /**
1731 * The content:// style URI for this table
1732 */
1733 public static final Uri CONTENT_URI =
1734 Uri.withAppendedPath(AUTHORITY_URI, "settings");
1735
1736 /**
1737 * The MIME-type of {@link #CONTENT_URI} providing a directory of
1738 * settings.
1739 */
1740 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/setting";
1741
1742 /**
1743 * The MIME-type of {@link #CONTENT_URI} providing a single setting.
1744 */
1745 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/setting";
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001746 }
1747
Evan Millardc2da5f2009-06-18 16:07:13 -07001748 /**
1749 * Contains helper classes used to create or manage {@link android.content.Intent Intents}
1750 * that involve contacts.
1751 */
1752 public static final class Intents {
1753 /**
1754 * This is the intent that is fired when a search suggestion is clicked on.
1755 */
1756 public static final String SEARCH_SUGGESTION_CLICKED =
1757 "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
1758
1759 /**
1760 * This is the intent that is fired when a search suggestion for dialing a number
1761 * is clicked on.
1762 */
1763 public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED =
1764 "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
1765
1766 /**
1767 * This is the intent that is fired when a search suggestion for creating a contact
1768 * is clicked on.
1769 */
1770 public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED =
1771 "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
1772
1773 /**
1774 * Starts an Activity that lets the user pick a contact to attach an image to.
1775 * After picking the contact it launches the image cropper in face detection mode.
1776 */
1777 public static final String ATTACH_IMAGE =
1778 "com.android.contacts.action.ATTACH_IMAGE";
1779
1780 /**
1781 * Takes as input a data URI with a mailto: or tel: scheme. If a single
1782 * contact exists with the given data it will be shown. If no contact
1783 * exists, a dialog will ask the user if they want to create a new
1784 * contact with the provided details filled in. If multiple contacts
1785 * share the data the user will be prompted to pick which contact they
1786 * want to view.
1787 * <p>
1788 * For <code>mailto:</code> URIs, the scheme specific portion must be a
1789 * raw email address, such as one built using
1790 * {@link Uri#fromParts(String, String, String)}.
1791 * <p>
1792 * For <code>tel:</code> URIs, the scheme specific portion is compared
1793 * to existing numbers using the standard caller ID lookup algorithm.
1794 * The number must be properly encoded, for example using
1795 * {@link Uri#fromParts(String, String, String)}.
1796 * <p>
1797 * Any extras from the {@link Insert} class will be passed along to the
1798 * create activity if there are no contacts to show.
1799 * <p>
1800 * Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip
1801 * prompting the user when the contact doesn't exist.
1802 */
1803 public static final String SHOW_OR_CREATE_CONTACT =
1804 "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
1805
1806 /**
1807 * Used with {@link #SHOW_OR_CREATE_CONTACT} to force creating a new
1808 * contact if no matching contact found. Otherwise, default behavior is
1809 * to prompt user with dialog before creating.
1810 * <p>
1811 * Type: BOOLEAN
1812 */
1813 public static final String EXTRA_FORCE_CREATE =
1814 "com.android.contacts.action.FORCE_CREATE";
1815
1816 /**
1817 * Used with {@link #SHOW_OR_CREATE_CONTACT} to specify an exact
1818 * description to be shown when prompting user about creating a new
1819 * contact.
1820 * <p>
1821 * Type: STRING
1822 */
1823 public static final String EXTRA_CREATE_DESCRIPTION =
1824 "com.android.contacts.action.CREATE_DESCRIPTION";
1825
1826 /**
Jeff Sharkey11322002009-06-04 17:25:51 -07001827 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a
1828 * dialog location using screen coordinates. When not specified, the
1829 * dialog will be centered.
1830 */
1831 public static final String EXTRA_TARGET_RECT = "target_rect";
1832
1833 /**
Jeff Sharkey6bfe14d2009-08-05 15:49:48 -07001834 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a
1835 * desired dialog style, usually a variation on size. One of
1836 * {@link #MODE_SMALL}, {@link #MODE_MEDIUM}, or {@link #MODE_LARGE}.
1837 */
1838 public static final String EXTRA_MODE = "mode";
1839
1840 /**
1841 * Value for {@link #EXTRA_MODE} to show a small-sized dialog.
1842 */
1843 public static final int MODE_SMALL = 1;
1844
1845 /**
1846 * Value for {@link #EXTRA_MODE} to show a medium-sized dialog.
1847 */
1848 public static final int MODE_MEDIUM = 2;
1849
1850 /**
1851 * Value for {@link #EXTRA_MODE} to show a large-sized dialog.
1852 */
1853 public static final int MODE_LARGE = 3;
1854
1855 /**
Jeff Sharkey84235ee2009-08-23 14:07:02 -07001856 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to indicate
1857 * a list of specific MIME-types to exclude and not display. Stored as a
1858 * {@link String} array.
1859 */
1860 public static final String EXTRA_EXCLUDE_MIMES = "exclude_mimes";
1861
1862 /**
Evan Millardc2da5f2009-06-18 16:07:13 -07001863 * Intents related to the Contacts app UI.
1864 */
1865 public static final class UI {
1866 /**
1867 * The action for the default contacts list tab.
1868 */
1869 public static final String LIST_DEFAULT =
1870 "com.android.contacts.action.LIST_DEFAULT";
1871
1872 /**
1873 * The action for the contacts list tab.
1874 */
1875 public static final String LIST_GROUP_ACTION =
1876 "com.android.contacts.action.LIST_GROUP";
1877
1878 /**
1879 * When in LIST_GROUP_ACTION mode, this is the group to display.
1880 */
1881 public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP";
1882
1883 /**
1884 * The action for the all contacts list tab.
1885 */
1886 public static final String LIST_ALL_CONTACTS_ACTION =
1887 "com.android.contacts.action.LIST_ALL_CONTACTS";
1888
1889 /**
1890 * The action for the contacts with phone numbers list tab.
1891 */
1892 public static final String LIST_CONTACTS_WITH_PHONES_ACTION =
1893 "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES";
1894
1895 /**
1896 * The action for the starred contacts list tab.
1897 */
1898 public static final String LIST_STARRED_ACTION =
1899 "com.android.contacts.action.LIST_STARRED";
1900
1901 /**
1902 * The action for the frequent contacts list tab.
1903 */
1904 public static final String LIST_FREQUENT_ACTION =
1905 "com.android.contacts.action.LIST_FREQUENT";
1906
1907 /**
1908 * The action for the "strequent" contacts list tab. It first lists the starred
1909 * contacts in alphabetical order and then the frequent contacts in descending
1910 * order of the number of times they have been contacted.
1911 */
1912 public static final String LIST_STREQUENT_ACTION =
1913 "com.android.contacts.action.LIST_STREQUENT";
1914
1915 /**
1916 * A key for to be used as an intent extra to set the activity
1917 * title to a custom String value.
1918 */
1919 public static final String TITLE_EXTRA_KEY =
1920 "com.android.contacts.extra.TITLE_EXTRA";
1921
1922 /**
1923 * Activity Action: Display a filtered list of contacts
1924 * <p>
1925 * Input: Extra field {@link #FILTER_TEXT_EXTRA_KEY} is the text to use for
1926 * filtering
1927 * <p>
1928 * Output: Nothing.
1929 */
1930 public static final String FILTER_CONTACTS_ACTION =
1931 "com.android.contacts.action.FILTER_CONTACTS";
1932
1933 /**
1934 * Used as an int extra field in {@link #FILTER_CONTACTS_ACTION}
1935 * intents to supply the text on which to filter.
1936 */
1937 public static final String FILTER_TEXT_EXTRA_KEY =
1938 "com.android.contacts.extra.FILTER_TEXT";
1939 }
1940
1941 /**
1942 * Convenience class that contains string constants used
1943 * to create contact {@link android.content.Intent Intents}.
1944 */
1945 public static final class Insert {
1946 /** The action code to use when adding a contact */
1947 public static final String ACTION = Intent.ACTION_INSERT;
1948
1949 /**
1950 * If present, forces a bypass of quick insert mode.
1951 */
1952 public static final String FULL_MODE = "full_mode";
1953
1954 /**
1955 * The extra field for the contact name.
1956 * <P>Type: String</P>
1957 */
1958 public static final String NAME = "name";
1959
1960 // TODO add structured name values here.
1961
1962 /**
1963 * The extra field for the contact phonetic name.
1964 * <P>Type: String</P>
1965 */
1966 public static final String PHONETIC_NAME = "phonetic_name";
1967
1968 /**
1969 * The extra field for the contact company.
1970 * <P>Type: String</P>
1971 */
1972 public static final String COMPANY = "company";
1973
1974 /**
1975 * The extra field for the contact job title.
1976 * <P>Type: String</P>
1977 */
1978 public static final String JOB_TITLE = "job_title";
1979
1980 /**
1981 * The extra field for the contact notes.
1982 * <P>Type: String</P>
1983 */
1984 public static final String NOTES = "notes";
1985
1986 /**
1987 * The extra field for the contact phone number.
1988 * <P>Type: String</P>
1989 */
1990 public static final String PHONE = "phone";
1991
1992 /**
1993 * The extra field for the contact phone number type.
1994 * <P>Type: Either an integer value from
1995 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
1996 * or a string specifying a custom label.</P>
1997 */
1998 public static final String PHONE_TYPE = "phone_type";
1999
2000 /**
2001 * The extra field for the phone isprimary flag.
2002 * <P>Type: boolean</P>
2003 */
2004 public static final String PHONE_ISPRIMARY = "phone_isprimary";
2005
2006 /**
2007 * The extra field for an optional second contact phone number.
2008 * <P>Type: String</P>
2009 */
2010 public static final String SECONDARY_PHONE = "secondary_phone";
2011
2012 /**
2013 * The extra field for an optional second contact phone number type.
2014 * <P>Type: Either an integer value from
2015 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
2016 * or a string specifying a custom label.</P>
2017 */
2018 public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
2019
2020 /**
2021 * The extra field for an optional third contact phone number.
2022 * <P>Type: String</P>
2023 */
2024 public static final String TERTIARY_PHONE = "tertiary_phone";
2025
2026 /**
2027 * The extra field for an optional third contact phone number type.
2028 * <P>Type: Either an integer value from
2029 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
2030 * or a string specifying a custom label.</P>
2031 */
2032 public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
2033
2034 /**
2035 * The extra field for the contact email address.
2036 * <P>Type: String</P>
2037 */
2038 public static final String EMAIL = "email";
2039
2040 /**
2041 * The extra field for the contact email type.
2042 * <P>Type: Either an integer value from
2043 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2044 * or a string specifying a custom label.</P>
2045 */
2046 public static final String EMAIL_TYPE = "email_type";
2047
2048 /**
2049 * The extra field for the email isprimary flag.
2050 * <P>Type: boolean</P>
2051 */
2052 public static final String EMAIL_ISPRIMARY = "email_isprimary";
2053
2054 /**
2055 * The extra field for an optional second contact email address.
2056 * <P>Type: String</P>
2057 */
2058 public static final String SECONDARY_EMAIL = "secondary_email";
2059
2060 /**
2061 * The extra field for an optional second contact email type.
2062 * <P>Type: Either an integer value from
2063 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2064 * or a string specifying a custom label.</P>
2065 */
2066 public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type";
2067
2068 /**
2069 * The extra field for an optional third contact email address.
2070 * <P>Type: String</P>
2071 */
2072 public static final String TERTIARY_EMAIL = "tertiary_email";
2073
2074 /**
2075 * The extra field for an optional third contact email type.
2076 * <P>Type: Either an integer value from
2077 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2078 * or a string specifying a custom label.</P>
2079 */
2080 public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
2081
2082 /**
2083 * The extra field for the contact postal address.
2084 * <P>Type: String</P>
2085 */
2086 public static final String POSTAL = "postal";
2087
2088 /**
2089 * The extra field for the contact postal address type.
2090 * <P>Type: Either an integer value from
2091 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2092 * or a string specifying a custom label.</P>
2093 */
2094 public static final String POSTAL_TYPE = "postal_type";
2095
2096 /**
2097 * The extra field for the postal isprimary flag.
2098 * <P>Type: boolean</P>
2099 */
2100 public static final String POSTAL_ISPRIMARY = "postal_isprimary";
2101
2102 /**
2103 * The extra field for an IM handle.
2104 * <P>Type: String</P>
2105 */
2106 public static final String IM_HANDLE = "im_handle";
2107
2108 /**
2109 * The extra field for the IM protocol
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07002110 * <P>Type: the result of {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)}
2111 * or {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}.</P>
Evan Millardc2da5f2009-06-18 16:07:13 -07002112 */
2113 public static final String IM_PROTOCOL = "im_protocol";
2114
2115 /**
2116 * The extra field for the IM isprimary flag.
2117 * <P>Type: boolean</P>
2118 */
2119 public static final String IM_ISPRIMARY = "im_isprimary";
2120 }
2121 }
2122
Evan Millar088b2912009-05-28 15:24:37 -07002123}