ContactsContract: Adding joined columns to the Data class definition.
The rationale is this. Since all these joined columns are currently on
different classes, we routinely see code like this:
private static final String[] PROJECTION_PHONE = {
Data._ID, // 0
RawContacts.CONTACT_ID, // 1
Phone.TYPE, // 2
Phone.NUMBER, // 3
Phone.LABEL, // 4
Contacts.DISPLAY_NAME, // 5
};
The most noxious line is RawContacts.CONTACT_ID
After this change, the above declaration changes to:
private static final String[] PROJECTION_PHONE = {
Data._ID, // 0
Data.CONTACT_ID, // 1
Phone.TYPE, // 2
Phone.NUMBER, // 3
Phone.LABEL, // 4
Data.DISPLAY_NAME, // 5
};
Change-Id: I820e68efd6c1364241596f826c4da1b9c2defe11
This commit is contained in:
@@ -682,7 +682,8 @@ public final class ContactsContract {
|
||||
* definition and some generic columns. Each data type can define the meaning for each of
|
||||
* the generic columns.
|
||||
*/
|
||||
public static final class Data implements BaseColumns, DataColumns {
|
||||
public static final class Data implements BaseColumns, DataColumns, RawContactsColumns,
|
||||
ContactsColumns, SyncColumns {
|
||||
/**
|
||||
* This utility class cannot be instantiated
|
||||
*/
|
||||
|
||||
@@ -25,9 +25,9 @@ import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.provider.ContactsContract.Contacts;
|
||||
import android.provider.ContactsContract.FastTrack;
|
||||
import android.provider.ContactsContract.Data;
|
||||
import android.provider.ContactsContract.Intents;
|
||||
import android.provider.ContactsContract.PhoneLookup;
|
||||
import android.provider.ContactsContract.RawContacts;
|
||||
import android.provider.ContactsContract.CommonDataKinds.Email;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
@@ -55,7 +55,7 @@ public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
|
||||
static final private int TOKEN_PHONE_LOOKUP_AND_TRIGGER = 3;
|
||||
|
||||
static final String[] EMAIL_LOOKUP_PROJECTION = new String[] {
|
||||
RawContacts.CONTACT_ID,
|
||||
Data.CONTACT_ID,
|
||||
Contacts.LOOKUP_KEY,
|
||||
};
|
||||
static int EMAIL_ID_COLUMN_INDEX = 0;
|
||||
|
||||
Reference in New Issue
Block a user