Contacts: renaming Aggregates to Contacts
diff --git a/src/com/android/contacts/ContactEntryAdapter.java b/src/com/android/contacts/ContactEntryAdapter.java
index d384f83..5307e42 100644
--- a/src/com/android/contacts/ContactEntryAdapter.java
+++ b/src/com/android/contacts/ContactEntryAdapter.java
@@ -19,7 +19,7 @@
import android.content.Context;
import android.net.Uri;
import android.os.Parcel;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.view.LayoutInflater;
import android.view.View;
@@ -31,12 +31,12 @@
public abstract class ContactEntryAdapter<E extends ContactEntryAdapter.Entry>
extends BaseAdapter {
- public static final String[] AGGREGATE_PROJECTION = new String[] {
- Aggregates.DISPLAY_NAME, // 0
- Aggregates.STARRED, //1
- Aggregates.PHOTO_ID, //2
+ public static final String[] CONTACT_PROJECTION = new String[] {
+ Contacts.DISPLAY_NAME, // 0
+ Contacts.STARRED, //1
+ Contacts.PHOTO_ID, //2
Data._ID, //3
- Data.CONTACT_ID, //4
+ Data.RAW_CONTACT_ID, //4
Data.RES_PACKAGE, //5
Data.MIMETYPE, //6
Data.IS_PRIMARY, //7
@@ -52,9 +52,9 @@
Data.DATA9, //17
Data.DATA10, //18
};
- public static final int AGGREGATE_DISPLAY_NAME_COLUMN = 0;
- public static final int AGGREGATE_STARRED_COLUMN = 1;
- public static final int AGGREGATE_PHOTO_ID = 2;
+ public static final int CONTACT_DISPLAY_NAME_COLUMN = 0;
+ public static final int CONTACT_STARRED_COLUMN = 1;
+ public static final int CONTACT_PHOTO_ID = 2;
public static final int DATA_ID_COLUMN = 3;
public static final int DATA_CONTACT_ID_COLUMN = 4;
public static final int DATA_PACKAGE_COLUMN = 5;
diff --git a/src/com/android/contacts/ContactOptionsActivity.java b/src/com/android/contacts/ContactOptionsActivity.java
index 83b1062..fbe4604 100644
--- a/src/com/android/contacts/ContactOptionsActivity.java
+++ b/src/com/android/contacts/ContactOptionsActivity.java
@@ -24,7 +24,7 @@
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
@@ -38,7 +38,7 @@
private static final String TAG = "ContactOptionsActivity";
private static final String[] AGGREGATES_PROJECTION = new String[] {
- Aggregates.CUSTOM_RINGTONE, Aggregates.SEND_TO_VOICEMAIL
+ Contacts.CUSTOM_RINGTONE, Contacts.SEND_TO_VOICEMAIL
};
private static final int COL_CUSTOM_RINGTONE = 0;
@@ -193,8 +193,8 @@
private void saveData() {
ContentValues values = new ContentValues(2);
- values.put(Aggregates.CUSTOM_RINGTONE, mCustomRingtone);
- values.put(Aggregates.SEND_TO_VOICEMAIL, mSendToVoicemail);
+ values.put(Contacts.CUSTOM_RINGTONE, mCustomRingtone);
+ values.put(Contacts.SEND_TO_VOICEMAIL, mSendToVoicemail);
getContentResolver().update(mAggregateUri, values, null, null);
}
}
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index ad78f95..87eb474 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -41,8 +41,8 @@
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.provider.ContactsContract;
-import android.provider.ContactsContract.Aggregates;
-import android.provider.ContactsContract.Aggregates.AggregationSuggestions;
+import android.provider.ContactsContract.Contacts;
+import android.provider.ContactsContract.Contacts.AggregationSuggestions;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -182,24 +182,24 @@
/** Maximum number of suggestions shown for joining aggregates */
static final int MAX_SUGGESTIONS = 4;
- static final String NAME_COLUMN = Aggregates.DISPLAY_NAME;
+ static final String NAME_COLUMN = Contacts.DISPLAY_NAME;
//static final String SORT_STRING = People.SORT_STRING;
static final String[] AGGREGATES_PROJECTION = new String[] {
- Aggregates._ID, // 0
- Aggregates.DISPLAY_NAME, // 1
- Aggregates.STARRED, //2
- Aggregates.PRIMARY_PHONE_ID, //3
- Aggregates.PRIMARY_EMAIL_ID, //4
+ Contacts._ID, // 0
+ Contacts.DISPLAY_NAME, // 1
+ Contacts.STARRED, //2
+ Contacts.PRIMARY_PHONE_ID, //3
+ Contacts.PRIMARY_EMAIL_ID, //4
};
static final String[] AGGREGATES_SUMMARY_PROJECTION = new String[] {
- Aggregates._ID, // 0
- Aggregates.DISPLAY_NAME, // 1
- Aggregates.STARRED, //2
- Aggregates.PRIMARY_PHONE_ID, //3
- Aggregates.TIMES_CONTACTED, //4
- Aggregates.PHOTO_ID, //5
+ Contacts._ID, // 0
+ Contacts.DISPLAY_NAME, // 1
+ Contacts.STARRED, //2
+ Contacts.PRIMARY_PHONE_ID, //3
+ Contacts.TIMES_CONTACTED, //4
+ Contacts.PHOTO_ID, //5
Presence.PRESENCE_STATUS, //6
CommonDataKinds.Phone.TYPE, //7
CommonDataKinds.Phone.LABEL, //8
@@ -221,7 +221,7 @@
CommonDataKinds.Phone.TYPE, //1
CommonDataKinds.Phone.LABEL, //2
CommonDataKinds.Phone.NUMBER, //3
- Aggregates.DISPLAY_NAME, // 4
+ Contacts.DISPLAY_NAME, // 4
};
static final int PHONE_ID_COLUMN_INDEX = 0;
static final int PHONE_TYPE_COLUMN_INDEX = 1;
@@ -234,7 +234,7 @@
CommonDataKinds.StructuredPostal.TYPE, //1
CommonDataKinds.StructuredPostal.LABEL, //2
CommonDataKinds.StructuredPostal.DATA, //3
- Aggregates.DISPLAY_NAME, // 4
+ Contacts.DISPLAY_NAME, // 4
};
static final int POSTAL_ID_COLUMN_INDEX = 0;
static final int POSTAL_TYPE_COLUMN_INDEX = 1;
@@ -292,8 +292,8 @@
*/
private String mQueryData;
- private static final String CLAUSE_ONLY_VISIBLE = Aggregates.IN_VISIBLE_GROUP + "=1";
- private static final String CLAUSE_ONLY_PHONES = Aggregates.PRIMARY_PHONE_ID + " IS NOT NULL";
+ private static final String CLAUSE_ONLY_VISIBLE = Contacts.IN_VISIBLE_GROUP + "=1";
+ private static final String CLAUSE_ONLY_PHONES = Contacts.PRIMARY_PHONE_ID + " IS NOT NULL";
private class DeleteClickListener implements DialogInterface.OnClickListener {
private Uri mUri;
@@ -357,7 +357,7 @@
// the Intent.
mDisplayAll = true;
final String type = intent.resolveType(this);
- if (Aggregates.CONTENT_TYPE.equals(type)) {
+ if (Contacts.CONTENT_TYPE.equals(type)) {
mMode = MODE_PICK_AGGREGATE;
} else if (Phone.CONTENT_TYPE.equals(type)) {
mMode = MODE_PICK_PHONE;
@@ -369,7 +369,7 @@
mCreateShortcut = true;
} else if (Intent.ACTION_GET_CONTENT.equals(action)) {
final String type = intent.resolveType(this);
- if (Aggregates.CONTENT_ITEM_TYPE.equals(type)) {
+ if (Contacts.CONTENT_ITEM_TYPE.equals(type)) {
mMode = MODE_PICK_OR_CREATE_AGGREGATE;
} else if (Phone.CONTENT_ITEM_TYPE.equals(type)) {
mMode = MODE_PICK_PHONE;
@@ -429,7 +429,7 @@
} else if (Intents.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED.equals(action)) {
// TODO actually support this in EditContactActivity.
String number = intent.getData().getSchemeSpecificPart();
- Intent newIntent = new Intent(Intent.ACTION_INSERT, Aggregates.CONTENT_URI);
+ Intent newIntent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
newIntent.putExtra(Intents.Insert.PHONE, number);
startActivity(newIntent);
finish();
@@ -529,7 +529,7 @@
}
private void buildUserGroupUri(String group) {
- mGroupUri = Uri.withAppendedPath(Aggregates.CONTENT_SUMMARY_GROUP_URI, group);
+ mGroupUri = Uri.withAppendedPath(Contacts.CONTENT_SUMMARY_GROUP_URI, group);
}
/**
@@ -739,7 +739,7 @@
return;
}
long id = info.id;
- Uri aggUri = ContentUris.withAppendedId(Aggregates.CONTENT_URI, id);
+ Uri aggUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, id);
// Setup the menu header
menu.setHeaderTitle(cursor.getString(SUMMARY_NAME_COLUMN_INDEX));
@@ -798,8 +798,8 @@
case MENU_ITEM_TOGGLE_STAR: {
// Toggle the star
ContentValues values = new ContentValues(1);
- values.put(Aggregates.STARRED, cursor.getInt(SUMMARY_STARRED_COLUMN_INDEX) == 0 ? 1 : 0);
- Uri aggUri = ContentUris.withAppendedId(Aggregates.CONTENT_URI,
+ values.put(Contacts.STARRED, cursor.getInt(SUMMARY_STARRED_COLUMN_INDEX) == 0 ? 1 : 0);
+ Uri aggUri = ContentUris.withAppendedId(Contacts.CONTENT_URI,
cursor.getInt(ID_COLUMN_INDEX));
getContentResolver().update(aggUri, values, null, null);
return true;
@@ -838,7 +838,7 @@
Object o = getListView().getSelectedItem();
if (o != null) {
Cursor cursor = (Cursor) o;
- Uri uri = ContentUris.withAppendedId(Aggregates.CONTENT_URI,
+ Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI,
cursor.getLong(ID_COLUMN_INDEX));
//TODO make this dialog persist across screen rotations
new AlertDialog.Builder(ContactsListActivity.this)
@@ -869,11 +869,11 @@
Intent intent;
if (position == 0) {
// Insert
- intent = new Intent(Intent.ACTION_INSERT, Aggregates.CONTENT_URI);
+ intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
} else {
// Edit
intent = new Intent(Intent.ACTION_EDIT,
- ContentUris.withAppendedId(Aggregates.CONTENT_URI, id));
+ ContentUris.withAppendedId(Contacts.CONTENT_URI, id));
}
intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
final Bundle extras = getIntent().getExtras();
@@ -886,10 +886,10 @@
if (id != -1) {
if ((mMode & MODE_MASK_PICKER) == 0) {
Intent intent = new Intent(Intent.ACTION_VIEW,
- ContentUris.withAppendedId(Aggregates.CONTENT_URI, id));
+ ContentUris.withAppendedId(Contacts.CONTENT_URI, id));
startActivityForResult(intent, SUBACTIVITY_VIEW_CONTACT);
} else if (mMode == MODE_JOIN_AGGREGATE) {
- Uri uri = ContentUris.withAppendedId(Aggregates.CONTENT_URI, id);
+ Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI, id);
returnPickerResult(null, uri);
}
@@ -903,7 +903,7 @@
finish();
}*/ else if (mMode == MODE_PICK_AGGREGATE
|| mMode == MODE_PICK_OR_CREATE_AGGREGATE) {
- Uri uri = ContentUris.withAppendedId(Aggregates.CONTENT_URI, id);
+ Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI, id);
if (mCreateShortcut) {
// Subtract one if we have Create Contact at the top
Cursor c = (Cursor) mAdapter.getItem(position
@@ -1003,9 +1003,9 @@
private Uri getAggregateFilterUri(String filter) {
if (!TextUtils.isEmpty(filter)) {
- return Uri.withAppendedPath(Aggregates.CONTENT_SUMMARY_FILTER_URI, Uri.encode(filter));
+ return Uri.withAppendedPath(Contacts.CONTENT_SUMMARY_FILTER_URI, Uri.encode(filter));
} else {
- return Aggregates.CONTENT_SUMMARY_URI;
+ return Contacts.CONTENT_SUMMARY_URI;
}
}
@@ -1038,7 +1038,7 @@
case MODE_PICK_AGGREGATE:
case MODE_PICK_OR_CREATE_AGGREGATE:
case MODE_INSERT_OR_EDIT_CONTACT:
- mQueryHandler.startQuery(QUERY_TOKEN, null, Aggregates.CONTENT_SUMMARY_URI,
+ mQueryHandler.startQuery(QUERY_TOKEN, null, Contacts.CONTENT_SUMMARY_URI,
AGGREGATES_SUMMARY_PROJECTION, getAggregateSelection(), null,
getSortOrder(AGGREGATES_SUMMARY_PROJECTION));
break;
@@ -1073,22 +1073,22 @@
*/
case MODE_STARRED:
- mQueryHandler.startQuery(QUERY_TOKEN, null, Aggregates.CONTENT_SUMMARY_URI,
- AGGREGATES_SUMMARY_PROJECTION, Aggregates.STARRED + "=1", null,
+ mQueryHandler.startQuery(QUERY_TOKEN, null, Contacts.CONTENT_SUMMARY_URI,
+ AGGREGATES_SUMMARY_PROJECTION, Contacts.STARRED + "=1", null,
getSortOrder(AGGREGATES_SUMMARY_PROJECTION));
break;
case MODE_FREQUENT:
- mQueryHandler.startQuery(QUERY_TOKEN, null, Aggregates.CONTENT_SUMMARY_URI,
+ mQueryHandler.startQuery(QUERY_TOKEN, null, Contacts.CONTENT_SUMMARY_URI,
AGGREGATES_SUMMARY_PROJECTION,
- Aggregates.TIMES_CONTACTED + " > 0", null,
- Aggregates.TIMES_CONTACTED + " DESC, "
+ Contacts.TIMES_CONTACTED + " > 0", null,
+ Contacts.TIMES_CONTACTED + " DESC, "
+ getSortOrder(AGGREGATES_SUMMARY_PROJECTION));
break;
case MODE_STREQUENT:
mQueryHandler.startQuery(QUERY_TOKEN, null,
- Aggregates.CONTENT_SUMMARY_STREQUENT_URI, AGGREGATES_SUMMARY_PROJECTION,
+ Contacts.CONTENT_SUMMARY_STREQUENT_URI, AGGREGATES_SUMMARY_PROJECTION,
null, null, null);
break;
@@ -1103,7 +1103,7 @@
break;
case MODE_JOIN_AGGREGATE:
- Uri suggestionsUri = Aggregates.CONTENT_URI.buildUpon()
+ Uri suggestionsUri = Contacts.CONTENT_URI.buildUpon()
.appendEncodedPath(String.valueOf(mQueryAggregateId))
.appendEncodedPath(AggregationSuggestions.CONTENT_DIRECTORY)
.appendQueryParameter(AggregationSuggestions.MAX_SUGGESTIONS,
@@ -1135,24 +1135,24 @@
case MODE_STARRED: {
return resolver.query(getAggregateFilterUri(filter), AGGREGATES_SUMMARY_PROJECTION,
- Aggregates.STARRED + "=1", null,
+ Contacts.STARRED + "=1", null,
getSortOrder(AGGREGATES_SUMMARY_PROJECTION));
}
case MODE_FREQUENT: {
return resolver.query(getAggregateFilterUri(filter), AGGREGATES_SUMMARY_PROJECTION,
- Aggregates.TIMES_CONTACTED + " > 0", null,
- Aggregates.TIMES_CONTACTED + " DESC, "
+ Contacts.TIMES_CONTACTED + " > 0", null,
+ Contacts.TIMES_CONTACTED + " DESC, "
+ getSortOrder(AGGREGATES_SUMMARY_PROJECTION));
}
case MODE_STREQUENT: {
Uri uri;
if (!TextUtils.isEmpty(filter)) {
- uri = Uri.withAppendedPath(Aggregates.CONTENT_SUMMARY_STREQUENT_FILTER_URI,
+ uri = Uri.withAppendedPath(Contacts.CONTENT_SUMMARY_STREQUENT_FILTER_URI,
Uri.encode(filter));
} else {
- uri = Aggregates.CONTENT_SUMMARY_STREQUENT_URI;
+ uri = Contacts.CONTENT_SUMMARY_STREQUENT_URI;
}
return resolver.query(uri, AGGREGATES_SUMMARY_PROJECTION, null, null, null);
}
@@ -1273,8 +1273,8 @@
} else {
activity.mAdapter.setSuggestionsCursor(null);
}
- startQuery(QUERY_TOKEN, null, Aggregates.CONTENT_URI, AGGREGATES_PROJECTION,
- Aggregates._ID + " != " + mAggregateId, null,
+ startQuery(QUERY_TOKEN, null, Contacts.CONTENT_URI, AGGREGATES_PROJECTION,
+ Contacts._ID + " != " + mAggregateId, null,
getSortOrder(AGGREGATES_PROJECTION));
} else {
diff --git a/src/com/android/contacts/EditContactActivity.java b/src/com/android/contacts/EditContactActivity.java
index 4a62dd5..f10ff93 100644
--- a/src/com/android/contacts/EditContactActivity.java
+++ b/src/com/android/contacts/EditContactActivity.java
@@ -16,20 +16,16 @@
package com.android.contacts;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_DISPLAY_NAME_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_PROJECTION;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_STARRED_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.DATA_ID_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.DATA_PACKAGE_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.DATA_MIMETYPE_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.DATA_IS_PRIMARY_COLUMN;
-import static com.android.contacts.ContactEntryAdapter.DATA_IS_SUPER_PRIMARY_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.CONTACT_PROJECTION;
import static com.android.contacts.ContactEntryAdapter.DATA_1_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_2_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_3_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_4_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_5_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_9_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.DATA_ID_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.DATA_IS_SUPER_PRIMARY_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.DATA_MIMETYPE_COLUMN;
import android.app.Activity;
import android.app.AlertDialog;
@@ -41,7 +37,6 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.database.Cursor;
@@ -50,10 +45,8 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
-import android.preference.PreferenceManager;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.Aggregates;
import android.provider.ContactsContract.CommonDataKinds;
+import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.CommonDataKinds.BaseTypes;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Im;
@@ -63,7 +56,6 @@
import android.provider.ContactsContract.CommonDataKinds.Photo;
import android.provider.ContactsContract.CommonDataKinds.StructuredName;
import android.provider.ContactsContract.CommonDataKinds.StructuredPostal;
-import android.provider.ContactsContract.Data;
import android.telephony.PhoneNumberFormattingTextWatcher;
import android.text.Editable;
import android.text.TextUtils;
@@ -71,7 +63,6 @@
import android.text.method.TextKeyListener;
import android.text.method.TextKeyListener.Capitalize;
import android.util.Log;
-import android.util.SparseBooleanArray;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -86,7 +77,6 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import android.widget.Toast;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
@@ -1222,7 +1212,7 @@
* @param extras the extras used to start this activity, may be null
*/
private void buildEntriesForEdit(Bundle extras) {
- Cursor aggCursor = mResolver.query(mAggDataUri, AGGREGATE_PROJECTION, null, null, null);
+ Cursor aggCursor = mResolver.query(mAggDataUri, CONTACT_PROJECTION, null, null, null);
if (aggCursor == null) {
Log.e(TAG, "invalid contact uri: " + mUri);
finish();
diff --git a/src/com/android/contacts/FastTrackWindow.java b/src/com/android/contacts/FastTrackWindow.java
index f206dd1..32acd1e 100644
--- a/src/com/android/contacts/FastTrackWindow.java
+++ b/src/com/android/contacts/FastTrackWindow.java
@@ -35,7 +35,7 @@
import android.provider.ContactsContract;
import android.provider.SocialContract;
import android.provider.Contacts.Phones;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.Presence;
@@ -81,7 +81,7 @@
/**
* Window that shows fast-track contact details for a specific
- * {@link Aggregates#_ID}.
+ * {@link Contacts#_ID}.
*/
public class FastTrackWindow implements Window.Callback, QueryCompleteListener, OnClickListener,
AbsListView.OnItemClickListener {
@@ -156,7 +156,7 @@
*/
private static final String[] ORDERED_MIMETYPES = new String[] {
Phones.CONTENT_ITEM_TYPE,
- Aggregates.CONTENT_ITEM_TYPE,
+ Contacts.CONTENT_ITEM_TYPE,
MIME_SMS_ADDRESS,
Email.CONTENT_ITEM_TYPE,
};
@@ -222,7 +222,7 @@
Resources res = mContext.getResources();
Mapping mapping;
- mapping = new Mapping(CommonDataKinds.PACKAGE_COMMON, Aggregates.CONTENT_ITEM_TYPE);
+ mapping = new Mapping(CommonDataKinds.PACKAGE_COMMON, Contacts.CONTENT_ITEM_TYPE);
mapping.icon = BitmapFactory.decodeResource(res, R.drawable.ic_contacts_details);
mMappingCache.addMapping(mapping);
@@ -261,11 +261,11 @@
mQuerying = true;
Uri aggSummary = ContentUris.withAppendedId(
- ContactsContract.Aggregates.CONTENT_SUMMARY_URI, mAggId);
+ ContactsContract.Contacts.CONTENT_SUMMARY_URI, mAggId);
Uri aggSocial = ContentUris.withAppendedId(
SocialContract.Activities.CONTENT_AGGREGATE_STATUS_URI, mAggId);
Uri aggData = Uri.withAppendedPath(aggUri,
- ContactsContract.Aggregates.Data.CONTENT_DIRECTORY);
+ ContactsContract.Contacts.Data.CONTENT_DIRECTORY);
// Start data query in background
mHandler = new NotifyingAsyncQueryHandler(mContext, this);
@@ -430,7 +430,7 @@
* Handle the result from the {@link TOKEN_SUMMARY} query.
*/
private void handleSummary(Cursor cursor) {
- final int colDisplayName = cursor.getColumnIndex(Aggregates.DISPLAY_NAME);
+ final int colDisplayName = cursor.getColumnIndex(Contacts.DISPLAY_NAME);
final int colStatus = cursor.getColumnIndex(PresenceColumns.PRESENCE_STATUS);
if (cursor.moveToNext()) {
@@ -583,7 +583,7 @@
// Add the profile shortcut action if requested
if (INCLUDE_PROFILE_ACTION) {
- final String mimeType = Aggregates.CONTENT_ITEM_TYPE;
+ final String mimeType = Contacts.CONTENT_ITEM_TYPE;
info = new ActionInfo(mAggId, CommonDataKinds.PACKAGE_COMMON, mimeType);
if (info.findMapping(mMappingCache)) {
mActions.collect(mimeType, info);
diff --git a/src/com/android/contacts/ShowOrCreateActivity.java b/src/com/android/contacts/ShowOrCreateActivity.java
index 365353e..3be2b33 100755
--- a/src/com/android/contacts/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/ShowOrCreateActivity.java
@@ -31,7 +31,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Contacts.Intents;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.PhoneLookup;
import android.view.View;
@@ -62,7 +62,7 @@
};
static final String[] CONTACTS_PROJECTION = new String[] {
- RawContacts.AGGREGATE_ID,
+ RawContacts.CONTACT_ID,
};
static final String SCHEME_MAILTO = "mailto";
@@ -203,7 +203,7 @@
if (count == 1 && aggId != -1) {
// If we only found one item, show fast-track
- final Uri aggUri = ContentUris.withAppendedId(Aggregates.CONTENT_URI, aggId);
+ final Uri aggUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, aggId);
showFastTrack(aggUri);
} else if (count > 1) {
diff --git a/src/com/android/contacts/SocialStreamActivity.java b/src/com/android/contacts/SocialStreamActivity.java
index 65c9932..ae22adf 100644
--- a/src/com/android/contacts/SocialStreamActivity.java
+++ b/src/com/android/contacts/SocialStreamActivity.java
@@ -41,7 +41,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.RawContacts;
@@ -77,8 +77,8 @@
Activities.RES_PACKAGE,
Activities.MIMETYPE,
Activities.AUTHOR_CONTACT_ID,
- RawContacts.AGGREGATE_ID,
- Aggregates.DISPLAY_NAME,
+ RawContacts.CONTACT_ID,
+ Contacts.DISPLAY_NAME,
Activities.PUBLISHED,
Activities.TITLE,
Activities.SUMMARY,
@@ -166,7 +166,7 @@
private Rect mRect = new Rect();
private void showFastTrack(View anchor, long aggId) {
- Uri aggUri = ContentUris.withAppendedId(ContactsContract.Aggregates.CONTENT_URI, aggId);
+ Uri aggUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, aggId);
anchor.getLocationInWindow(mLocation);
mRect.left = mLocation[0];
@@ -365,12 +365,12 @@
private static final String[] PROJ_DETAILS = new String[] {
Data.MIMETYPE,
- Data.CONTACT_ID,
+ Data.RAW_CONTACT_ID,
Photo.PHOTO,
};
private static final int COL_MIMETYPE = 0;
- private static final int COL_CONTACT_ID = 1;
+ private static final int COL_RAW_CONTACT_ID = 1;
private static final int COL_PHOTO = 2;
private HashMap<Long, Bitmap> mPhoto = new HashMap<Long, Bitmap>();
@@ -383,7 +383,7 @@
Data.MIMETYPE + "=?", new String[] { Photo.CONTENT_ITEM_TYPE }, null);
while (cursor.moveToNext()) {
- long contactId = cursor.getLong(COL_CONTACT_ID);
+ long contactId = cursor.getLong(COL_RAW_CONTACT_ID);
String mimeType = cursor.getString(COL_MIMETYPE);
if (Photo.CONTENT_ITEM_TYPE.equals(mimeType)) {
byte[] photoBlob = cursor.getBlob(COL_PHOTO);
diff --git a/src/com/android/contacts/SplitAggregateView.java b/src/com/android/contacts/SplitAggregateView.java
index 15b50d3..96eb2b5 100644
--- a/src/com/android/contacts/SplitAggregateView.java
+++ b/src/com/android/contacts/SplitAggregateView.java
@@ -22,7 +22,7 @@
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
-import android.provider.ContactsContract.Aggregates.Data;
+import android.provider.ContactsContract.Contacts.Data;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Nickname;
import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -49,13 +49,13 @@
public class SplitAggregateView extends ListView {
private static final String[] AGGREGATE_DATA_PROJECTION = new String[] {
- Data.MIMETYPE, Data.RES_PACKAGE, Data.CONTACT_ID, Data.DATA1, Data.DATA2,
+ Data.MIMETYPE, Data.RES_PACKAGE, Data.RAW_CONTACT_ID, Data.DATA1, Data.DATA2,
Data.IS_PRIMARY, StructuredName.DISPLAY_NAME
};
private static final int COL_MIMETYPE = 0;
private static final int COL_RES_PACKAGE = 1;
- private static final int COL_CONTACT_ID = 2;
+ private static final int COL_RAW_CONTACT_ID = 2;
private static final int COL_DATA1 = 3;
private static final int COL_DATA2 = 4;
private static final int COL_IS_PRIMARY = 5;
@@ -145,7 +145,7 @@
AGGREGATE_DATA_PROJECTION, null, null, null);
try {
while (cursor.moveToNext()) {
- long contactId = cursor.getLong(COL_CONTACT_ID);
+ long contactId = cursor.getLong(COL_RAW_CONTACT_ID);
ContactInfo info = contactInfos.get(contactId);
if (info == null) {
info = new ContactInfo(contactId);
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 8c29d49..8126ae5 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -16,9 +16,9 @@
package com.android.contacts;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_PHOTO_ID;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_PROJECTION;
-import static com.android.contacts.ContactEntryAdapter.AGGREGATE_STARRED_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.CONTACT_PHOTO_ID;
+import static com.android.contacts.ContactEntryAdapter.CONTACT_PROJECTION;
+import static com.android.contacts.ContactEntryAdapter.CONTACT_STARRED_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_1_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_2_COLUMN;
import static com.android.contacts.ContactEntryAdapter.DATA_3_COLUMN;
@@ -58,7 +58,7 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
-import android.provider.ContactsContract.Aggregates;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.AggregationExceptions;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Data;
@@ -114,7 +114,7 @@
private int mNumPhoneNumbers = 0;
/**
- * A list of distinct contact IDs included in the current aggregate.
+ * A list of distinct contact IDs included in the current contact.
*/
private ArrayList<Long> mContactIds = new ArrayList<Long>();
@@ -165,9 +165,9 @@
switch (view.getId()) {
case R.id.star: {
mCursor.moveToFirst();
- int oldStarredState = mCursor.getInt(AGGREGATE_STARRED_COLUMN);
+ int oldStarredState = mCursor.getInt(CONTACT_STARRED_COLUMN);
ContentValues values = new ContentValues(1);
- values.put(Aggregates.STARRED, oldStarredState == 1 ? 0 : 1);
+ values.put(Contacts.STARRED, oldStarredState == 1 ? 0 : 1);
getContentResolver().update(mUri, values, null, null);
break;
}
@@ -227,7 +227,7 @@
mShowSmsLinksForAllPhones = true;
mCursor = mResolver.query(mAggDataUri,
- AGGREGATE_PROJECTION, null, null, null);
+ CONTACT_PROJECTION, null, null, null);
}
@Override
@@ -283,10 +283,10 @@
mCursor.requery();
if (mCursor.moveToFirst()) {
// Set the star
- mStarView.setChecked(mCursor.getInt(AGGREGATE_STARRED_COLUMN) == 1 ? true : false);
+ mStarView.setChecked(mCursor.getInt(CONTACT_STARRED_COLUMN) == 1 ? true : false);
//Set the photo
- int photoId = mCursor.getInt(AGGREGATE_PHOTO_ID);
+ int photoId = mCursor.getInt(CONTACT_PHOTO_ID);
Bitmap photoBitmap = ContactsUtils.loadContactPhoto(
this, photoId, null);
if (photoBitmap == null) {
@@ -566,7 +566,7 @@
private void joinAggregate(final long aggregateId) {
Cursor c = mResolver.query(RawContacts.CONTENT_URI, new String[] {RawContacts._ID},
- RawContacts.AGGREGATE_ID + "=" + aggregateId, null, null);
+ RawContacts.CONTACT_ID + "=" + aggregateId, null, null);
try {
while(c.moveToNext()) {
@@ -587,7 +587,7 @@
*/
protected void setAggregationException(long contactId, int exceptionType) {
ContentValues values = new ContentValues(3);
- values.put(AggregationExceptions.AGGREGATE_ID, ContentUris.parseId(mUri));
+ values.put(AggregationExceptions.CONTACT_ID, ContentUris.parseId(mUri));
values.put(AggregationExceptions.CONTACT_ID, contactId);
values.put(AggregationExceptions.TYPE, exceptionType);
mResolver.update(AggregationExceptions.CONTENT_URI, values, null, null);