blob: b0ac7f4b860893e9eb56485a049247a50f36f932 [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;
Fred Quintanac4516a72009-09-03 12:14:06 -070032import android.util.Pair;
Evan Millar088b2912009-05-28 15:24:37 -070033
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -070034import java.io.ByteArrayInputStream;
35import java.io.InputStream;
36
Evan Millar088b2912009-05-28 15:24:37 -070037/**
38 * The contract between the contacts provider and applications. Contains definitions
39 * for the supported URIs and columns.
40 *
Dmitri Plotnikov5f123bd2009-05-28 18:06:31 -070041 * @hide
Evan Millar088b2912009-05-28 15:24:37 -070042 */
43public final class ContactsContract {
44 /** The authority for the contacts provider */
45 public static final String AUTHORITY = "com.android.contacts";
46 /** A content:// style uri to the authority for the contacts provider */
47 public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
48
Fred Quintana33f889a2009-09-14 17:31:26 -070049 /**
50 * An optional insert, update or delete URI parameter that allows the caller
51 * to specify that it is a sync adapter. The default value is false. If true
52 * the dirty flag is not automatically set and the "syncToNetwork" parameter
53 * is set to false when calling
54 * {@link ContentResolver#notifyChange(android.net.Uri, android.database.ContentObserver, boolean)}.
55 */
56 public static final String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
57
Fred Quintana0f4e1ab2009-07-09 17:20:59 -070058 public interface SyncStateColumns extends SyncStateContract.Columns {
59 }
60
61 public static final class SyncState {
62 /**
63 * This utility class cannot be instantiated
64 */
65 private SyncState() {}
66
67 public static final String CONTENT_DIRECTORY =
68 SyncStateContract.Constants.CONTENT_DIRECTORY;
69
70 /**
71 * The content:// style URI for this table
72 */
73 public static final Uri CONTENT_URI =
74 Uri.withAppendedPath(AUTHORITY_URI, CONTENT_DIRECTORY);
75
76 /**
77 * @see android.provider.SyncStateContract.Helpers#get
78 */
79 public static byte[] get(ContentProviderClient provider, Account account)
80 throws RemoteException {
81 return SyncStateContract.Helpers.get(provider, CONTENT_URI, account);
82 }
83
84 /**
Fred Quintanac4516a72009-09-03 12:14:06 -070085 * @see android.provider.SyncStateContract.Helpers#get
86 */
87 public static Pair<Uri, byte[]> getWithUri(ContentProviderClient provider, Account account)
88 throws RemoteException {
89 return SyncStateContract.Helpers.getWithUri(provider, CONTENT_URI, account);
90 }
91
92 /**
Fred Quintana0f4e1ab2009-07-09 17:20:59 -070093 * @see android.provider.SyncStateContract.Helpers#set
94 */
95 public static void set(ContentProviderClient provider, Account account, byte[] data)
96 throws RemoteException {
97 SyncStateContract.Helpers.set(provider, CONTENT_URI, account, data);
98 }
99
100 /**
101 * @see android.provider.SyncStateContract.Helpers#newSetOperation
102 */
103 public static ContentProviderOperation newSetOperation(Account account, byte[] data) {
104 return SyncStateContract.Helpers.newSetOperation(CONTENT_URI, account, data);
105 }
106 }
107
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700108 /**
109 * Generic columns for use by sync adapters. The specific functions of
110 * these columns are private to the sync adapter. Other clients of the API
111 * should not attempt to either read or write this column.
112 */
113 private interface BaseSyncColumns {
114
115 /** Generic column for use by sync adapters. */
116 public static final String SYNC1 = "sync1";
117 /** Generic column for use by sync adapters. */
118 public static final String SYNC2 = "sync2";
119 /** Generic column for use by sync adapters. */
120 public static final String SYNC3 = "sync3";
121 /** Generic column for use by sync adapters. */
122 public static final String SYNC4 = "sync4";
123 }
124
125 /**
126 * Columns that appear when each row of a table belongs to a specific
127 * account, including sync information that an account may need.
128 */
129 private interface SyncColumns extends BaseSyncColumns {
130 /**
131 * The name of the account instance to which this row belongs.
132 * <P>Type: TEXT</P>
133 */
134 public static final String ACCOUNT_NAME = "account_name";
135
136 /**
137 * The type of account to which this row belongs, which when paired with
138 * {@link #ACCOUNT_NAME} identifies a specific account.
139 * <P>Type: TEXT</P>
140 */
141 public static final String ACCOUNT_TYPE = "account_type";
142
143 /**
144 * String that uniquely identifies this row to its source account.
145 * <P>Type: TEXT</P>
146 */
147 public static final String SOURCE_ID = "sourceid";
148
149 /**
150 * Version number that is updated whenever this row or its related data
151 * changes.
152 * <P>Type: INTEGER</P>
153 */
154 public static final String VERSION = "version";
155
156 /**
157 * Flag indicating that {@link #VERSION} has changed, and this row needs
158 * to be synchronized by its owning account.
159 * <P>Type: INTEGER (boolean)</P>
160 */
161 public static final String DIRTY = "dirty";
162 }
163
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700164 public interface ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700165 /**
166 * The number of times a person has been contacted
167 * <P>Type: INTEGER</P>
168 */
169 public static final String TIMES_CONTACTED = "times_contacted";
170
171 /**
172 * The last time a person was contacted.
173 * <P>Type: INTEGER</P>
174 */
175 public static final String LAST_TIME_CONTACTED = "last_time_contacted";
176
177 /**
178 * Is the contact starred?
179 * <P>Type: INTEGER (boolean)</P>
180 */
181 public static final String STARRED = "starred";
182
183 /**
Dmitri Plotnikov693d50e2009-06-22 14:57:31 -0700184 * A custom ringtone associated with a person. Not always present.
185 * <P>Type: TEXT (URI to the ringtone)</P>
186 */
187 public static final String CUSTOM_RINGTONE = "custom_ringtone";
188
189 /**
190 * Whether the person should always be sent to voicemail. Not always
191 * present.
192 * <P>Type: INTEGER (0 for false, 1 for true)</P>
193 */
194 public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700195 }
196
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700197 private interface ContactsColumns {
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700198 /**
199 * The display name for the contact.
200 * <P>Type: TEXT</P>
201 */
202 public static final String DISPLAY_NAME = "display_name";
Dmitri Plotnikov693d50e2009-06-22 14:57:31 -0700203
204 /**
Evan Millar088b2912009-05-28 15:24:37 -0700205 * Reference to the row in the data table holding the photo.
206 * <P>Type: INTEGER REFERENCES data(_id)</P>
207 */
208 public static final String PHOTO_ID = "photo_id";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -0700209
210 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700211 * Lookup value that reflects the {@link Groups#GROUP_VISIBLE} state of
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700212 * any {@link CommonDataKinds.GroupMembership} for this contact.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -0700213 */
214 public static final String IN_VISIBLE_GROUP = "in_visible_group";
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700215
216 /**
217 * Contact presence status. See {@link android.provider.Im.CommonPresenceColumns}
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700218 * for individual status definitions. This column is only returned if explicitly
219 * requested in the query projection.
220 * <p>Type: NUMBER</p>
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700221 */
222 public static final String PRESENCE_STATUS = Presence.PRESENCE_STATUS;
223
224 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700225 * Contact presence custom status. This column is only returned if explicitly
226 * requested in the query projection.
227 * <p>Type: TEXT</p>
228 */
229 public static final String PRESENCE_CUSTOM_STATUS = Presence.PRESENCE_CUSTOM_STATUS;
230
231 /**
Dmitri Plotnikov074fbfe2009-08-11 13:50:21 -0700232 * An indicator of whether this contact has at least one phone number. "1" if there is
233 * at least one phone number, "0" otherwise.
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700234 * <P>Type: INTEGER</P>
235 */
Dmitri Plotnikov074fbfe2009-08-11 13:50:21 -0700236 public static final String HAS_PHONE_NUMBER = "has_phone_number";
Dmitri Plotnikovf35bce42009-08-28 19:52:50 -0700237
238 /**
239 * An opaque value that contains hints on how to find the contact if
240 * its row id changed as a result of a sync or aggregation.
241 */
242 public static final String LOOKUP_KEY = "lookup";
Evan Millar088b2912009-05-28 15:24:37 -0700243 }
244
245 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700246 * Constants for the contacts table, which contains a record per group
247 * of raw contact representing the same person.
Evan Millar088b2912009-05-28 15:24:37 -0700248 */
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700249 public static class Contacts implements BaseColumns, ContactsColumns,
Dmitri Plotnikovc9ec66b2009-08-05 12:11:22 -0700250 ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700251 /**
252 * This utility class cannot be instantiated
253 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700254 private Contacts() {}
Evan Millar088b2912009-05-28 15:24:37 -0700255
256 /**
257 * The content:// style URI for this table
258 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700259 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "contacts");
Evan Millar088b2912009-05-28 15:24:37 -0700260
261 /**
Dmitri Plotnikovf35bce42009-08-28 19:52:50 -0700262 * A content:// style URI for this table that should be used to create
263 * shortcuts or otherwise create long-term links to contacts. This URI
264 * should always be followed by a "/" and the contact's {@link #LOOKUP_KEY}.
265 * It can optionally also have a "/" and last known contact ID appended after
266 * that. This "complete" format is an important optimization and is highly recommended.
267 * <p>
268 * As long as the contact's row ID remains the same, this URI is
269 * equivalent to {@link #CONTENT_URI}. If the contact's row ID changes
270 * as a result of a sync or aggregation, this URI will look up the
271 * contact using indirect information (sync IDs or constituent raw
272 * contacts).
273 * <p>
274 * Lookup key should be appended unencoded - it is stored in the encoded
275 * form, ready for use in a URI.
276 */
277 public static final Uri CONTENT_LOOKUP_URI = Uri.withAppendedPath(CONTENT_URI,
278 "lookup");
279
280 /**
281 * Computes a complete lookup URI (see {@link #CONTENT_LOOKUP_URI}).
282 * Pass either a basic content URI with a contact ID to obtain an
283 * equivalent lookup URI. Pass a possibly stale lookup URI to get a fresh
284 * lookup URI for the same contact.
285 * <p>
286 * Returns null if the contact cannot be found.
287 */
288 public static Uri getLookupUri(ContentResolver resolver, Uri contentUri) {
289 Cursor c = resolver.query(contentUri,
290 new String[]{Contacts.LOOKUP_KEY, Contacts._ID}, null, null, null);
291 if (c == null) {
292 return null;
293 }
294
295 try {
296 if (c.moveToFirst()) {
297 String lookupKey = c.getString(0);
298 long contactId = c.getLong(1);
299 return ContentUris.withAppendedId(
300 Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey),
301 contactId);
302 }
303 } finally {
304 c.close();
305 }
306 return null;
307 }
308
309 /**
Jeff Sharkeyf46a9cf2009-09-09 13:17:44 -0700310 * Build a {@link #CONTENT_LOOKUP_URI} lookup {@link Uri} using the
311 * given {@link Contacts#_ID} and {@link Contacts#LOOKUP_KEY}.
312 */
313 public static Uri getLookupUri(long contactId, String lookupKey) {
314 return ContentUris.withAppendedId(Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI,
315 lookupKey), contactId);
316 }
317
318 /**
Dmitri Plotnikovb5759b52009-09-01 15:58:40 -0700319 * Computes a content URI (see {@link #CONTENT_URI}) given a lookup URI.
320 * <p>
321 * Returns null if the contact cannot be found.
322 */
323 public static Uri lookupContact(ContentResolver resolver, Uri lookupUri) {
324 if (lookupUri == null) {
325 return null;
326 }
327
328 Cursor c = resolver.query(lookupUri, new String[]{Contacts._ID}, null, null, null);
329 if (c == null) {
330 return null;
331 }
332
333 try {
334 if (c.moveToFirst()) {
335 long contactId = c.getLong(0);
336 return ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
337 }
338 } finally {
339 c.close();
340 }
341 return null;
342 }
343
344 /**
Evan Millar161dd862009-06-12 16:02:43 -0700345 * The content:// style URI used for "type-to-filter" functionality on the
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700346 * {@link #CONTENT_URI} URI. The filter string will be used to match
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700347 * various parts of the contact name. The filter argument should be passed
Evan Millar161dd862009-06-12 16:02:43 -0700348 * as an additional path segment after this URI.
349 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700350 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(
351 CONTENT_URI, "filter");
352
Evan Millardc2da5f2009-06-18 16:07:13 -0700353 /**
354 * The content:// style URI for this table joined with useful data from
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700355 * {@link Data}, filtered to include only starred contacts
356 * and the most frequently contacted contacts.
Evan Millardc2da5f2009-06-18 16:07:13 -0700357 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700358 public static final Uri CONTENT_STREQUENT_URI = Uri.withAppendedPath(
359 CONTENT_URI, "strequent");
360
Evan Millardc2da5f2009-06-18 16:07:13 -0700361 /**
362 * The content:// style URI used for "type-to-filter" functionality on the
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700363 * {@link #CONTENT_STREQUENT_URI} URI. The filter string will be used to match
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700364 * various parts of the contact name. The filter argument should be passed
Evan Millardc2da5f2009-06-18 16:07:13 -0700365 * as an additional path segment after this URI.
366 */
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700367 public static final Uri CONTENT_STREQUENT_FILTER_URI = Uri.withAppendedPath(
368 CONTENT_STREQUENT_URI, "filter");
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700369
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -0700370 public static final Uri CONTENT_GROUP_URI = Uri.withAppendedPath(
371 CONTENT_URI, "group");
372
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700373 /**
Evan Millar088b2912009-05-28 15:24:37 -0700374 * The MIME type of {@link #CONTENT_URI} providing a directory of
375 * people.
376 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700377 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact";
Evan Millar088b2912009-05-28 15:24:37 -0700378
379 /**
380 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
381 * person.
382 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700383 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
Evan Millar088b2912009-05-28 15:24:37 -0700384
385 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700386 * A sub-directory of a single contact that contains all of the constituent raw contact
Evan Millar088b2912009-05-28 15:24:37 -0700387 * {@link Data} rows.
388 */
Fred Quintana8851e162009-08-05 21:06:45 -0700389 public static final class Data implements BaseColumns, DataColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700390 /**
391 * no public constructor since this is a utility class
392 */
393 private Data() {}
394
395 /**
396 * The directory twig for this sub-table
397 */
398 public static final String CONTENT_DIRECTORY = "data";
399 }
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700400
401 /**
402 * A sub-directory of a single contact aggregate that contains all aggregation suggestions
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700403 * (other contacts). The aggregation suggestions are computed based on approximate
404 * data matches with this contact.
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700405 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700406 public static final class AggregationSuggestions implements BaseColumns, ContactsColumns {
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700407 /**
408 * No public constructor since this is a utility class
409 */
410 private AggregationSuggestions() {}
411
412 /**
413 * The directory twig for this sub-table
414 */
415 public static final String CONTENT_DIRECTORY = "suggestions";
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -0700416 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700417
418 /**
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700419 * A sub-directory of a single contact that contains the contact's primary photo.
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700420 */
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700421 public static final class Photo implements BaseColumns, DataColumns {
422 /**
423 * no public constructor since this is a utility class
424 */
425 private Photo() {}
Dmitri Plotnikov1c1629d2009-08-20 08:13:46 -0700426
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700427 /**
428 * The directory twig for this sub-table
429 */
430 public static final String CONTENT_DIRECTORY = "photo";
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700431 }
432
433 /**
434 * Opens an InputStream for the person's default photo and returns the
435 * photo as a Bitmap stream.
436 *
437 * @param contactUri the contact whose photo should be used
438 */
439 public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri) {
Dmitri Plotnikoveb1a2ec2009-08-21 11:11:19 -0700440 Uri photoUri = Uri.withAppendedPath(contactUri, Photo.CONTENT_DIRECTORY);
Dmitri Plotnikov1c1629d2009-08-20 08:13:46 -0700441 if (photoUri == null) {
442 return null;
443 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700444 Cursor cursor = cr.query(photoUri,
445 new String[]{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);
446 try {
Mike Lockwood7d6eb9a2009-08-24 18:12:51 -0700447 if (cursor == null || !cursor.moveToNext()) {
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700448 return null;
449 }
450 byte[] data = cursor.getBlob(0);
451 if (data == null) {
452 return null;
453 }
454 return new ByteArrayInputStream(data);
455 } finally {
Mike Lockwood7d6eb9a2009-08-24 18:12:51 -0700456 if (cursor != null) {
457 cursor.close();
458 }
Dmitri Plotnikov3c513ed2009-08-19 15:56:30 -0700459 }
460 }
Evan Millar088b2912009-05-28 15:24:37 -0700461 }
462
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700463 private interface RawContactsColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700464 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700465 * A reference to the {@link android.provider.ContactsContract.Contacts#_ID} that this
466 * data belongs to.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700467 * <P>Type: INTEGER</P>
Evan Millar088b2912009-05-28 15:24:37 -0700468 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700469 public static final String CONTACT_ID = "contact_id";
Evan Millar088b2912009-05-28 15:24:37 -0700470
471 /**
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700472 * Flag indicating that this {@link RawContacts} entry and its children has
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700473 * been restricted to specific platform apps.
474 * <P>Type: INTEGER (boolean)</P>
475 *
476 * @hide until finalized in future platform release
477 */
478 public static final String IS_RESTRICTED = "is_restricted";
479
480 /**
481 * The aggregation mode for this contact.
482 * <P>Type: INTEGER</P>
483 */
484 public static final String AGGREGATION_MODE = "aggregation_mode";
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700485
486 /**
487 * The "deleted" flag: "0" by default, "1" if the row has been marked
488 * for deletion. When {@link android.content.ContentResolver#delete} is
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700489 * called on a raw contact, it is marked for deletion and removed from its
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700490 * aggregate contact. The sync adaptor deletes the raw contact on the server and
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700491 * then calls ContactResolver.delete once more, this time passing the
Fred Quintana33f889a2009-09-14 17:31:26 -0700492 * {@link ContactsContract#CALLER_IS_SYNCADAPTER} query parameter to finalize
493 * the data removal.
Dmitri Plotnikovd5f56d12009-07-27 09:26:05 -0700494 * <P>Type: INTEGER</P>
495 */
496 public static final String DELETED = "deleted";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700497 }
498
499 /**
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700500 * Constants for the raw_contacts table, which contains the base contact
501 * information per sync source. Sync adapters and contact management apps
502 * are the primary consumers of this API.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700503 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700504 public static final class RawContacts implements BaseColumns, RawContactsColumns,
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700505 ContactOptionsColumns, SyncColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700506 /**
507 * This utility class cannot be instantiated
508 */
Dmitri Plotnikov2365ded2009-07-27 09:36:09 -0700509 private RawContacts() {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700510 }
511
512 /**
Evan Millar088b2912009-05-28 15:24:37 -0700513 * The content:// style URI for this table
514 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700515 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "raw_contacts");
Evan Millar088b2912009-05-28 15:24:37 -0700516
517 /**
Evan Millar088b2912009-05-28 15:24:37 -0700518 * The MIME type of {@link #CONTENT_URI} providing a directory of
519 * people.
520 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700521 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact";
Evan Millar088b2912009-05-28 15:24:37 -0700522
523 /**
524 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
525 * person.
526 */
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700527 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";
Evan Millar088b2912009-05-28 15:24:37 -0700528
529 /**
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700530 * Aggregation mode: aggregate asynchronously.
531 */
532 public static final int AGGREGATION_MODE_DEFAULT = 0;
533
534 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700535 * Aggregation mode: aggregate at the time the raw contact is inserted/updated.
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700536 */
Omari Stephensbc9aa772009-09-08 19:10:53 -0700537 public static final int AGGREGATION_MODE_IMMEDIATE = 1;
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700538
539 /**
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700540 * If {@link #AGGREGATION_MODE} is {@link #AGGREGATION_MODE_SUSPENDED}, changes
541 * to the raw contact do not cause its aggregation to be revisited. Note that changing
542 * {@link #AGGREGATION_MODE} from {@link #AGGREGATION_MODE_SUSPENDED} to
543 * {@link #AGGREGATION_MODE_DEFAULT} does not trigger an aggregation pass. Any subsequent
544 * change to the raw contact's data will.
545 */
546 public static final int AGGREGATION_MODE_SUSPENDED = 2;
547
548 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700549 * Aggregation mode: never aggregate this raw contact (note that the raw contact will not
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700550 * have a corresponding Aggregate and therefore will not be included in Aggregates
551 * query results.)
552 */
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700553 public static final int AGGREGATION_MODE_DISABLED = 3;
Dmitri Plotnikovc991bfc2009-07-14 17:27:31 -0700554
555 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700556 * A sub-directory of a single raw contact that contains all of their {@link Data} rows.
Dmitri Plotnikov5223b162009-08-25 15:15:06 -0700557 * To access this directory append {@link Data#CONTENT_DIRECTORY} to the contact URI.
Evan Millar088b2912009-05-28 15:24:37 -0700558 */
559 public static final class Data implements BaseColumns, DataColumns {
560 /**
561 * no public constructor since this is a utility class
562 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700563 private Data() {
564 }
Evan Millar088b2912009-05-28 15:24:37 -0700565
566 /**
567 * The directory twig for this sub-table
568 */
569 public static final String CONTENT_DIRECTORY = "data";
570 }
571 }
572
573 private interface DataColumns {
574 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700575 * The package name to use when creating {@link Resources} objects for
576 * this data row. This value is only designed for use when building user
577 * interfaces, and should not be used to infer the owner.
578 */
579 public static final String RES_PACKAGE = "res_package";
580
581 /**
582 * The MIME type of the item represented by this row.
Evan Millar088b2912009-05-28 15:24:37 -0700583 */
584 public static final String MIMETYPE = "mimetype";
585
586 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700587 * A reference to the {@link RawContacts#_ID}
Dmitri Plotnikov56927772009-05-28 17:23:39 -0700588 * that this data belongs to.
Evan Millar088b2912009-05-28 15:24:37 -0700589 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700590 public static final String RAW_CONTACT_ID = "raw_contact_id";
591
Evan Millarab5742d2009-06-02 16:21:45 -0700592 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700593 * Whether this is the primary entry of its kind for the raw contact it belongs to
Evan Millarab5742d2009-06-02 16:21:45 -0700594 * <P>Type: INTEGER (if set, non-0 means true)</P>
595 */
596 public static final String IS_PRIMARY = "is_primary";
597
598 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700599 * Whether this is the primary entry of its kind for the aggregate
600 * contact it belongs to. Any data record that is "super primary" must
601 * also be "primary".
Evan Millarab5742d2009-06-02 16:21:45 -0700602 * <P>Type: INTEGER (if set, non-0 means true)</P>
603 */
604 public static final String IS_SUPER_PRIMARY = "is_super_primary";
605
Jeff Sharkey28b68e52009-06-10 15:26:58 -0700606 /**
Fred Quintanac933fb62009-06-11 12:14:40 -0700607 * The version of this data record. This is a read-only value. The data column is
608 * guaranteed to not change without the version going up. This value is monotonically
609 * increasing.
610 * <P>Type: INTEGER</P>
611 */
612 public static final String DATA_VERSION = "data_version";
613
Evan Millar088b2912009-05-28 15:24:37 -0700614 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
615 public static final String DATA1 = "data1";
616 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
617 public static final String DATA2 = "data2";
618 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
619 public static final String DATA3 = "data3";
620 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
621 public static final String DATA4 = "data4";
622 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
623 public static final String DATA5 = "data5";
624 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
625 public static final String DATA6 = "data6";
626 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
627 public static final String DATA7 = "data7";
628 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
629 public static final String DATA8 = "data8";
630 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
631 public static final String DATA9 = "data9";
632 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
633 public static final String DATA10 = "data10";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700634 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
635 public static final String DATA11 = "data11";
636 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
637 public static final String DATA12 = "data12";
638 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
639 public static final String DATA13 = "data13";
640 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
641 public static final String DATA14 = "data14";
642 /** Generic data column, the meaning is {@link #MIMETYPE} specific */
643 public static final String DATA15 = "data15";
Dmitri Plotnikov91e4e852009-08-03 18:06:29 -0700644
Fred Quintana8851e162009-08-05 21:06:45 -0700645 /** Generic column for use by sync adapters. */
646 public static final String SYNC1 = "data_sync1";
647 /** Generic column for use by sync adapters. */
648 public static final String SYNC2 = "data_sync2";
649 /** Generic column for use by sync adapters. */
650 public static final String SYNC3 = "data_sync3";
651 /** Generic column for use by sync adapters. */
652 public static final String SYNC4 = "data_sync4";
Evan Millar088b2912009-05-28 15:24:37 -0700653 }
654
655 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700656 * Constants for the data table, which contains data points tied to a raw contact.
Evan Millar088b2912009-05-28 15:24:37 -0700657 * For example, a phone number or email address. Each row in this table contains a type
658 * definition and some generic columns. Each data type can define the meaning for each of
659 * the generic columns.
660 */
Fred Quintana8851e162009-08-05 21:06:45 -0700661 public static final class Data implements BaseColumns, DataColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700662 /**
663 * This utility class cannot be instantiated
664 */
665 private Data() {}
666
667 /**
668 * The content:// style URI for this table
669 */
670 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "data");
671
672 /**
Jeff Sharkey0c36a512009-09-02 23:16:44 -0700673 * The content:// style URI for this table joined with {@link Presence}
674 * data where applicable.
675 *
676 * @hide
677 */
678 public static final Uri CONTENT_WITH_PRESENCE_URI = Uri.withAppendedPath(AUTHORITY_URI,
679 "data_with_presence");
680
681 /**
Evan Millar088b2912009-05-28 15:24:37 -0700682 * The MIME type of {@link #CONTENT_URI} providing a directory of data.
683 */
684 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/data";
685 }
686
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700687 private interface PhoneLookupColumns {
688 /**
689 * The phone number as the user entered it.
690 * <P>Type: TEXT</P>
691 */
692 public static final String NUMBER = "number";
693
694 /**
695 * The type of phone number, for example Home or Work.
696 * <P>Type: INTEGER</P>
697 */
698 public static final String TYPE = "type";
699
700 /**
701 * The user defined label for the phone number.
702 * <P>Type: TEXT</P>
703 */
704 public static final String LABEL = "label";
705 }
706
Evan Millar088b2912009-05-28 15:24:37 -0700707 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700708 * A table that represents the result of looking up a phone number, for
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700709 * example for caller ID. To perform a lookup you must append the number you
710 * want to find to {@link #CONTENT_FILTER_URI}.
Evan Millar088b2912009-05-28 15:24:37 -0700711 */
Dmitri Plotnikov93032952009-08-19 11:26:57 -0700712 public static final class PhoneLookup implements BaseColumns, PhoneLookupColumns,
713 ContactsColumns, ContactOptionsColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700714 /**
715 * This utility class cannot be instantiated
716 */
717 private PhoneLookup() {}
718
719 /**
720 * The content:// style URI for this table. Append the phone number you want to lookup
721 * to this URI and query it to perform a lookup. For example:
722 *
723 * {@code
724 * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, phoneNumber);
725 * }
726 */
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700727 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
728 "phone_lookup");
729 }
730
731 /**
732 * Additional data mixed in with {@link Im.CommonPresenceColumns} to link
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -0700733 * back to specific {@link ContactsContract.Contacts#_ID} entries.
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700734 */
735 private interface PresenceColumns {
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700736
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700737 /**
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700738 * The unique ID for a row.
739 * <P>Type: INTEGER (long)</P>
740 */
741 public static final String _ID = "presence_id";
742
743 /**
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700744 * Reference to the {@link Data#_ID} entry that owns this presence.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700745 * <P>Type: INTEGER</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700746 */
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -0700747 public static final String DATA_ID = "presence_data_id";
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700748
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700749 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -0700750 * <p>Type: NUMBER</p>
751 */
752 public static final String PROTOCOL = "protocol";
753
754 /**
755 * Name of the custom protocol. Should be supplied along with the {@link #PROTOCOL} value
756 * {@link ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM}. Should be null or
757 * omitted if {@link #PROTOCOL} value is not
758 * {@link ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM}.
759 *
760 * <p>Type: NUMBER</p>
761 */
762 public static final String CUSTOM_PROTOCOL = "custom_protocol";
763
764 /**
765 * The IM handle the presence item is for. The handle is scoped to
766 * {@link #PROTOCOL}.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700767 * <P>Type: TEXT</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700768 */
769 public static final String IM_HANDLE = "im_handle";
770
771 /**
772 * The IM account for the local user that the presence data came from.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700773 * <P>Type: TEXT</P>
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700774 */
775 public static final String IM_ACCOUNT = "im_account";
776 }
777
Dmitri Plotnikov55048a92009-07-24 10:25:34 -0700778 public static final class Presence implements PresenceColumns, Im.CommonPresenceColumns {
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700779 /**
780 * This utility class cannot be instantiated
781 */
782 private Presence() {
783 }
784
785 /**
786 * The content:// style URI for this table
787 */
788 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "presence");
789
790 /**
791 * Gets the resource ID for the proper presence icon.
792 *
793 * @param status the status to get the icon for
794 * @return the resource ID for the proper presence icon
795 */
796 public static final int getPresenceIconResourceId(int status) {
797 switch (status) {
798 case AVAILABLE:
799 return android.R.drawable.presence_online;
800 case IDLE:
801 case AWAY:
802 return android.R.drawable.presence_away;
803 case DO_NOT_DISTURB:
804 return android.R.drawable.presence_busy;
805 case INVISIBLE:
806 return android.R.drawable.presence_invisible;
807 case OFFLINE:
808 default:
809 return android.R.drawable.presence_offline;
810 }
811 }
812
813 /**
Evan Millarc0437522009-06-23 17:31:05 -0700814 * Returns the precedence of the status code the higher number being the higher precedence.
815 *
816 * @param status The status code.
817 * @return An integer representing the precedence, 0 being the lowest.
818 */
819 public static final int getPresencePrecedence(int status) {
820 // Keep this function here incase we want to enforce a different precedence than the
821 // natural order of the status constants.
822 return status;
823 }
824
825 /**
Jeff Sharkeyd530b3c2009-06-01 20:23:57 -0700826 * The MIME type of {@link #CONTENT_URI} providing a directory of
827 * presence details.
828 */
829 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/im-presence";
830
831 /**
832 * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
833 * presence detail.
834 */
835 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im-presence";
Evan Millar088b2912009-05-28 15:24:37 -0700836 }
837
838 /**
839 * Container for definitions of common data types stored in the {@link Data} table.
840 */
841 public static final class CommonDataKinds {
842 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700843 * The {@link Data#RES_PACKAGE} value for common data that should be
844 * shown using a default style.
Evan Millar088b2912009-05-28 15:24:37 -0700845 */
846 public static final String PACKAGE_COMMON = "common";
847
848 /**
849 * Columns common across the specific types.
850 */
851 private interface BaseCommonColumns {
852 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700853 * The package name to use when creating {@link Resources} objects for
854 * this data row. This value is only designed for use when building user
855 * interfaces, and should not be used to infer the owner.
Evan Millar088b2912009-05-28 15:24:37 -0700856 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700857 public static final String RES_PACKAGE = "res_package";
Evan Millar088b2912009-05-28 15:24:37 -0700858
859 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700860 * The MIME type of the item represented by this row.
Evan Millar088b2912009-05-28 15:24:37 -0700861 */
862 public static final String MIMETYPE = "mimetype";
863
864 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700865 * The {@link RawContacts#_ID} that this data belongs to.
Evan Millar088b2912009-05-28 15:24:37 -0700866 */
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -0700867 public static final String RAW_CONTACT_ID = "raw_contact_id";
Evan Millar088b2912009-05-28 15:24:37 -0700868 }
869
870 /**
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700871 * The base types that all "Typed" data kinds support.
872 */
873 public interface BaseTypes {
874
875 /**
876 * A custom type. The custom label should be supplied by user.
877 */
878 public static int TYPE_CUSTOM = 0;
879 }
880
881 /**
Evan Millar088b2912009-05-28 15:24:37 -0700882 * Columns common across the specific types.
883 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700884 private interface CommonColumns extends BaseTypes{
Evan Millar088b2912009-05-28 15:24:37 -0700885 /**
886 * The type of data, for example Home or Work.
887 * <P>Type: INTEGER</P>
888 */
889 public static final String TYPE = "data1";
890
891 /**
Evan Millar088b2912009-05-28 15:24:37 -0700892 * The data for the contact method.
893 * <P>Type: TEXT</P>
894 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700895 public static final String DATA = "data2";
896
897 /**
898 * The user defined label for the the contact method.
899 * <P>Type: TEXT</P>
900 */
901 public static final String LABEL = "data3";
Evan Millar088b2912009-05-28 15:24:37 -0700902 }
903
904 /**
905 * Parts of the name.
906 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700907 public static final class StructuredName implements BaseCommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700908 private StructuredName() {}
909
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700910 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -0700911 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name";
912
913 /**
Evan Millar088b2912009-05-28 15:24:37 -0700914 * The given name for the contact.
915 * <P>Type: TEXT</P>
916 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700917 public static final String GIVEN_NAME = "data1";
Evan Millar088b2912009-05-28 15:24:37 -0700918
919 /**
920 * The family name for the contact.
921 * <P>Type: TEXT</P>
922 */
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700923 public static final String FAMILY_NAME = "data2";
924
925 /**
926 * The contact's honorific prefix, e.g. "Sir"
927 * <P>Type: TEXT</P>
928 */
929 public static final String PREFIX = "data3";
930
931 /**
932 * The contact's middle name
933 * <P>Type: TEXT</P>
934 */
935 public static final String MIDDLE_NAME = "data4";
Evan Millar088b2912009-05-28 15:24:37 -0700936
937 /**
938 * The contact's honorific suffix, e.g. "Jr"
939 */
940 public static final String SUFFIX = "data5";
941
942 /**
943 * The phonetic version of the given name for the contact.
944 * <P>Type: TEXT</P>
945 */
946 public static final String PHONETIC_GIVEN_NAME = "data6";
947
948 /**
949 * The phonetic version of the additional name for the contact.
950 * <P>Type: TEXT</P>
951 */
952 public static final String PHONETIC_MIDDLE_NAME = "data7";
953
954 /**
955 * The phonetic version of the family name for the contact.
956 * <P>Type: TEXT</P>
957 */
958 public static final String PHONETIC_FAMILY_NAME = "data8";
959
960 /**
961 * The name that should be used to display the contact.
Jeff Sharkey62b83b72009-08-11 17:33:48 -0700962 * <i>Unstructured component of the name should be consistent with
963 * its structured representation.</i>
964 * <p>
965 * Type: TEXT
Evan Millar088b2912009-05-28 15:24:37 -0700966 */
967 public static final String DISPLAY_NAME = "data9";
968 }
969
970 /**
971 * A nickname.
972 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700973 public static final class Nickname implements CommonColumns, BaseCommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700974 private Nickname() {}
975
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700976 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -0700977 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname";
978
Evan Millar78e79ad2009-06-08 10:24:44 -0700979 public static final int TYPE_DEFAULT = 1;
980 public static final int TYPE_OTHER_NAME = 2;
981 public static final int TYPE_MAINDEN_NAME = 3;
982 public static final int TYPE_SHORT_NAME = 4;
983 public static final int TYPE_INITIALS = 5;
Evan Millar088b2912009-05-28 15:24:37 -0700984
985 /**
Dmitri Plotnikovc9260542009-05-28 17:55:12 -0700986 * The name itself
987 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700988 public static final String NAME = DATA;
Evan Millar088b2912009-05-28 15:24:37 -0700989 }
990
991 /**
992 * Common data definition for telephone numbers.
993 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -0700994 public static final class Phone implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -0700995 private Phone() {}
996
Jeff Sharkey8a0193e2009-07-20 23:28:23 -0700997 /** MIME type used when storing this in data table. */
Evan Millarb3c49982009-09-01 11:38:04 -0700998 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
Evan Millar088b2912009-05-28 15:24:37 -0700999
Evan Millar161dd862009-06-12 16:02:43 -07001000 /**
1001 * The MIME type of {@link #CONTENT_URI} providing a directory of
1002 * phones.
1003 */
Evan Millarb3c49982009-09-01 11:38:04 -07001004 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
Evan Millar161dd862009-06-12 16:02:43 -07001005
1006 /**
1007 * The content:// style URI for all data records of the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001008 * {@link Phone#CONTENT_ITEM_TYPE} MIME type, combined with the
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001009 * associated raw contact and aggregate contact data.
Evan Millar161dd862009-06-12 16:02:43 -07001010 */
1011 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1012 "phones");
1013
1014 /**
Dmitri Plotnikov989f2632009-09-06 12:22:24 -07001015 * The content:// style URL for phone lookup using a filter. The filter returns
1016 * records of MIME type {@link Phone#CONTENT_ITEM_TYPE}. The filter is applied
1017 * to display names as well as phone numbers. The filter argument should be passed
1018 * as an additional path segment after this URI.
Evan Millar161dd862009-06-12 16:02:43 -07001019 */
1020 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI,
1021 "filter");
1022
Evan Millar088b2912009-05-28 15:24:37 -07001023 public static final int TYPE_HOME = 1;
1024 public static final int TYPE_MOBILE = 2;
1025 public static final int TYPE_WORK = 3;
1026 public static final int TYPE_FAX_WORK = 4;
1027 public static final int TYPE_FAX_HOME = 5;
1028 public static final int TYPE_PAGER = 6;
1029 public static final int TYPE_OTHER = 7;
Fred Quintana3f867152009-08-03 11:43:16 -07001030 public static final int TYPE_CALLBACK = 8;
1031 public static final int TYPE_CAR = 9;
1032 public static final int TYPE_COMPANY_MAIN = 10;
1033 public static final int TYPE_ISDN = 11;
1034 public static final int TYPE_MAIN = 12;
1035 public static final int TYPE_OTHER_FAX = 13;
1036 public static final int TYPE_RADIO = 14;
1037 public static final int TYPE_TELEX = 15;
1038 public static final int TYPE_TTY_TDD = 16;
1039 public static final int TYPE_WORK_MOBILE = 17;
1040 public static final int TYPE_WORK_PAGER = 18;
1041 public static final int TYPE_ASSISTANT = 19;
Evan Millar088b2912009-05-28 15:24:37 -07001042
1043 /**
1044 * The phone number as the user entered it.
1045 * <P>Type: TEXT</P>
1046 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001047 public static final String NUMBER = DATA;
Dmitri Plotnikov93032952009-08-19 11:26:57 -07001048
1049 public static final CharSequence getDisplayLabel(Context context, int type,
1050 CharSequence label, CharSequence[] labelArray) {
1051 CharSequence display = "";
1052
1053 if (type != Phone.TYPE_CUSTOM) {
1054 CharSequence[] labels = labelArray != null? labelArray
1055 : context.getResources().getTextArray(
1056 com.android.internal.R.array.phoneTypes);
1057 try {
1058 display = labels[type - 1];
1059 } catch (ArrayIndexOutOfBoundsException e) {
1060 display = labels[Phone.TYPE_CUSTOM];
1061 }
1062 } else {
1063 if (!TextUtils.isEmpty(label)) {
1064 display = label;
1065 }
1066 }
1067 return display;
1068 }
1069
1070 public static final CharSequence getDisplayLabel(Context context, int type,
1071 CharSequence label) {
1072 return getDisplayLabel(context, type, label, null);
1073 }
Evan Millar088b2912009-05-28 15:24:37 -07001074 }
1075
1076 /**
1077 * Common data definition for email addresses.
1078 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001079 public static final class Email implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001080 private Email() {}
1081
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001082 /** MIME type used when storing this in data table. */
Evan Millarb3c49982009-09-01 11:38:04 -07001083 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email_v2";
Evan Millar088b2912009-05-28 15:24:37 -07001084
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001085 /**
1086 * The content:// style URI for all data records of the
1087 * {@link Email#CONTENT_ITEM_TYPE} MIME type, combined with the
1088 * associated raw contact and aggregate contact data.
1089 */
1090 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1091 "emails");
1092
1093 /**
Dmitri Plotnikov989f2632009-09-06 12:22:24 -07001094 * The content:// style URL for looking up data rows by email address. The
1095 * lookup argument, an email address, should be passed as an additional path segment
1096 * after this URI.
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001097 */
Dmitri Plotnikov989f2632009-09-06 12:22:24 -07001098 public static final Uri CONTENT_LOOKUP_URI = Uri.withAppendedPath(CONTENT_URI,
1099 "lookup");
1100
1101 @Deprecated
1102 public static final Uri CONTENT_FILTER_EMAIL_URI = CONTENT_LOOKUP_URI;
1103
1104 /**
1105 * The content:// style URL for email lookup using a filter. The filter returns
1106 * records of MIME type {@link Email#CONTENT_ITEM_TYPE}. The filter is applied
1107 * to display names as well as email addresses. The filter argument should be passed
1108 * as an additional path segment after this URI.
1109 */
1110 public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI,
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001111 "filter");
1112
Evan Millar088b2912009-05-28 15:24:37 -07001113 public static final int TYPE_HOME = 1;
1114 public static final int TYPE_WORK = 2;
1115 public static final int TYPE_OTHER = 3;
Jeff Sharkey14fb1532009-08-29 15:54:26 -07001116 public static final int TYPE_MOBILE = 4;
Fred Quintana8851e162009-08-05 21:06:45 -07001117
1118 /**
1119 * The display name for the email address
1120 * <P>Type: TEXT</P>
1121 */
1122 public static final String DISPLAY_NAME = "data4";
Evan Millar088b2912009-05-28 15:24:37 -07001123 }
1124
1125 /**
1126 * Common data definition for postal addresses.
1127 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001128 public static final class StructuredPostal implements BaseCommonColumns, CommonColumns {
1129 private StructuredPostal() {
1130 }
Evan Millar088b2912009-05-28 15:24:37 -07001131
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001132 /** MIME type used when storing this in data table. */
Evan Millarb3c49982009-09-01 11:38:04 -07001133 public static final String CONTENT_ITEM_TYPE =
1134 "vnd.android.cursor.item/postal-address_v2";
Evan Millar088b2912009-05-28 15:24:37 -07001135
Evan Millar161dd862009-06-12 16:02:43 -07001136 /**
1137 * The MIME type of {@link #CONTENT_URI} providing a directory of
1138 * postal addresses.
1139 */
Evan Millarb3c49982009-09-01 11:38:04 -07001140 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address_v2";
Evan Millar161dd862009-06-12 16:02:43 -07001141
1142 /**
1143 * The content:// style URI for all data records of the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001144 * {@link StructuredPostal#CONTENT_ITEM_TYPE} MIME type.
Evan Millar161dd862009-06-12 16:02:43 -07001145 */
1146 public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI,
1147 "postals");
1148
Evan Millar088b2912009-05-28 15:24:37 -07001149 public static final int TYPE_HOME = 1;
1150 public static final int TYPE_WORK = 2;
1151 public static final int TYPE_OTHER = 3;
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001152
1153 /**
Jeff Sharkey62b83b72009-08-11 17:33:48 -07001154 * The full, unstructured postal address. <i>This field must be
1155 * consistent with any structured data.</i>
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001156 * <p>
1157 * Type: TEXT
1158 */
1159 public static final String FORMATTED_ADDRESS = DATA;
1160
1161 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001162 * Can be street, avenue, road, etc. This element also includes the
1163 * house number and room/apartment/flat/floor number.
1164 * <p>
1165 * Type: TEXT
1166 */
1167 public static final String STREET = "data6";
1168
1169 /**
1170 * Covers actual P.O. boxes, drawers, locked bags, etc. This is
1171 * usually but not always mutually exclusive with street.
1172 * <p>
1173 * Type: TEXT
1174 */
1175 public static final String POBOX = "data7";
1176
1177 /**
1178 * This is used to disambiguate a street address when a city
1179 * contains more than one street with the same name, or to specify a
1180 * small place whose mail is routed through a larger postal town. In
1181 * China it could be a county or a minor city.
1182 * <p>
1183 * Type: TEXT
1184 */
Jeff Sharkeyef348c72009-07-26 14:14:34 -07001185 public static final String NEIGHBORHOOD = "data8";
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001186
1187 /**
1188 * Can be city, village, town, borough, etc. This is the postal town
1189 * and not necessarily the place of residence or place of business.
1190 * <p>
1191 * Type: TEXT
1192 */
1193 public static final String CITY = "data9";
1194
1195 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001196 * A state, province, county (in Ireland), Land (in Germany),
1197 * departement (in France), etc.
1198 * <p>
1199 * Type: TEXT
1200 */
1201 public static final String REGION = "data11";
1202
1203 /**
Jeff Sharkeyef348c72009-07-26 14:14:34 -07001204 * Postal code. Usually country-wide, but sometimes specific to the
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001205 * city (e.g. "2" in "Dublin 2, Ireland" addresses).
1206 * <p>
1207 * Type: TEXT
1208 */
1209 public static final String POSTCODE = "data12";
1210
1211 /**
1212 * The name or code of the country.
1213 * <p>
1214 * Type: TEXT
1215 */
1216 public static final String COUNTRY = "data13";
Evan Millar088b2912009-05-28 15:24:37 -07001217 }
1218
Fred Quintana8851e162009-08-05 21:06:45 -07001219 /**
1220 * Common data definition for IM addresses.
1221 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001222 public static final class Im implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001223 private Im() {}
1224
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001225 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001226 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im";
1227
Evan Millar088b2912009-05-28 15:24:37 -07001228 public static final int TYPE_HOME = 1;
1229 public static final int TYPE_WORK = 2;
1230 public static final int TYPE_OTHER = 3;
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001231
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001232 /**
1233 * This column should be populated with one of the defined
1234 * constants, e.g. {@link #PROTOCOL_YAHOO}. If the value of this
1235 * column is {@link #PROTOCOL_CUSTOM}, the {@link #CUSTOM_PROTOCOL}
1236 * should contain the name of the custom protocol.
1237 */
Evan Millar088b2912009-05-28 15:24:37 -07001238 public static final String PROTOCOL = "data5";
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001239
Jeff Sharkey732da922009-07-30 09:59:31 -07001240 public static final String CUSTOM_PROTOCOL = "data6";
1241
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001242 /*
1243 * The predefined IM protocol types.
Evan Millar088b2912009-05-28 15:24:37 -07001244 */
Jeff Sharkey732da922009-07-30 09:59:31 -07001245 public static final int PROTOCOL_CUSTOM = -1;
Evan Millar088b2912009-05-28 15:24:37 -07001246 public static final int PROTOCOL_AIM = 0;
1247 public static final int PROTOCOL_MSN = 1;
1248 public static final int PROTOCOL_YAHOO = 2;
1249 public static final int PROTOCOL_SKYPE = 3;
1250 public static final int PROTOCOL_QQ = 4;
1251 public static final int PROTOCOL_GOOGLE_TALK = 5;
1252 public static final int PROTOCOL_ICQ = 6;
1253 public static final int PROTOCOL_JABBER = 7;
Fred Quintana8851e162009-08-05 21:06:45 -07001254 public static final int PROTOCOL_NETMEETING = 8;
Evan Millar088b2912009-05-28 15:24:37 -07001255 }
1256
1257 /**
1258 * Common data definition for organizations.
1259 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001260 public static final class Organization implements BaseCommonColumns, CommonColumns {
Evan Millar088b2912009-05-28 15:24:37 -07001261 private Organization() {}
1262
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001263 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001264 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization";
1265
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001266 public static final int TYPE_WORK = 1;
1267 public static final int TYPE_OTHER = 2;
Evan Millar088b2912009-05-28 15:24:37 -07001268
1269 /**
1270 * The company as the user entered it.
1271 * <P>Type: TEXT</P>
1272 */
Dmitri Plotnikov761ef2a2009-07-17 10:51:06 -07001273 public static final String COMPANY = DATA;
Evan Millar088b2912009-05-28 15:24:37 -07001274
1275 /**
1276 * The position title at this company as the user entered it.
1277 * <P>Type: TEXT</P>
1278 */
1279 public static final String TITLE = "data4";
Fred Quintana8851e162009-08-05 21:06:45 -07001280
1281 /**
1282 * The department at this company as the user entered it.
1283 * <P>Type: TEXT</P>
1284 */
1285 public static final String DEPARTMENT = "data5";
1286
1287 /**
1288 * The job description at this company as the user entered it.
1289 * <P>Type: TEXT</P>
1290 */
1291 public static final String JOB_DESCRIPTION = "data6";
1292
1293 /**
1294 * The symbol of this company as the user entered it.
1295 * <P>Type: TEXT</P>
1296 */
1297 public static final String SYMBOL = "data7";
1298
1299 /**
1300 * The phonetic name of this company as the user entered it.
1301 * <P>Type: TEXT</P>
1302 */
1303 public static final String PHONETIC_NAME = "data8";
1304 }
1305
1306 /**
1307 * Common data definition for miscellaneous information.
1308 */
1309 public static final class Miscellaneous implements BaseCommonColumns {
1310 private Miscellaneous() {}
1311
1312 /** MIME type used when storing this in data table. */
1313 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/misc";
1314
1315 /**
1316 * The birthday as the user entered it.
1317 * <P>Type: TEXT</P>
1318 */
1319 public static final String BIRTHDAY = "data1";
1320
1321 /**
1322 * The nickname as the user entered it.
1323 * <P>Type: TEXT</P>
1324 */
1325 public static final String NICKNAME = "data2";
1326 }
1327
1328 /**
1329 * Common data definition for relations.
1330 */
1331 public static final class Relation implements BaseCommonColumns, CommonColumns {
1332 private Relation() {}
1333
1334 /** MIME type used when storing this in data table. */
1335 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/relation";
1336
1337 public static final int TYPE_ASSISTANT = 1;
1338 public static final int TYPE_BROTHER = 2;
1339 public static final int TYPE_CHILD = 3;
1340 public static final int TYPE_DOMESTIC_PARTNER = 4;
1341 public static final int TYPE_FATHER = 5;
1342 public static final int TYPE_FRIEND = 6;
1343 public static final int TYPE_MANAGER = 7;
1344 public static final int TYPE_MOTHER = 8;
1345 public static final int TYPE_PARENT = 9;
1346 public static final int TYPE_PARTNER = 10;
1347 public static final int TYPE_REFERRED_BY = 11;
1348 public static final int TYPE_RELATIVE = 12;
1349 public static final int TYPE_SISTER = 13;
1350 public static final int TYPE_SPOUSE = 14;
1351
1352 /**
1353 * The name of the relative as the user entered it.
1354 * <P>Type: TEXT</P>
1355 */
1356 public static final String NAME = DATA;
1357 }
1358
1359 /**
1360 * Common data definition for events.
1361 */
1362 public static final class Event implements BaseCommonColumns, CommonColumns {
1363 private Event() {}
1364
1365 /** MIME type used when storing this in data table. */
1366 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/event";
1367
1368 public static final int TYPE_ANNIVERSARY = 1;
1369 public static final int TYPE_OTHER = 2;
Dmitri Plotnikovd4e0b572009-08-06 20:19:29 -07001370
Fred Quintana8851e162009-08-05 21:06:45 -07001371 /**
1372 * The event start date as the user entered it.
1373 * <P>Type: TEXT</P>
1374 */
1375 public static final String START_DATE = DATA;
Evan Millar088b2912009-05-28 15:24:37 -07001376 }
1377
1378 /**
1379 * Photo of the contact.
1380 */
1381 public static final class Photo implements BaseCommonColumns {
1382 private Photo() {}
1383
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001384 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001385 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo";
1386
1387 /**
Dmitri Plotnikovfacbbb32009-07-27 15:18:19 -07001388 * Thumbnail photo of the raw contact. This is the raw bytes of an image
Evan Millar088b2912009-05-28 15:24:37 -07001389 * that could be inflated using {@link BitmapFactory}.
1390 * <p>
1391 * Type: BLOB
1392 */
1393 public static final String PHOTO = "data1";
1394 }
1395
1396 /**
1397 * Notes about the contact.
1398 */
1399 public static final class Note implements BaseCommonColumns {
1400 private Note() {}
1401
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001402 /** MIME type used when storing this in data table. */
Evan Millar088b2912009-05-28 15:24:37 -07001403 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
1404
1405 /**
1406 * The note text.
1407 * <P>Type: TEXT</P>
1408 */
1409 public static final String NOTE = "data1";
1410 }
Dmitri Plotnikov56927772009-05-28 17:23:39 -07001411
Dmitri Plotnikovc9260542009-05-28 17:55:12 -07001412 /**
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001413 * Group Membership.
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001414 */
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001415 public static final class GroupMembership implements BaseCommonColumns {
1416 private GroupMembership() {}
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001417
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001418 /** MIME type used when storing this in data table. */
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001419 public static final String CONTENT_ITEM_TYPE =
1420 "vnd.android.cursor.item/group_membership";
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001421
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001422 /**
Fred Quintanaffc34c12009-07-14 16:02:58 -07001423 * The row id of the group that this group membership refers to. Exactly one of
1424 * this or {@link #GROUP_SOURCE_ID} must be set when inserting a row.
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001425 * <P>Type: INTEGER</P>
1426 */
1427 public static final String GROUP_ROW_ID = "data1";
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001428
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001429 /**
Fred Quintanaffc34c12009-07-14 16:02:58 -07001430 * The sourceid of the group that this group membership refers to. Exactly one of
1431 * this or {@link #GROUP_ROW_ID} must be set when inserting a row.
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001432 * <P>Type: TEXT</P>
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001433 */
Fred Quintanaffc34c12009-07-14 16:02:58 -07001434 public static final String GROUP_SOURCE_ID = "group_sourceid";
Fred Quintanad8dfeb52009-06-04 10:28:49 -07001435 }
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001436
1437 /**
1438 * Website related to the contact.
1439 */
Fred Quintana8851e162009-08-05 21:06:45 -07001440 public static final class Website implements BaseCommonColumns, CommonColumns {
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001441 private Website() {}
1442
1443 /** MIME type used when storing this in data table. */
1444 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website";
1445
Fred Quintana8851e162009-08-05 21:06:45 -07001446 public static final int TYPE_HOMEPAGE = 1;
1447 public static final int TYPE_BLOG = 2;
1448 public static final int TYPE_PROFILE = 3;
1449 public static final int TYPE_HOME = 4;
1450 public static final int TYPE_WORK = 5;
1451 public static final int TYPE_FTP = 6;
1452 public static final int TYPE_OTHER = 7;
1453
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001454 /**
1455 * The website URL string.
1456 * <P>Type: TEXT</P>
1457 */
1458 public static final String URL = "data1";
1459 }
Dmitri Plotnikovceaafa52009-06-03 10:46:44 -07001460 }
Fred Quintana435e4272009-06-04 17:30:28 -07001461
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001462 // TODO: make this private before unhiding
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001463 public interface GroupsColumns {
1464 /**
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001465 * The display title of this group.
1466 * <p>
1467 * Type: TEXT
1468 */
1469 public static final String TITLE = "title";
1470
1471 /**
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001472 * The package name to use when creating {@link Resources} objects for
1473 * this group. This value is only designed for use when building user
1474 * interfaces, and should not be used to infer the owner.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001475 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001476 public static final String RES_PACKAGE = "res_package";
1477
1478 /**
1479 * The display title of this group to load as a resource from
1480 * {@link #RES_PACKAGE}, which may be localized.
1481 * <P>Type: TEXT</P>
1482 */
1483 public static final String TITLE_RES = "title_res";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001484
1485 /**
Dmitri Plotnikov02c5b452009-07-22 15:13:08 -07001486 * Notes about the group.
1487 * <p>
1488 * Type: TEXT
1489 */
1490 public static final String NOTES = "notes";
1491
1492 /**
1493 * The ID of this group if it is a System Group, i.e. a group that has a special meaning
1494 * to the sync adapter, null otherwise.
1495 * <P>Type: TEXT</P>
1496 */
1497 public static final String SYSTEM_ID = "system_id";
1498
1499 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001500 * The total number of {@link Contacts} that have
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001501 * {@link CommonDataKinds.GroupMembership} in this group. Read-only value that is only
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001502 * present when querying {@link Groups#CONTENT_SUMMARY_URI}.
1503 * <p>
1504 * Type: INTEGER
1505 */
1506 public static final String SUMMARY_COUNT = "summ_count";
1507
1508 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001509 * The total number of {@link Contacts} that have both
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001510 * {@link CommonDataKinds.GroupMembership} in this group, and also have phone numbers.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001511 * Read-only value that is only present when querying
1512 * {@link Groups#CONTENT_SUMMARY_URI}.
1513 * <p>
1514 * Type: INTEGER
1515 */
1516 public static final String SUMMARY_WITH_PHONES = "summ_phones";
1517
1518 /**
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001519 * Flag indicating if the contacts belonging to this group should be
1520 * visible in any user interface.
1521 * <p>
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001522 * Type: INTEGER (boolean)
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001523 */
1524 public static final String GROUP_VISIBLE = "group_visible";
Fred Quintana00c89f62009-08-10 14:43:24 -07001525
1526 /**
1527 * The "deleted" flag: "0" by default, "1" if the row has been marked
1528 * for deletion. When {@link android.content.ContentResolver#delete} is
1529 * called on a raw contact, it is marked for deletion and removed from its
1530 * aggregate contact. The sync adaptor deletes the raw contact on the server and
Fred Quintana33f889a2009-09-14 17:31:26 -07001531 * then calls ContactResolver.delete once more, this time setting the the
1532 * {@link ContactsContract#CALLER_IS_SYNCADAPTER} query parameter to finalize
1533 * the data removal.
Fred Quintana00c89f62009-08-10 14:43:24 -07001534 * <P>Type: INTEGER</P>
1535 */
1536 public static final String DELETED = "deleted";
Jeff Sharkey403d7ac2009-08-16 16:34:35 -07001537
1538 /**
1539 * Whether this group should be synced if the SYNC_EVERYTHING settings
1540 * is false for this group's account.
1541 * <p>
1542 * Type: INTEGER (boolean)
1543 */
1544 public static final String SHOULD_SYNC = "should_sync";
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001545 }
1546
1547 /**
1548 * Constants for the groups table.
1549 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001550 public static final class Groups implements BaseColumns, GroupsColumns, SyncColumns {
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001551 /**
1552 * This utility class cannot be instantiated
1553 */
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07001554 private Groups() {
1555 }
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001556
1557 /**
1558 * The content:// style URI for this table
1559 */
1560 public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "groups");
1561
1562 /**
1563 * The content:// style URI for this table joined with details data from
Dmitri Plotnikov02c5b452009-07-22 15:13:08 -07001564 * {@link Data}.
Jeff Sharkeyb2909eb2009-06-16 16:55:31 -07001565 */
1566 public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI,
1567 "groups_summary");
1568
1569 /**
1570 * The MIME type of a directory of groups.
1571 */
1572 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group";
1573
1574 /**
1575 * The MIME type of a single group.
1576 */
1577 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
1578 }
1579
Fred Quintana435e4272009-06-04 17:30:28 -07001580 /**
1581 * Constants for the contact aggregation exceptions table, which contains
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001582 * aggregation rules overriding those used by automatic aggregation. This type only
1583 * supports query and update. Neither insert nor delete are supported.
Fred Quintana435e4272009-06-04 17:30:28 -07001584 */
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -07001585 public static final class AggregationExceptions implements BaseColumns {
Fred Quintana435e4272009-06-04 17:30:28 -07001586 /**
1587 * This utility class cannot be instantiated
1588 */
1589 private AggregationExceptions() {}
1590
1591 /**
1592 * The content:// style URI for this table
1593 */
1594 public static final Uri CONTENT_URI =
1595 Uri.withAppendedPath(AUTHORITY_URI, "aggregation_exceptions");
1596
1597 /**
1598 * The MIME type of {@link #CONTENT_URI} providing a directory of data.
1599 */
1600 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
1601
1602 /**
Dmitri Plotnikov0918bf02009-06-10 16:13:08 -07001603 * The MIME type of a {@link #CONTENT_URI} subdirectory of an aggregation exception
1604 */
1605 public static final String CONTENT_ITEM_TYPE =
1606 "vnd.android.cursor.item/aggregation_exception";
1607
1608 /**
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001609 * The type of exception: {@link #TYPE_KEEP_TOGETHER}, {@link #TYPE_KEEP_SEPARATE} or
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001610 * {@link #TYPE_AUTOMATIC}.
Fred Quintana435e4272009-06-04 17:30:28 -07001611 *
1612 * <P>Type: INTEGER</P>
1613 */
1614 public static final String TYPE = "type";
1615
Fred Quintana435e4272009-06-04 17:30:28 -07001616 /**
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001617 * Allows the provider to automatically decide whether the specified raw contacts should
1618 * be included in the same aggregate contact or not.
Fred Quintana435e4272009-06-04 17:30:28 -07001619 */
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001620 public static final int TYPE_AUTOMATIC = 0;
Fred Quintana435e4272009-06-04 17:30:28 -07001621
1622 /**
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001623 * Makes sure that the specified raw contacts are included in the same
1624 * aggregate contact.
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001625 */
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001626 public static final int TYPE_KEEP_TOGETHER = 1;
1627
1628 @Deprecated
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001629 public static final int TYPE_KEEP_IN = 1;
1630
1631 /**
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001632 * Makes sure that the specified raw contacts are NOT included in the same
1633 * aggregate contact.
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001634 */
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001635 public static final int TYPE_KEEP_SEPARATE = 2;
1636
1637 @Deprecated
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001638 public static final int TYPE_KEEP_OUT = 2;
1639
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001640 @Deprecated
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001641 public static final String CONTACT_ID = "contact_id";
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001642
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001643 @Deprecated
1644 public static final String RAW_CONTACT_ID = "raw_contact_id";
1645
Dmitri Plotnikov9d044512009-06-16 13:21:23 -07001646 /**
Dmitri Plotnikov7cca5f82009-07-27 20:25:59 -07001647 * A reference to the {@link RawContacts#_ID} of the raw contact that the rule applies to.
Fred Quintana435e4272009-06-04 17:30:28 -07001648 */
Dmitri Plotnikov84ba0652009-09-04 15:59:05 -07001649 public static final String RAW_CONTACT_ID1 = "raw_contact_id1";
1650
1651 /**
1652 * A reference to the other {@link RawContacts#_ID} of the raw contact that the rule
1653 * applies to.
1654 */
1655 public static final String RAW_CONTACT_ID2 = "raw_contact_id2";
Fred Quintana435e4272009-06-04 17:30:28 -07001656 }
Jeff Sharkey28b68e52009-06-10 15:26:58 -07001657
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001658 private interface SettingsColumns {
1659 /**
1660 * The name of the account instance to which this row belongs.
1661 * <P>Type: TEXT</P>
1662 */
1663 public static final String ACCOUNT_NAME = "account_name";
1664
1665 /**
1666 * The type of account to which this row belongs, which when paired with
1667 * {@link #ACCOUNT_NAME} identifies a specific account.
1668 * <P>Type: TEXT</P>
1669 */
1670 public static final String ACCOUNT_TYPE = "account_type";
1671
1672 /**
Jeff Sharkey06a03232009-08-21 17:37:56 -07001673 * Depending on the mode defined by the sync-adapter, this flag controls
1674 * the top-level sync behavior for this data source.
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001675 * <p>
1676 * Type: INTEGER (boolean)
1677 */
1678 public static final String SHOULD_SYNC = "should_sync";
1679
1680 /**
Dmitri Plotnikov31f5dd32009-08-21 13:44:47 -07001681 * Flag indicating if contacts without any {@link CommonDataKinds.GroupMembership}
Jeff Sharkeya6597442009-08-19 09:23:33 -07001682 * entries should be visible in any user interface.
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001683 * <p>
1684 * Type: INTEGER (boolean)
1685 */
1686 public static final String UNGROUPED_VISIBLE = "ungrouped_visible";
Jeff Sharkey06a03232009-08-21 17:37:56 -07001687
1688 /**
1689 * Read-only count of {@link Contacts} from a specific source that have
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -07001690 * no {@link CommonDataKinds.GroupMembership} entries.
Jeff Sharkey06a03232009-08-21 17:37:56 -07001691 * <p>
1692 * Type: INTEGER
1693 */
1694 public static final String UNGROUPED_COUNT = "summ_count";
1695
1696 /**
1697 * Read-only count of {@link Contacts} from a specific source that have
Dmitri Plotnikovb87d0e02009-08-27 10:38:14 -07001698 * no {@link CommonDataKinds.GroupMembership} entries, and also have phone numbers.
Jeff Sharkey06a03232009-08-21 17:37:56 -07001699 * <p>
1700 * Type: INTEGER
1701 */
1702 public static final String UNGROUPED_WITH_PHONES = "summ_phones";
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001703 }
1704
1705 /**
1706 * Contacts-specific settings for various {@link Account}.
1707 */
Jeff Sharkey06a03232009-08-21 17:37:56 -07001708 public static final class Settings implements SettingsColumns {
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001709 /**
1710 * This utility class cannot be instantiated
1711 */
1712 private Settings() {
1713 }
1714
1715 /**
1716 * The content:// style URI for this table
1717 */
1718 public static final Uri CONTENT_URI =
1719 Uri.withAppendedPath(AUTHORITY_URI, "settings");
1720
1721 /**
1722 * The MIME-type of {@link #CONTENT_URI} providing a directory of
1723 * settings.
1724 */
1725 public static final String CONTENT_TYPE = "vnd.android.cursor.dir/setting";
1726
1727 /**
1728 * The MIME-type of {@link #CONTENT_URI} providing a single setting.
1729 */
1730 public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/setting";
Jeff Sharkey7b6771a2009-08-17 01:59:54 -07001731 }
1732
Evan Millardc2da5f2009-06-18 16:07:13 -07001733 /**
1734 * Contains helper classes used to create or manage {@link android.content.Intent Intents}
1735 * that involve contacts.
1736 */
1737 public static final class Intents {
1738 /**
1739 * This is the intent that is fired when a search suggestion is clicked on.
1740 */
1741 public static final String SEARCH_SUGGESTION_CLICKED =
1742 "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
1743
1744 /**
1745 * This is the intent that is fired when a search suggestion for dialing a number
1746 * is clicked on.
1747 */
1748 public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED =
1749 "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
1750
1751 /**
1752 * This is the intent that is fired when a search suggestion for creating a contact
1753 * is clicked on.
1754 */
1755 public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED =
1756 "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
1757
1758 /**
1759 * Starts an Activity that lets the user pick a contact to attach an image to.
1760 * After picking the contact it launches the image cropper in face detection mode.
1761 */
1762 public static final String ATTACH_IMAGE =
1763 "com.android.contacts.action.ATTACH_IMAGE";
1764
1765 /**
1766 * Takes as input a data URI with a mailto: or tel: scheme. If a single
1767 * contact exists with the given data it will be shown. If no contact
1768 * exists, a dialog will ask the user if they want to create a new
1769 * contact with the provided details filled in. If multiple contacts
1770 * share the data the user will be prompted to pick which contact they
1771 * want to view.
1772 * <p>
1773 * For <code>mailto:</code> URIs, the scheme specific portion must be a
1774 * raw email address, such as one built using
1775 * {@link Uri#fromParts(String, String, String)}.
1776 * <p>
1777 * For <code>tel:</code> URIs, the scheme specific portion is compared
1778 * to existing numbers using the standard caller ID lookup algorithm.
1779 * The number must be properly encoded, for example using
1780 * {@link Uri#fromParts(String, String, String)}.
1781 * <p>
1782 * Any extras from the {@link Insert} class will be passed along to the
1783 * create activity if there are no contacts to show.
1784 * <p>
1785 * Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip
1786 * prompting the user when the contact doesn't exist.
1787 */
1788 public static final String SHOW_OR_CREATE_CONTACT =
1789 "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
1790
1791 /**
1792 * Used with {@link #SHOW_OR_CREATE_CONTACT} to force creating a new
1793 * contact if no matching contact found. Otherwise, default behavior is
1794 * to prompt user with dialog before creating.
1795 * <p>
1796 * Type: BOOLEAN
1797 */
1798 public static final String EXTRA_FORCE_CREATE =
1799 "com.android.contacts.action.FORCE_CREATE";
1800
1801 /**
1802 * Used with {@link #SHOW_OR_CREATE_CONTACT} to specify an exact
1803 * description to be shown when prompting user about creating a new
1804 * contact.
1805 * <p>
1806 * Type: STRING
1807 */
1808 public static final String EXTRA_CREATE_DESCRIPTION =
1809 "com.android.contacts.action.CREATE_DESCRIPTION";
1810
1811 /**
Jeff Sharkey11322002009-06-04 17:25:51 -07001812 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a
1813 * dialog location using screen coordinates. When not specified, the
1814 * dialog will be centered.
1815 */
1816 public static final String EXTRA_TARGET_RECT = "target_rect";
1817
1818 /**
Jeff Sharkey6bfe14d2009-08-05 15:49:48 -07001819 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to specify a
1820 * desired dialog style, usually a variation on size. One of
1821 * {@link #MODE_SMALL}, {@link #MODE_MEDIUM}, or {@link #MODE_LARGE}.
1822 */
1823 public static final String EXTRA_MODE = "mode";
1824
1825 /**
1826 * Value for {@link #EXTRA_MODE} to show a small-sized dialog.
1827 */
1828 public static final int MODE_SMALL = 1;
1829
1830 /**
1831 * Value for {@link #EXTRA_MODE} to show a medium-sized dialog.
1832 */
1833 public static final int MODE_MEDIUM = 2;
1834
1835 /**
1836 * Value for {@link #EXTRA_MODE} to show a large-sized dialog.
1837 */
1838 public static final int MODE_LARGE = 3;
1839
1840 /**
Jeff Sharkey84235ee2009-08-23 14:07:02 -07001841 * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to indicate
1842 * a list of specific MIME-types to exclude and not display. Stored as a
1843 * {@link String} array.
1844 */
1845 public static final String EXTRA_EXCLUDE_MIMES = "exclude_mimes";
1846
1847 /**
Evan Millardc2da5f2009-06-18 16:07:13 -07001848 * Intents related to the Contacts app UI.
1849 */
1850 public static final class UI {
1851 /**
1852 * The action for the default contacts list tab.
1853 */
1854 public static final String LIST_DEFAULT =
1855 "com.android.contacts.action.LIST_DEFAULT";
1856
1857 /**
1858 * The action for the contacts list tab.
1859 */
1860 public static final String LIST_GROUP_ACTION =
1861 "com.android.contacts.action.LIST_GROUP";
1862
1863 /**
1864 * When in LIST_GROUP_ACTION mode, this is the group to display.
1865 */
1866 public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP";
1867
1868 /**
1869 * The action for the all contacts list tab.
1870 */
1871 public static final String LIST_ALL_CONTACTS_ACTION =
1872 "com.android.contacts.action.LIST_ALL_CONTACTS";
1873
1874 /**
1875 * The action for the contacts with phone numbers list tab.
1876 */
1877 public static final String LIST_CONTACTS_WITH_PHONES_ACTION =
1878 "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES";
1879
1880 /**
1881 * The action for the starred contacts list tab.
1882 */
1883 public static final String LIST_STARRED_ACTION =
1884 "com.android.contacts.action.LIST_STARRED";
1885
1886 /**
1887 * The action for the frequent contacts list tab.
1888 */
1889 public static final String LIST_FREQUENT_ACTION =
1890 "com.android.contacts.action.LIST_FREQUENT";
1891
1892 /**
1893 * The action for the "strequent" contacts list tab. It first lists the starred
1894 * contacts in alphabetical order and then the frequent contacts in descending
1895 * order of the number of times they have been contacted.
1896 */
1897 public static final String LIST_STREQUENT_ACTION =
1898 "com.android.contacts.action.LIST_STREQUENT";
1899
1900 /**
1901 * A key for to be used as an intent extra to set the activity
1902 * title to a custom String value.
1903 */
1904 public static final String TITLE_EXTRA_KEY =
1905 "com.android.contacts.extra.TITLE_EXTRA";
1906
1907 /**
1908 * Activity Action: Display a filtered list of contacts
1909 * <p>
1910 * Input: Extra field {@link #FILTER_TEXT_EXTRA_KEY} is the text to use for
1911 * filtering
1912 * <p>
1913 * Output: Nothing.
1914 */
1915 public static final String FILTER_CONTACTS_ACTION =
1916 "com.android.contacts.action.FILTER_CONTACTS";
1917
1918 /**
1919 * Used as an int extra field in {@link #FILTER_CONTACTS_ACTION}
1920 * intents to supply the text on which to filter.
1921 */
1922 public static final String FILTER_TEXT_EXTRA_KEY =
1923 "com.android.contacts.extra.FILTER_TEXT";
1924 }
1925
1926 /**
1927 * Convenience class that contains string constants used
1928 * to create contact {@link android.content.Intent Intents}.
1929 */
1930 public static final class Insert {
1931 /** The action code to use when adding a contact */
1932 public static final String ACTION = Intent.ACTION_INSERT;
1933
1934 /**
1935 * If present, forces a bypass of quick insert mode.
1936 */
1937 public static final String FULL_MODE = "full_mode";
1938
1939 /**
1940 * The extra field for the contact name.
1941 * <P>Type: String</P>
1942 */
1943 public static final String NAME = "name";
1944
1945 // TODO add structured name values here.
1946
1947 /**
1948 * The extra field for the contact phonetic name.
1949 * <P>Type: String</P>
1950 */
1951 public static final String PHONETIC_NAME = "phonetic_name";
1952
1953 /**
1954 * The extra field for the contact company.
1955 * <P>Type: String</P>
1956 */
1957 public static final String COMPANY = "company";
1958
1959 /**
1960 * The extra field for the contact job title.
1961 * <P>Type: String</P>
1962 */
1963 public static final String JOB_TITLE = "job_title";
1964
1965 /**
1966 * The extra field for the contact notes.
1967 * <P>Type: String</P>
1968 */
1969 public static final String NOTES = "notes";
1970
1971 /**
1972 * The extra field for the contact phone number.
1973 * <P>Type: String</P>
1974 */
1975 public static final String PHONE = "phone";
1976
1977 /**
1978 * The extra field for the contact phone number type.
1979 * <P>Type: Either an integer value from
1980 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
1981 * or a string specifying a custom label.</P>
1982 */
1983 public static final String PHONE_TYPE = "phone_type";
1984
1985 /**
1986 * The extra field for the phone isprimary flag.
1987 * <P>Type: boolean</P>
1988 */
1989 public static final String PHONE_ISPRIMARY = "phone_isprimary";
1990
1991 /**
1992 * The extra field for an optional second contact phone number.
1993 * <P>Type: String</P>
1994 */
1995 public static final String SECONDARY_PHONE = "secondary_phone";
1996
1997 /**
1998 * The extra field for an optional second contact phone number type.
1999 * <P>Type: Either an integer value from
2000 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
2001 * or a string specifying a custom label.</P>
2002 */
2003 public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
2004
2005 /**
2006 * The extra field for an optional third contact phone number.
2007 * <P>Type: String</P>
2008 */
2009 public static final String TERTIARY_PHONE = "tertiary_phone";
2010
2011 /**
2012 * The extra field for an optional third contact phone number type.
2013 * <P>Type: Either an integer value from
2014 * {@link android.provider.Contacts.PhonesColumns PhonesColumns},
2015 * or a string specifying a custom label.</P>
2016 */
2017 public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
2018
2019 /**
2020 * The extra field for the contact email address.
2021 * <P>Type: String</P>
2022 */
2023 public static final String EMAIL = "email";
2024
2025 /**
2026 * The extra field for the contact email type.
2027 * <P>Type: Either an integer value from
2028 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2029 * or a string specifying a custom label.</P>
2030 */
2031 public static final String EMAIL_TYPE = "email_type";
2032
2033 /**
2034 * The extra field for the email isprimary flag.
2035 * <P>Type: boolean</P>
2036 */
2037 public static final String EMAIL_ISPRIMARY = "email_isprimary";
2038
2039 /**
2040 * The extra field for an optional second contact email address.
2041 * <P>Type: String</P>
2042 */
2043 public static final String SECONDARY_EMAIL = "secondary_email";
2044
2045 /**
2046 * The extra field for an optional second contact email type.
2047 * <P>Type: Either an integer value from
2048 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2049 * or a string specifying a custom label.</P>
2050 */
2051 public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type";
2052
2053 /**
2054 * The extra field for an optional third contact email address.
2055 * <P>Type: String</P>
2056 */
2057 public static final String TERTIARY_EMAIL = "tertiary_email";
2058
2059 /**
2060 * The extra field for an optional third contact email type.
2061 * <P>Type: Either an integer value from
2062 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2063 * or a string specifying a custom label.</P>
2064 */
2065 public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
2066
2067 /**
2068 * The extra field for the contact postal address.
2069 * <P>Type: String</P>
2070 */
2071 public static final String POSTAL = "postal";
2072
2073 /**
2074 * The extra field for the contact postal address type.
2075 * <P>Type: Either an integer value from
2076 * {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
2077 * or a string specifying a custom label.</P>
2078 */
2079 public static final String POSTAL_TYPE = "postal_type";
2080
2081 /**
2082 * The extra field for the postal isprimary flag.
2083 * <P>Type: boolean</P>
2084 */
2085 public static final String POSTAL_ISPRIMARY = "postal_isprimary";
2086
2087 /**
2088 * The extra field for an IM handle.
2089 * <P>Type: String</P>
2090 */
2091 public static final String IM_HANDLE = "im_handle";
2092
2093 /**
2094 * The extra field for the IM protocol
Jeff Sharkey8a0193e2009-07-20 23:28:23 -07002095 * <P>Type: the result of {@link CommonDataKinds.Im#encodePredefinedImProtocol(int)}
2096 * or {@link CommonDataKinds.Im#encodeCustomImProtocol(String)}.</P>
Evan Millardc2da5f2009-06-18 16:07:13 -07002097 */
2098 public static final String IM_PROTOCOL = "im_protocol";
2099
2100 /**
2101 * The extra field for the IM isprimary flag.
2102 * <P>Type: boolean</P>
2103 */
2104 public static final String IM_ISPRIMARY = "im_isprimary";
2105 }
2106 }
2107
Evan Millar088b2912009-05-28 15:24:37 -07002108}