summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/provider/Contacts.java271
1 files changed, 269 insertions, 2 deletions
diff --git a/core/java/android/provider/Contacts.java b/core/java/android/provider/Contacts.java
index c0dbf4d..1ec3416 100644
--- a/core/java/android/provider/Contacts.java
+++ b/core/java/android/provider/Contacts.java
@@ -22,42 +22,57 @@ import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
-import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
+import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import android.widget.ImageView;
-import android.accounts.Account;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
/**
* The Contacts provider stores all information about contacts.
+ *
+ * @deprecated This API has been replaced by {@link ContactsContract} as of
+ * {@link Build.VERSION#SDK} = 5.
*/
+@Deprecated
public class Contacts {
private static final String TAG = "Contacts";
+ /**
+ * @deprecated Replaced by {@link ContactsContract#AUTHORITY}.
+ */
+ @Deprecated
public static final String AUTHORITY = "contacts";
/**
* The content:// style URL for this provider
+ *
+ * @deprecated Replaced by {@link ContactsContract#AUTHORITY_URI}.
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTHORITY);
/** Signifies an email address row that is stored in the ContactMethods table */
+ @Deprecated
public static final int KIND_EMAIL = 1;
/** Signifies a postal address row that is stored in the ContactMethods table */
+ @Deprecated
public static final int KIND_POSTAL = 2;
/** Signifies an IM address row that is stored in the ContactMethods table */
+ @Deprecated
public static final int KIND_IM = 3;
/** Signifies an Organization row that is stored in the Organizations table */
+ @Deprecated
public static final int KIND_ORGANIZATION = 4;
/** Signifies an Phone row that is stored in the Phones table */
+ @Deprecated
public static final int KIND_PHONE = 5;
/**
@@ -68,35 +83,41 @@ public class Contacts {
/**
* Columns from the Settings table that other columns join into themselves.
*/
+ @Deprecated
public interface SettingsColumns {
/**
* The _SYNC_ACCOUNT to which this setting corresponds. This may be null.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String _SYNC_ACCOUNT = "_sync_account";
/**
* The _SYNC_ACCOUNT_TYPE to which this setting corresponds. This may be null.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String _SYNC_ACCOUNT_TYPE = "_sync_account_type";
/**
* The key of this setting.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String KEY = "key";
/**
* The value of this setting.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String VALUE = "value";
}
/**
* The settings over all of the people
*/
+ @Deprecated
public static final class Settings implements BaseColumns, SettingsColumns {
/**
* no public constructor since this is a utility class
@@ -106,17 +127,20 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/settings");
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "settings";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "key ASC";
/**
@@ -128,8 +152,10 @@ public class Contacts {
* This is a boolean setting. It is true if it is set and it is anything other than the
* emptry string or "0".
*/
+ @Deprecated
public static final String SYNC_EVERYTHING = "syncEverything";
+ @Deprecated
public static String getSetting(ContentResolver cr, String account, String key) {
// For now we only support a single account and the UI doesn't know what
// the account name is, so we're using a global setting for SYNC_EVERYTHING.
@@ -159,6 +185,7 @@ public class Contacts {
}
}
+ @Deprecated
public static void setSetting(ContentResolver cr, String account, String key,
String value) {
ContentValues values = new ContentValues();
@@ -177,11 +204,13 @@ public class Contacts {
/**
* Columns from the People table that other tables join into themselves.
*/
+ @Deprecated
public interface PeopleColumns {
/**
* The person's name.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NAME = "name";
/**
@@ -190,6 +219,7 @@ public class Contacts {
* Used for pronunciation and/or collation in some languages.
* <p>Type: TEXT</P>
*/
+ @Deprecated
public static final String PHONETIC_NAME = "phonetic_name";
/**
@@ -197,6 +227,7 @@ public class Contacts {
* else if email is not null email.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String DISPLAY_NAME = "display_name";
/**
@@ -205,30 +236,35 @@ public class Contacts {
* <P>Type: TEXT</p>
* @hide Used only in Contacts application for now.
*/
+ @Deprecated
public static final String SORT_STRING = "sort_string";
/**
* Notes about the person.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NOTES = "notes";
/**
* The number of times a person has been contacted
* <P>Type: INTEGER</P>
*/
+ @Deprecated
public static final String TIMES_CONTACTED = "times_contacted";
/**
* The last time a person was contacted.
* <P>Type: INTEGER</P>
*/
+ @Deprecated
public static final String LAST_TIME_CONTACTED = "last_time_contacted";
/**
* A custom ringtone associated with a person. Not always present.
* <P>Type: TEXT (URI to the ringtone)</P>
*/
+ @Deprecated
public static final String CUSTOM_RINGTONE = "custom_ringtone";
/**
@@ -236,24 +272,28 @@ public class Contacts {
* present.
* <P>Type: INTEGER (0 for false, 1 for true)</P>
*/
+ @Deprecated
public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
/**
* Is the contact starred?
* <P>Type: INTEGER (boolean)</P>
*/
+ @Deprecated
public static final String STARRED = "starred";
/**
* The server version of the photo
* <P>Type: TEXT (the version number portion of the photo URI)</P>
*/
+ @Deprecated
public static final String PHOTO_VERSION = "photo_version";
}
/**
* This table contains people.
*/
+ @Deprecated
public static final class People implements BaseColumns, SyncConstValue, PeopleColumns,
PhonesColumns, PresenceColumns {
/**
@@ -264,6 +304,7 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/people");
@@ -271,6 +312,7 @@ public class Contacts {
* The content:// style URL for filtering people by name. The filter
* argument should be passed as an additional path segment after this URI.
*/
+ @Deprecated
public static final Uri CONTENT_FILTER_URI =
Uri.parse("content://contacts/people/filter");
@@ -278,6 +320,7 @@ public class Contacts {
* The content:// style URL for the table that holds the deleted
* contacts.
*/
+ @Deprecated
public static final Uri DELETED_CONTENT_URI =
Uri.parse("content://contacts/deleted_people");
@@ -292,6 +335,7 @@ public class Contacts {
* schema and do not want to have to support this.
* @hide
*/
+ @Deprecated
public static final Uri WITH_EMAIL_OR_IM_FILTER_URI =
Uri.parse("content://contacts/people/with_email_or_im_filter");
@@ -299,23 +343,27 @@ public class Contacts {
* The MIME type of {@link #CONTENT_URI} providing a directory of
* people.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/person";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* person.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/person";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = People.NAME + " ASC";
/**
* The ID of the persons preferred phone number.
* <P>Type: INTEGER (foreign key to phones table on the _ID field)</P>
*/
+ @Deprecated
public static final String PRIMARY_PHONE_ID = "primary_phone";
/**
@@ -323,6 +371,7 @@ public class Contacts {
* <P>Type: INTEGER (foreign key to contact_methods table on the
* _ID field)</P>
*/
+ @Deprecated
public static final String PRIMARY_EMAIL_ID = "primary_email";
/**
@@ -330,6 +379,7 @@ public class Contacts {
* <P>Type: INTEGER (foreign key to organizations table on the
* _ID field)</P>
*/
+ @Deprecated
public static final String PRIMARY_ORGANIZATION_ID = "primary_organization";
/**
@@ -338,6 +388,7 @@ public class Contacts {
* @param resolver the ContentResolver to use
* @param personId the person who was contacted
*/
+ @Deprecated
public static void markAsContacted(ContentResolver resolver, long personId) {
Uri uri = ContentUris.withAppendedId(CONTENT_URI, personId);
uri = Uri.withAppendedPath(uri, "update_contact_time");
@@ -351,6 +402,7 @@ public class Contacts {
/**
* @hide Used in vCard parser code.
*/
+ @Deprecated
public static long tryGetMyContactsGroupId(ContentResolver resolver) {
Cursor groupsCursor = resolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION,
Groups.SYSTEM_ID + "='" + Groups.GROUP_MY_CONTACTS + "'", null, null);
@@ -374,6 +426,7 @@ public class Contacts {
* @return the URI of the group membership row
* @throws IllegalStateException if the My Contacts group can't be found
*/
+ @Deprecated
public static Uri addToMyContactsGroup(ContentResolver resolver, long personId) {
long groupId = tryGetMyContactsGroupId(resolver);
if (groupId == 0) {
@@ -392,6 +445,7 @@ public class Contacts {
* @return the URI of the group membership row
* @throws IllegalStateException if the group can't be found
*/
+ @Deprecated
public static Uri addToGroup(ContentResolver resolver, long personId, String groupName) {
long groupId = 0;
Cursor groupsCursor = resolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION,
@@ -421,6 +475,7 @@ public class Contacts {
* @param groupId the group to add the person to
* @return the URI of the group membership row
*/
+ @Deprecated
public static Uri addToGroup(ContentResolver resolver, long personId, long groupId) {
ContentValues values = new ContentValues();
values.put(GroupMembership.PERSON_ID, personId);
@@ -439,6 +494,7 @@ public class Contacts {
* @param values the values to use when creating the contact
* @return the URI of the contact, or null if the operation fails
*/
+ @Deprecated
public static Uri createPersonInMyContactsGroup(ContentResolver resolver,
ContentValues values) {
@@ -455,6 +511,7 @@ public class Contacts {
return contactUri;
}
+ @Deprecated
public static Cursor queryGroups(ContentResolver resolver, long person) {
return resolver.query(GroupMembership.CONTENT_URI, null, "person=?",
new String[]{String.valueOf(person)}, Groups.DEFAULT_SORT_ORDER);
@@ -466,6 +523,7 @@ public class Contacts {
* @param person the Uri of the person whose photo is to be updated
* @param data the byte[] that represents the photo
*/
+ @Deprecated
public static void setPhotoData(ContentResolver cr, Uri person, byte[] data) {
Uri photoUri = Uri.withAppendedPath(person, Contacts.Photos.CONTENT_DIRECTORY);
ContentValues values = new ContentValues();
@@ -478,6 +536,7 @@ public class Contacts {
* If the person's photo isn't present returns the placeholderImageResource instead.
* @param person the person whose photo should be used
*/
+ @Deprecated
public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri person) {
Uri photoUri = Uri.withAppendedPath(person, Contacts.Photos.CONTENT_DIRECTORY);
Cursor cursor = cr.query(photoUri, new String[]{Photos.DATA}, null, null, null);
@@ -504,6 +563,7 @@ public class Contacts {
* have a photo
* @param options the decoding options, can be set to null
*/
+ @Deprecated
public static Bitmap loadContactPhoto(Context context, Uri person,
int placeholderImageResource, BitmapFactory.Options options) {
if (person == null) {
@@ -530,6 +590,7 @@ public class Contacts {
/**
* A sub directory of a single person that contains all of their Phones.
*/
+ @Deprecated
public static final class Phones implements BaseColumns, PhonesColumns,
PeopleColumns {
/**
@@ -540,11 +601,13 @@ public class Contacts {
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "phones";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "number ASC";
}
@@ -552,6 +615,7 @@ public class Contacts {
* A subdirectory of a single person that contains all of their
* ContactMethods.
*/
+ @Deprecated
public static final class ContactMethods
implements BaseColumns, ContactMethodsColumns, PeopleColumns {
/**
@@ -562,17 +626,20 @@ public class Contacts {
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "contact_methods";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "data ASC";
}
/**
* The extensions for a person
*/
+ @Deprecated
public static class Extensions implements BaseColumns, ExtensionsColumns {
/**
* no public constructor since this is a utility class
@@ -582,17 +649,20 @@ public class Contacts {
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "extensions";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "name ASC";
/**
* The ID of the person this phone number is assigned to.
* <P>Type: INTEGER (long)</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
}
}
@@ -600,17 +670,20 @@ public class Contacts {
/**
* Columns from the groups table.
*/
+ @Deprecated
public interface GroupsColumns {
/**
* The group name.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NAME = "name";
/**
* Notes about the group.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NOTES = "notes";
/**
@@ -618,18 +691,21 @@ public class Contacts {
* for this group's account.
* <P>Type: INTEGER (boolean)</P>
*/
+ @Deprecated
public static final String SHOULD_SYNC = "should_sync";
/**
* The ID of this group if it is a System Group, null otherwise.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String SYSTEM_ID = "system_id";
}
/**
* This table contains the groups for an account.
*/
+ @Deprecated
public static final class Groups
implements BaseColumns, SyncConstValue, GroupsColumns {
/**
@@ -640,6 +716,7 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/groups");
@@ -647,6 +724,7 @@ public class Contacts {
* The content:// style URL for the table that holds the deleted
* groups.
*/
+ @Deprecated
public static final Uri DELETED_CONTENT_URI =
Uri.parse("content://contacts/deleted_groups");
@@ -654,71 +732,90 @@ public class Contacts {
* The MIME type of {@link #CONTENT_URI} providing a directory of
* groups.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroup";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* group.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contactsgroup";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = NAME + " ASC";
/**
*
*/
+ @Deprecated
public static final String GROUP_ANDROID_STARRED = "Starred in Android";
/**
* The "My Contacts" system group.
*/
+ @Deprecated
public static final String GROUP_MY_CONTACTS = "Contacts";
}
/**
* Columns from the Phones table that other columns join into themselves.
*/
+ @Deprecated
public interface PhonesColumns {
/**
* The type of the the phone number.
* <P>Type: INTEGER (one of the constants below)</P>
*/
+ @Deprecated
public static final String TYPE = "type";
+ @Deprecated
public static final int TYPE_CUSTOM = 0;
+ @Deprecated
public static final int TYPE_HOME = 1;
+ @Deprecated
public static final int TYPE_MOBILE = 2;
+ @Deprecated
public static final int TYPE_WORK = 3;
+ @Deprecated
public static final int TYPE_FAX_WORK = 4;
+ @Deprecated
public static final int TYPE_FAX_HOME = 5;
+ @Deprecated
public static final int TYPE_PAGER = 6;
+ @Deprecated
public static final int TYPE_OTHER = 7;
/**
* The user provided label for the phone number, only used if TYPE is TYPE_CUSTOM.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String LABEL = "label";
/**
* The phone number as the user entered it.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NUMBER = "number";
/**
* The normalized phone number
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NUMBER_KEY = "number_key";
/**
* Whether this is the primary phone number
* <P>Type: INTEGER (if set, non-0 means true)</P>
*/
+ @Deprecated
public static final String ISPRIMARY = "isprimary";
}
@@ -727,6 +824,7 @@ public class Contacts {
* contact method belongs to. Phone numbers are stored separately from
* other contact methods to make caller ID lookup more efficient.
*/
+ @Deprecated
public static final class Phones
implements BaseColumns, PhonesColumns, PeopleColumns {
/**
@@ -734,6 +832,7 @@ public class Contacts {
*/
private Phones() {}
+ @Deprecated
public static final CharSequence getDisplayLabel(Context context, int type,
CharSequence label, CharSequence[] labelArray) {
CharSequence display = "";
@@ -755,6 +854,7 @@ public class Contacts {
return display;
}
+ @Deprecated
public static final CharSequence getDisplayLabel(Context context, int type,
CharSequence label) {
return getDisplayLabel(context, type, label, null);
@@ -763,12 +863,14 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/phones");
/**
* The content:// style URL for filtering phone numbers
*/
+ @Deprecated
public static final Uri CONTENT_FILTER_URL =
Uri.parse("content://contacts/phones/filter");
@@ -776,26 +878,31 @@ public class Contacts {
* The MIME type of {@link #CONTENT_URI} providing a directory of
* phones.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* phone.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "name ASC";
/**
* The ID of the person this phone number is assigned to.
* <P>Type: INTEGER (long)</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
}
+ @Deprecated
public static final class GroupMembership implements BaseColumns, GroupsColumns {
/**
* no public constructor since this is a utility class
@@ -805,65 +912,77 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/groupmembership");
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri RAW_CONTENT_URI =
Uri.parse("content://contacts/groupmembershipraw");
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "groupmembership";
+
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of all
* person groups.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroupmembership";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* person group.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE =
"vnd.android.cursor.item/contactsgroupmembership";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "group_id ASC";
/**
* The row id of the accounts group.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String GROUP_ID = "group_id";
/**
* The sync id of the group.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String GROUP_SYNC_ID = "group_sync_id";
/**
* The account of the group.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String GROUP_SYNC_ACCOUNT = "group_sync_account";
/**
* The account type of the group.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String GROUP_SYNC_ACCOUNT_TYPE = "group_sync_account_type";
/**
* The row id of the person.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
}
@@ -871,57 +990,70 @@ public class Contacts {
* Columns from the ContactMethods table that other tables join into
* themseleves.
*/
+ @Deprecated
public interface ContactMethodsColumns {
/**
* The kind of the the contact method. For example, email address,
* postal address, etc.
* <P>Type: INTEGER (one of the values below)</P>
*/
+ @Deprecated
public static final String KIND = "kind";
/**
* The type of the contact method, must be one of the types below.
* <P>Type: INTEGER (one of the values below)</P>
*/
+ @Deprecated
public static final String TYPE = "type";
+ @Deprecated
public static final int TYPE_CUSTOM = 0;
+ @Deprecated
public static final int TYPE_HOME = 1;
+ @Deprecated
public static final int TYPE_WORK = 2;
+ @Deprecated
public static final int TYPE_OTHER = 3;
/**
* @hide This is temporal. TYPE_MOBILE should be added to TYPE in the future.
*/
+ @Deprecated
public static final int MOBILE_EMAIL_TYPE_INDEX = 2;
/**
* @hide This is temporal. TYPE_MOBILE should be added to TYPE in the future.
* This is not "mobile" but "CELL" since vCard uses it for identifying mobile phone.
*/
+ @Deprecated
public static final String MOBILE_EMAIL_TYPE_NAME = "_AUTO_CELL";
/**
* The user defined label for the the contact method.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String LABEL = "label";
/**
* The data for the contact method.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String DATA = "data";
/**
* Auxiliary data for the contact method.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String AUX_DATA = "aux_data";
/**
* Whether this is the primary organization
* <P>Type: INTEGER (if set, non-0 means true)</P>
*/
+ @Deprecated
public static final String ISPRIMARY = "isprimary";
}
@@ -929,18 +1061,21 @@ public class Contacts {
* This table stores all non-phone contact methods and a reference to the
* person that the contact method belongs to.
*/
+ @Deprecated
public static final class ContactMethods
implements BaseColumns, ContactMethodsColumns, PeopleColumns {
/**
* The column with latitude data for postal locations
* <P>Type: REAL</P>
*/
+ @Deprecated
public static final String POSTAL_LOCATION_LATITUDE = DATA;
/**
* The column with longitude data for postal locations
* <P>Type: REAL</P>
*/
+ @Deprecated
public static final String POSTAL_LOCATION_LONGITUDE = AUX_DATA;
/**
@@ -951,23 +1086,34 @@ public class Contacts {
* - pre:<an integer, one of the protocols below>
* - custom:<a string>
*/
+ @Deprecated
public static final int PROTOCOL_AIM = 0;
+ @Deprecated
public static final int PROTOCOL_MSN = 1;
+ @Deprecated
public static final int PROTOCOL_YAHOO = 2;
+ @Deprecated
public static final int PROTOCOL_SKYPE = 3;
+ @Deprecated
public static final int PROTOCOL_QQ = 4;
+ @Deprecated
public static final int PROTOCOL_GOOGLE_TALK = 5;
+ @Deprecated
public static final int PROTOCOL_ICQ = 6;
+ @Deprecated
public static final int PROTOCOL_JABBER = 7;
+ @Deprecated
public static String encodePredefinedImProtocol(int protocol) {
return "pre:" + protocol;
}
+ @Deprecated
public static String encodeCustomImProtocol(String protocolString) {
return "custom:" + protocolString;
}
+ @Deprecated
public static Object decodeImProtocol(String encodedString) {
if (encodedString == null) {
return null;
@@ -995,6 +1141,7 @@ public class Contacts {
* provider is defined for the given protocol
* @hide
*/
+ @Deprecated
public static String lookupProviderNameFromId(int protocol) {
switch (protocol) {
case PROTOCOL_GOOGLE_TALK:
@@ -1022,6 +1169,7 @@ public class Contacts {
*/
private ContactMethods() {}
+ @Deprecated
public static final CharSequence getDisplayLabel(Context context, int kind,
int type, CharSequence label) {
CharSequence display = "";
@@ -1074,6 +1222,7 @@ public class Contacts {
* @param latitude the latitude for the address
* @param longitude the longitude for the address
*/
+ @Deprecated
public void addPostalLocation(Context context, long postalId,
double latitude, double longitude) {
final ContentResolver resolver = context.getContentResolver();
@@ -1093,12 +1242,14 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/contact_methods");
/**
* The content:// style URL for sub-directory of e-mail addresses.
*/
+ @Deprecated
public static final Uri CONTENT_EMAIL_URI =
Uri.parse("content://contacts/contact_methods/email");
@@ -1106,30 +1257,35 @@ public class Contacts {
* The MIME type of {@link #CONTENT_URI} providing a directory of
* phones.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact-methods";
/**
* The MIME type of a {@link #CONTENT_EMAIL_URI} sub-directory of\
* multiple {@link Contacts#KIND_EMAIL} entries.
*/
+ @Deprecated
public static final String CONTENT_EMAIL_TYPE = "vnd.android.cursor.dir/email";
/**
* The MIME type of a {@link #CONTENT_EMAIL_URI} sub-directory of\
* multiple {@link Contacts#KIND_POSTAL} entries.
*/
+ @Deprecated
public static final String CONTENT_POSTAL_TYPE = "vnd.android.cursor.dir/postal-address";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single
* {@link Contacts#KIND_EMAIL} entry.
*/
+ @Deprecated
public static final String CONTENT_EMAIL_ITEM_TYPE = "vnd.android.cursor.item/email";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single
* {@link Contacts#KIND_POSTAL} entry.
*/
+ @Deprecated
public static final String CONTENT_POSTAL_ITEM_TYPE
= "vnd.android.cursor.item/postal-address";
@@ -1137,23 +1293,27 @@ public class Contacts {
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single
* {@link Contacts#KIND_IM} entry.
*/
+ @Deprecated
public static final String CONTENT_IM_ITEM_TYPE = "vnd.android.cursor.item/jabber-im";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "name ASC";
/**
* The ID of the person this contact method is assigned to.
* <P>Type: INTEGER (long)</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
}
/**
* The IM presence columns with some contacts specific columns mixed in.
*/
+ @Deprecated
public interface PresenceColumns extends Im.CommonPresenceColumns {
/**
* The IM service the presence is coming from. Formatted using either
@@ -1161,6 +1321,7 @@ public class Contacts {
* {@link Contacts.ContactMethods#encodeCustomImProtocol}.
* <P>Type: STRING</P>
*/
+ @Deprecated
public static final String IM_PROTOCOL = "im_protocol";
/**
@@ -1168,12 +1329,14 @@ public class Contacts {
* the {@link #IM_PROTOCOL}.
* <P>Type: STRING</P>
*/
+ @Deprecated
public static final String IM_HANDLE = "im_handle";
/**
* The IM account for the local user that the presence data came from.
* <P>Type: STRING</P>
*/
+ @Deprecated
public static final String IM_ACCOUNT = "im_account";
}
@@ -1181,11 +1344,13 @@ public class Contacts {
* Contains presence information about contacts.
* @hide
*/
+ @Deprecated
public static final class Presence
implements BaseColumns, PresenceColumns, PeopleColumns {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/presence");
@@ -1193,6 +1358,7 @@ public class Contacts {
* The ID of the person this presence item is assigned to.
* <P>Type: INTEGER (long)</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
/**
@@ -1201,6 +1367,7 @@ public class Contacts {
* @param status the status to get the icon for
* @return the resource ID for the proper presence icon
*/
+ @Deprecated
public static final int getPresenceIconResourceId(int status) {
switch (status) {
case Contacts.People.AVAILABLE:
@@ -1228,6 +1395,7 @@ public class Contacts {
* @param icon the icon to to set
* @param serverStatus that status
*/
+ @Deprecated
public static final void setPresenceIcon(ImageView icon, int serverStatus) {
icon.setImageResource(getPresenceIconResourceId(serverStatus));
}
@@ -1236,57 +1404,69 @@ public class Contacts {
/**
* Columns from the Organizations table that other columns join into themselves.
*/
+ @Deprecated
public interface OrganizationColumns {
/**
* The type of the organizations.
* <P>Type: INTEGER (one of the constants below)</P>
*/
+ @Deprecated
public static final String TYPE = "type";
+ @Deprecated
public static final int TYPE_CUSTOM = 0;
+ @Deprecated
public static final int TYPE_WORK = 1;
+ @Deprecated
public static final int TYPE_OTHER = 2;
/**
* The user provided label, only used if TYPE is TYPE_CUSTOM.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String LABEL = "label";
/**
* The name of the company for this organization.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String COMPANY = "company";
/**
* The title within this organization.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String TITLE = "title";
/**
* The person this organization is tied to.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
/**
* Whether this is the primary organization
* <P>Type: INTEGER (if set, non-0 means true)</P>
*/
+ @Deprecated
public static final String ISPRIMARY = "isprimary";
}
/**
* A sub directory of a single person that contains all of their Phones.
*/
+ @Deprecated
public static final class Organizations implements BaseColumns, OrganizationColumns {
/**
* no public constructor since this is a utility class
*/
private Organizations() {}
+ @Deprecated
public static final CharSequence getDisplayLabel(Context context, int type,
CharSequence label) {
CharSequence display = "";
@@ -1310,34 +1490,40 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/organizations");
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "organizations";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "company, title, isprimary ASC";
}
/**
* Columns from the Photos table that other columns join into themselves.
*/
+ @Deprecated
public interface PhotosColumns {
/**
* The _SYNC_VERSION of the photo that was last downloaded
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String LOCAL_VERSION = "local_version";
/**
* The person this photo is associated with.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
/**
@@ -1345,12 +1531,14 @@ public class Contacts {
* You must specify this in the columns in order to use it in the where clause.
* <P>Type: INTEGER(boolean)</P>
*/
+ @Deprecated
public static final String DOWNLOAD_REQUIRED = "download_required";
/**
* non-zero if this photo is known to exist on the server
* <P>Type: INTEGER(boolean)</P>
*/
+ @Deprecated
public static final String EXISTS_ON_SERVER = "exists_on_server";
/**
@@ -1358,12 +1546,14 @@ public class Contacts {
* the previous attempt. If null then the previous attempt succeeded.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String SYNC_ERROR = "sync_error";
/**
* The image data, or null if there is no image.
* <P>Type: BLOB</P>
*/
+ @Deprecated
public static final String DATA = "data";
}
@@ -1371,6 +1561,7 @@ public class Contacts {
/**
* The photos over all of the people
*/
+ @Deprecated
public static final class Photos implements BaseColumns, PhotosColumns, SyncConstValue {
/**
* no public constructor since this is a utility class
@@ -1380,37 +1571,44 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/photos");
/**
* The directory twig for this sub-table
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "photo";
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "person ASC";
}
+ @Deprecated
public interface ExtensionsColumns {
/**
* The name of this extension. May not be null. There may be at most one row for each name.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String NAME = "name";
/**
* The value of this extension. May not be null.
* <P>Type: TEXT</P>
*/
+ @Deprecated
public static final String VALUE = "value";
}
/**
* The extensions for a person
*/
+ @Deprecated
public static final class Extensions implements BaseColumns, ExtensionsColumns {
/**
* no public constructor since this is a utility class
@@ -1420,6 +1618,7 @@ public class Contacts {
/**
* The content:// style URL for this table
*/
+ @Deprecated
public static final Uri CONTENT_URI =
Uri.parse("content://contacts/extensions");
@@ -1427,22 +1626,27 @@ public class Contacts {
* The MIME type of {@link #CONTENT_URI} providing a directory of
* phones.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_extensions";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* phone.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_extensions";
+
/**
* The default sort order for this table
*/
+ @Deprecated
public static final String DEFAULT_SORT_ORDER = "person, name ASC";
/**
* The ID of the person this phone number is assigned to.
* <P>Type: INTEGER (long)</P>
*/
+ @Deprecated
public static final String PERSON_ID = "person";
}
@@ -1450,10 +1654,16 @@ public class Contacts {
* Contains helper classes used to create or manage {@link android.content.Intent Intents}
* that involve contacts.
*/
+ @Deprecated
public static final class Intents {
+ @Deprecated
+ public Intents() {
+ }
+
/**
* This is the intent that is fired when a search suggestion is clicked on.
*/
+ @Deprecated
public static final String SEARCH_SUGGESTION_CLICKED =
ContactsContract.Intents.SEARCH_SUGGESTION_CLICKED;
@@ -1461,6 +1671,7 @@ public class Contacts {
* This is the intent that is fired when a search suggestion for dialing a number
* is clicked on.
*/
+ @Deprecated
public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED =
ContactsContract.Intents.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED;
@@ -1468,6 +1679,7 @@ public class Contacts {
* This is the intent that is fired when a search suggestion for creating a contact
* is clicked on.
*/
+ @Deprecated
public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED =
ContactsContract.Intents.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED;
@@ -1475,6 +1687,7 @@ public class Contacts {
* Starts an Activity that lets the user pick a contact to attach an image to.
* After picking the contact it launches the image cropper in face detection mode.
*/
+ @Deprecated
public static final String ATTACH_IMAGE = ContactsContract.Intents.ATTACH_IMAGE;
/**
@@ -1500,6 +1713,7 @@ public class Contacts {
* Passing true for the {@link #EXTRA_FORCE_CREATE} extra will skip
* prompting the user when the contact doesn't exist.
*/
+ @Deprecated
public static final String SHOW_OR_CREATE_CONTACT =
ContactsContract.Intents.SHOW_OR_CREATE_CONTACT;
@@ -1510,6 +1724,7 @@ public class Contacts {
* <p>
* Type: BOOLEAN
*/
+ @Deprecated
public static final String EXTRA_FORCE_CREATE = ContactsContract.Intents.EXTRA_FORCE_CREATE;
/**
@@ -1519,6 +1734,7 @@ public class Contacts {
* <p>
* Type: STRING
*/
+ @Deprecated
public static final String EXTRA_CREATE_DESCRIPTION =
ContactsContract.Intents.EXTRA_CREATE_DESCRIPTION;
@@ -1529,49 +1745,62 @@ public class Contacts {
*
* @hide pending API council review
*/
+ @Deprecated
public static final String EXTRA_TARGET_RECT = ContactsContract.Intents.EXTRA_TARGET_RECT;
/**
* Intents related to the Contacts app UI.
*/
+ @Deprecated
public static final class UI {
+ @Deprecated
+ public UI() {
+ }
+
/**
* The action for the default contacts list tab.
*/
+ @Deprecated
public static final String LIST_DEFAULT = ContactsContract.Intents.UI.LIST_DEFAULT;
/**
* The action for the contacts list tab.
*/
+ @Deprecated
public static final String LIST_GROUP_ACTION =
ContactsContract.Intents.UI.LIST_GROUP_ACTION;
/**
* When in LIST_GROUP_ACTION mode, this is the group to display.
*/
+ @Deprecated
public static final String GROUP_NAME_EXTRA_KEY =
ContactsContract.Intents.UI.GROUP_NAME_EXTRA_KEY;
/**
* The action for the all contacts list tab.
*/
+ @Deprecated
public static final String LIST_ALL_CONTACTS_ACTION =
ContactsContract.Intents.UI.LIST_ALL_CONTACTS_ACTION;
/**
* The action for the contacts with phone numbers list tab.
*/
+ @Deprecated
public static final String LIST_CONTACTS_WITH_PHONES_ACTION =
ContactsContract.Intents.UI.LIST_CONTACTS_WITH_PHONES_ACTION;
/**
* The action for the starred contacts list tab.
*/
+ @Deprecated
public static final String LIST_STARRED_ACTION =
ContactsContract.Intents.UI.LIST_STARRED_ACTION;
/**
* The action for the frequent contacts list tab.
*/
+ @Deprecated
public static final String LIST_FREQUENT_ACTION =
ContactsContract.Intents.UI.LIST_FREQUENT_ACTION;
@@ -1580,6 +1809,7 @@ public class Contacts {
* contacts in alphabetical order and then the frequent contacts in descending
* order of the number of times they have been contacted.
*/
+ @Deprecated
public static final String LIST_STREQUENT_ACTION =
ContactsContract.Intents.UI.LIST_STREQUENT_ACTION;
@@ -1587,6 +1817,7 @@ public class Contacts {
* A key for to be used as an intent extra to set the activity
* title to a custom String value.
*/
+ @Deprecated
public static final String TITLE_EXTRA_KEY =
ContactsContract.Intents.UI.TITLE_EXTRA_KEY;
@@ -1598,6 +1829,7 @@ public class Contacts {
* <p>
* Output: Nothing.
*/
+ @Deprecated
public static final String FILTER_CONTACTS_ACTION =
ContactsContract.Intents.UI.FILTER_CONTACTS_ACTION;
@@ -1605,6 +1837,7 @@ public class Contacts {
* Used as an int extra field in {@link #FILTER_CONTACTS_ACTION}
* intents to supply the text on which to filter.
*/
+ @Deprecated
public static final String FILTER_TEXT_EXTRA_KEY =
ContactsContract.Intents.UI.FILTER_TEXT_EXTRA_KEY;
}
@@ -1613,23 +1846,34 @@ public class Contacts {
* Convenience class that contains string constants used
* to create contact {@link android.content.Intent Intents}.
*/
+ @Deprecated
public static final class Insert {
+ @Deprecated
+ public Insert() {
+ }
+
/** The action code to use when adding a contact */
+ @Deprecated
public static final String ACTION = ContactsContract.Intents.Insert.ACTION;
+
/**
* If present, forces a bypass of quick insert mode.
*/
+ @Deprecated
public static final String FULL_MODE = ContactsContract.Intents.Insert.FULL_MODE;
+
/**
* The extra field for the contact name.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String NAME = ContactsContract.Intents.Insert.NAME;
/**
* The extra field for the contact phonetic name.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String PHONETIC_NAME =
ContactsContract.Intents.Insert.PHONETIC_NAME;
@@ -1637,24 +1881,28 @@ public class Contacts {
* The extra field for the contact company.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String COMPANY = ContactsContract.Intents.Insert.COMPANY;
/**
* The extra field for the contact job title.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String JOB_TITLE = ContactsContract.Intents.Insert.JOB_TITLE;
/**
* The extra field for the contact notes.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String NOTES = ContactsContract.Intents.Insert.NOTES;
/**
* The extra field for the contact phone number.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String PHONE = ContactsContract.Intents.Insert.PHONE;
/**
@@ -1662,12 +1910,14 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.PhonesColumns PhonesColumns},
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String PHONE_TYPE = ContactsContract.Intents.Insert.PHONE_TYPE;
/**
* The extra field for the phone isprimary flag.
* <P>Type: boolean</P>
*/
+ @Deprecated
public static final String PHONE_ISPRIMARY =
ContactsContract.Intents.Insert.PHONE_ISPRIMARY;
@@ -1675,6 +1925,7 @@ public class Contacts {
* The extra field for an optional second contact phone number.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String SECONDARY_PHONE =
ContactsContract.Intents.Insert.SECONDARY_PHONE;
@@ -1683,6 +1934,7 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.PhonesColumns PhonesColumns},
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String SECONDARY_PHONE_TYPE =
ContactsContract.Intents.Insert.SECONDARY_PHONE_TYPE;
@@ -1690,6 +1942,7 @@ public class Contacts {
* The extra field for an optional third contact phone number.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String TERTIARY_PHONE =
ContactsContract.Intents.Insert.TERTIARY_PHONE;
@@ -1698,6 +1951,7 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.PhonesColumns PhonesColumns},
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String TERTIARY_PHONE_TYPE =
ContactsContract.Intents.Insert.TERTIARY_PHONE_TYPE;
@@ -1705,6 +1959,7 @@ public class Contacts {
* The extra field for the contact email address.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String EMAIL = ContactsContract.Intents.Insert.EMAIL;
/**
@@ -1712,12 +1967,14 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String EMAIL_TYPE = ContactsContract.Intents.Insert.EMAIL_TYPE;
/**
* The extra field for the email isprimary flag.
* <P>Type: boolean</P>
*/
+ @Deprecated
public static final String EMAIL_ISPRIMARY =
ContactsContract.Intents.Insert.EMAIL_ISPRIMARY;
@@ -1725,6 +1982,7 @@ public class Contacts {
* The extra field for an optional second contact email address.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String SECONDARY_EMAIL =
ContactsContract.Intents.Insert.SECONDARY_EMAIL;
@@ -1733,6 +1991,7 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String SECONDARY_EMAIL_TYPE =
ContactsContract.Intents.Insert.SECONDARY_EMAIL_TYPE;
@@ -1740,6 +1999,7 @@ public class Contacts {
* The extra field for an optional third contact email address.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String TERTIARY_EMAIL =
ContactsContract.Intents.Insert.TERTIARY_EMAIL;
@@ -1748,6 +2008,7 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String TERTIARY_EMAIL_TYPE =
ContactsContract.Intents.Insert.TERTIARY_EMAIL_TYPE;
@@ -1755,6 +2016,7 @@ public class Contacts {
* The extra field for the contact postal address.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String POSTAL = ContactsContract.Intents.Insert.POSTAL;
/**
@@ -1762,18 +2024,21 @@ public class Contacts {
* <P>Type: Either an integer value from {@link android.provider.Contacts.ContactMethodsColumns ContactMethodsColumns}
* or a string specifying a custom label.</P>
*/
+ @Deprecated
public static final String POSTAL_TYPE = ContactsContract.Intents.Insert.POSTAL_TYPE;
/**
* The extra field for the postal isprimary flag.
* <P>Type: boolean</P>
*/
+ @Deprecated
public static final String POSTAL_ISPRIMARY = ContactsContract.Intents.Insert.POSTAL_ISPRIMARY;
/**
* The extra field for an IM handle.
* <P>Type: String</P>
*/
+ @Deprecated
public static final String IM_HANDLE = ContactsContract.Intents.Insert.IM_HANDLE;
/**
@@ -1781,12 +2046,14 @@ public class Contacts {
* <P>Type: the result of {@link Contacts.ContactMethods#encodePredefinedImProtocol}
* or {@link Contacts.ContactMethods#encodeCustomImProtocol}.</P>
*/
+ @Deprecated
public static final String IM_PROTOCOL = ContactsContract.Intents.Insert.IM_PROTOCOL;
/**
* The extra field for the IM isprimary flag.
* <P>Type: boolean</P>
*/
+ @Deprecated
public static final String IM_ISPRIMARY = ContactsContract.Intents.Insert.IM_ISPRIMARY;
}
}