summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitri Plotnikov <dplotnikov@google.com>2011-02-25 11:23:42 -0800
committerDmitri Plotnikov <dplotnikov@google.com>2011-02-25 11:23:42 -0800
commit8ab0b7a48efe540226253567bcf6fdbc487186a2 (patch)
tree026d206e1aca3598bb3cd5451f6701c93014dd0e /src
parentdadaeebb6ff4845c5cad1c294fca669e7ac446ee (diff)
downloadpackages_providers_ContactsProvider-8ab0b7a48efe540226253567bcf6fdbc487186a2.zip
packages_providers_ContactsProvider-8ab0b7a48efe540226253567bcf6fdbc487186a2.tar.gz
packages_providers_ContactsProvider-8ab0b7a48efe540226253567bcf6fdbc487186a2.tar.bz2
Moving updateRawContactDisplayName from aggregator to dbhelper
This is done in preparation for a fix of Bug: 3488074 Change-Id: I0456a6925a76a4974d7a76ab4dce326f5637d871
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/contacts/ContactAggregator.java194
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java205
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java4
-rw-r--r--src/com/android/providers/contacts/DataRowHandler.java2
-rw-r--r--src/com/android/providers/contacts/LegacyContactImporter.java2
5 files changed, 207 insertions, 200 deletions
diff --git a/src/com/android/providers/contacts/ContactAggregator.java b/src/com/android/providers/contacts/ContactAggregator.java
index 088b2e9..f5fe581 100644
--- a/src/com/android/providers/contacts/ContactAggregator.java
+++ b/src/com/android/providers/contacts/ContactAggregator.java
@@ -29,7 +29,6 @@ import com.android.providers.contacts.ContactsDatabaseHelper.StatusUpdatesColumn
import com.android.providers.contacts.ContactsDatabaseHelper.Tables;
import android.content.ContentValues;
-import android.database.CharArrayBuffer;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
@@ -38,7 +37,6 @@ import android.database.sqlite.SQLiteStatement;
import android.net.Uri;
import android.provider.ContactsContract.AggregationExceptions;
import android.provider.ContactsContract.CommonDataKinds.Email;
-import android.provider.ContactsContract.CommonDataKinds.Organization;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.CommonDataKinds.Photo;
import android.provider.ContactsContract.Contacts;
@@ -46,7 +44,6 @@ import android.provider.ContactsContract.Contacts.AggregationSuggestions;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.DisplayNameSources;
import android.provider.ContactsContract.FullNameStyle;
-import android.provider.ContactsContract.PhoneticNameStyle;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.StatusUpdates;
import android.text.TextUtils;
@@ -159,8 +156,6 @@ public class ContactAggregator {
private ContactMatcher mMatcher = new ContactMatcher();
private ContentValues mValues = new ContentValues();
private DisplayNameCandidate mDisplayNameCandidate = new DisplayNameCandidate();
- private NameSplitter.Name mName = new NameSplitter.Name();
- private CharArrayBuffer mCharArrayBuffer = new CharArrayBuffer(128);
/**
* Parameter for the suggestion lookup query.
@@ -1875,195 +1870,6 @@ public class ContactAggregator {
}
}
- private interface RawContactNameQuery {
- public static final String RAW_SQL =
- "SELECT "
- + DataColumns.MIMETYPE_ID + ","
- + Data.IS_PRIMARY + ","
- + Data.DATA1 + ","
- + Data.DATA2 + ","
- + Data.DATA3 + ","
- + Data.DATA4 + ","
- + Data.DATA5 + ","
- + Data.DATA6 + ","
- + Data.DATA7 + ","
- + Data.DATA8 + ","
- + Data.DATA9 + ","
- + Data.DATA10 + ","
- + Data.DATA11 +
- " FROM " + Tables.DATA +
- " WHERE " + Data.RAW_CONTACT_ID + "=?" +
- " AND (" + Data.DATA1 + " NOT NULL OR " +
- Organization.TITLE + " NOT NULL)";
-
- public static final int MIMETYPE = 0;
- public static final int IS_PRIMARY = 1;
- public static final int DATA1 = 2;
- public static final int GIVEN_NAME = 3; // data2
- public static final int FAMILY_NAME = 4; // data3
- public static final int PREFIX = 5; // data4
- public static final int TITLE = 5; // data4
- public static final int MIDDLE_NAME = 6; // data5
- public static final int SUFFIX = 7; // data6
- public static final int PHONETIC_GIVEN_NAME = 8; // data7
- public static final int PHONETIC_MIDDLE_NAME = 9; // data8
- public static final int ORGANIZATION_PHONETIC_NAME = 9; // data8
- public static final int PHONETIC_FAMILY_NAME = 10; // data9
- public static final int FULL_NAME_STYLE = 11; // data10
- public static final int ORGANIZATION_PHONETIC_NAME_STYLE = 11; // data10
- public static final int PHONETIC_NAME_STYLE = 12; // data11
- }
-
- /**
- * Updates a raw contact display name based on data rows, e.g. structured name,
- * organization, email etc.
- */
- public void updateRawContactDisplayName(SQLiteDatabase db, long rawContactId) {
- int bestDisplayNameSource = DisplayNameSources.UNDEFINED;
- NameSplitter.Name bestName = null;
- String bestDisplayName = null;
- String bestPhoneticName = null;
- int bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
-
- mSelectionArgs1[0] = String.valueOf(rawContactId);
- Cursor c = db.rawQuery(RawContactNameQuery.RAW_SQL, mSelectionArgs1);
- try {
- while (c.moveToNext()) {
- int mimeType = c.getInt(RawContactNameQuery.MIMETYPE);
- int source = mDbHelper.getDisplayNameSourceForMimeTypeId(mimeType);
- if (source < bestDisplayNameSource || source == DisplayNameSources.UNDEFINED) {
- continue;
- }
-
- if (source == bestDisplayNameSource
- && c.getInt(RawContactNameQuery.IS_PRIMARY) == 0) {
- continue;
- }
-
- if (mimeType == mDbHelper.getMimeTypeIdForStructuredName()) {
- NameSplitter.Name name;
- if (bestName != null) {
- name = new NameSplitter.Name();
- } else {
- name = mName;
- name.clear();
- }
- name.prefix = c.getString(RawContactNameQuery.PREFIX);
- name.givenNames = c.getString(RawContactNameQuery.GIVEN_NAME);
- name.middleName = c.getString(RawContactNameQuery.MIDDLE_NAME);
- name.familyName = c.getString(RawContactNameQuery.FAMILY_NAME);
- name.suffix = c.getString(RawContactNameQuery.SUFFIX);
- name.fullNameStyle = c.isNull(RawContactNameQuery.FULL_NAME_STYLE)
- ? FullNameStyle.UNDEFINED
- : c.getInt(RawContactNameQuery.FULL_NAME_STYLE);
- name.phoneticFamilyName = c.getString(RawContactNameQuery.PHONETIC_FAMILY_NAME);
- name.phoneticMiddleName = c.getString(RawContactNameQuery.PHONETIC_MIDDLE_NAME);
- name.phoneticGivenName = c.getString(RawContactNameQuery.PHONETIC_GIVEN_NAME);
- name.phoneticNameStyle = c.isNull(RawContactNameQuery.PHONETIC_NAME_STYLE)
- ? PhoneticNameStyle.UNDEFINED
- : c.getInt(RawContactNameQuery.PHONETIC_NAME_STYLE);
- if (!name.isEmpty()) {
- bestDisplayNameSource = source;
- bestName = name;
- }
- } else if (mimeType == mDbHelper.getMimeTypeIdForOrganization()) {
- mCharArrayBuffer.sizeCopied = 0;
- c.copyStringToBuffer(RawContactNameQuery.DATA1, mCharArrayBuffer);
- if (mCharArrayBuffer.sizeCopied != 0) {
- bestDisplayNameSource = source;
- bestDisplayName = new String(mCharArrayBuffer.data, 0,
- mCharArrayBuffer.sizeCopied);
- bestPhoneticName = c.getString(
- RawContactNameQuery.ORGANIZATION_PHONETIC_NAME);
- bestPhoneticNameStyle =
- c.isNull(RawContactNameQuery.ORGANIZATION_PHONETIC_NAME_STYLE)
- ? PhoneticNameStyle.UNDEFINED
- : c.getInt(RawContactNameQuery.ORGANIZATION_PHONETIC_NAME_STYLE);
- } else {
- c.copyStringToBuffer(RawContactNameQuery.TITLE, mCharArrayBuffer);
- if (mCharArrayBuffer.sizeCopied != 0) {
- bestDisplayNameSource = source;
- bestDisplayName = new String(mCharArrayBuffer.data, 0,
- mCharArrayBuffer.sizeCopied);
- bestPhoneticName = null;
- bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
- }
- }
- } else {
- // Display name is at DATA1 in all other types.
- // This is ensured in the constructor.
-
- mCharArrayBuffer.sizeCopied = 0;
- c.copyStringToBuffer(RawContactNameQuery.DATA1, mCharArrayBuffer);
- if (mCharArrayBuffer.sizeCopied != 0) {
- bestDisplayNameSource = source;
- bestDisplayName = new String(mCharArrayBuffer.data, 0,
- mCharArrayBuffer.sizeCopied);
- bestPhoneticName = null;
- bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
- }
- }
- }
-
- } finally {
- c.close();
- }
-
- String displayNamePrimary;
- String displayNameAlternative;
- String sortKeyPrimary = null;
- String sortKeyAlternative = null;
- int displayNameStyle = FullNameStyle.UNDEFINED;
-
- if (bestDisplayNameSource == DisplayNameSources.STRUCTURED_NAME) {
- displayNameStyle = bestName.fullNameStyle;
- if (displayNameStyle == FullNameStyle.CJK
- || displayNameStyle == FullNameStyle.UNDEFINED) {
- displayNameStyle = mNameSplitter.getAdjustedFullNameStyle(displayNameStyle);
- bestName.fullNameStyle = displayNameStyle;
- }
-
- displayNamePrimary = mNameSplitter.join(bestName, true);
- displayNameAlternative = mNameSplitter.join(bestName, false);
-
- bestPhoneticName = mNameSplitter.joinPhoneticName(bestName);
- bestPhoneticNameStyle = bestName.phoneticNameStyle;
- } else {
- displayNamePrimary = displayNameAlternative = bestDisplayName;
- }
-
- if (bestPhoneticName != null) {
- sortKeyPrimary = sortKeyAlternative = bestPhoneticName;
- if (bestPhoneticNameStyle == PhoneticNameStyle.UNDEFINED) {
- bestPhoneticNameStyle = mNameSplitter.guessPhoneticNameStyle(bestPhoneticName);
- }
- } else {
- if (displayNameStyle == FullNameStyle.UNDEFINED) {
- displayNameStyle = mNameSplitter.guessFullNameStyle(bestDisplayName);
- if (displayNameStyle == FullNameStyle.UNDEFINED
- || displayNameStyle == FullNameStyle.CJK) {
- displayNameStyle = mNameSplitter.getAdjustedNameStyleBasedOnPhoneticNameStyle(
- displayNameStyle, bestPhoneticNameStyle);
- }
- displayNameStyle = mNameSplitter.getAdjustedFullNameStyle(displayNameStyle);
- }
- if (displayNameStyle == FullNameStyle.CHINESE ||
- displayNameStyle == FullNameStyle.CJK) {
- sortKeyPrimary = sortKeyAlternative =
- ContactLocaleUtils.getIntance().getSortKey(
- displayNamePrimary, displayNameStyle);
- }
- }
-
- if (sortKeyPrimary == null) {
- sortKeyPrimary = displayNamePrimary;
- sortKeyAlternative = displayNameAlternative;
- }
-
- mDbHelper.setDisplayName(rawContactId, bestDisplayNameSource, displayNamePrimary,
- displayNameAlternative, bestPhoneticName, bestPhoneticNameStyle,
- sortKeyPrimary, sortKeyAlternative);
- }
/**
* Updates the {@link Contacts#HAS_PHONE_NUMBER} flag for the aggregate contact containing the
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index a8c585d..f9622ab 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -25,6 +25,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
+import android.database.CharArrayBuffer;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.SQLException;
@@ -59,6 +60,7 @@ import android.provider.ContactsContract.Directory;
import android.provider.ContactsContract.DisplayNameSources;
import android.provider.ContactsContract.FullNameStyle;
import android.provider.ContactsContract.Groups;
+import android.provider.ContactsContract.PhoneticNameStyle;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.Settings;
import android.provider.ContactsContract.StatusUpdates;
@@ -548,6 +550,10 @@ import java.util.Locale;
*/
private String[] mUnrestrictedPackages;
+ private String[] mSelectionArgs1 = new String[1];
+ private NameSplitter.Name mName = new NameSplitter.Name();
+ private CharArrayBuffer mCharArrayBuffer = new CharArrayBuffer(128);
+ private NameSplitter mNameSplitter;
public static synchronized ContactsDatabaseHelper getInstance(Context context) {
if (sSingleton == null) {
@@ -2416,7 +2422,7 @@ import java.util.Locale;
try {
while (cursor.moveToNext()) {
long rawContactId = cursor.getLong(0);
- provider.updateRawContactDisplayName(db, rawContactId);
+ updateRawContactDisplayName(db, rawContactId);
}
} finally {
cursor.close();
@@ -2969,12 +2975,13 @@ import java.util.Locale;
}
public NameSplitter createNameSplitter() {
- return new NameSplitter(
+ mNameSplitter = new NameSplitter(
mContext.getString(com.android.internal.R.string.common_name_prefixes),
mContext.getString(com.android.internal.R.string.common_last_name_prefixes),
mContext.getString(com.android.internal.R.string.common_name_suffixes),
mContext.getString(com.android.internal.R.string.common_name_conjunctions),
Locale.getDefault());
+ return mNameSplitter;
}
/**
@@ -3763,6 +3770,200 @@ import java.util.Locale;
mResetNameVerifiedForOtherRawContacts.execute();
}
+ private interface RawContactNameQuery {
+ public static final String RAW_SQL =
+ "SELECT "
+ + DataColumns.MIMETYPE_ID + ","
+ + Data.IS_PRIMARY + ","
+ + Data.DATA1 + ","
+ + Data.DATA2 + ","
+ + Data.DATA3 + ","
+ + Data.DATA4 + ","
+ + Data.DATA5 + ","
+ + Data.DATA6 + ","
+ + Data.DATA7 + ","
+ + Data.DATA8 + ","
+ + Data.DATA9 + ","
+ + Data.DATA10 + ","
+ + Data.DATA11 +
+ " FROM " + Tables.DATA +
+ " WHERE " + Data.RAW_CONTACT_ID + "=?" +
+ " AND (" + Data.DATA1 + " NOT NULL OR " +
+ Organization.TITLE + " NOT NULL)";
+
+ public static final int MIMETYPE = 0;
+ public static final int IS_PRIMARY = 1;
+ public static final int DATA1 = 2;
+ public static final int GIVEN_NAME = 3; // data2
+ public static final int FAMILY_NAME = 4; // data3
+ public static final int PREFIX = 5; // data4
+ public static final int TITLE = 5; // data4
+ public static final int MIDDLE_NAME = 6; // data5
+ public static final int SUFFIX = 7; // data6
+ public static final int PHONETIC_GIVEN_NAME = 8; // data7
+ public static final int PHONETIC_MIDDLE_NAME = 9; // data8
+ public static final int ORGANIZATION_PHONETIC_NAME = 9; // data8
+ public static final int PHONETIC_FAMILY_NAME = 10; // data9
+ public static final int FULL_NAME_STYLE = 11; // data10
+ public static final int ORGANIZATION_PHONETIC_NAME_STYLE = 11; // data10
+ public static final int PHONETIC_NAME_STYLE = 12; // data11
+ }
+
+ /**
+ * Updates a raw contact display name based on data rows, e.g. structured name,
+ * organization, email etc.
+ */
+ public void updateRawContactDisplayName(SQLiteDatabase db, long rawContactId) {
+ if (mNameSplitter == null) {
+ createNameSplitter();
+ }
+
+ int bestDisplayNameSource = DisplayNameSources.UNDEFINED;
+ NameSplitter.Name bestName = null;
+ String bestDisplayName = null;
+ String bestPhoneticName = null;
+ int bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
+
+ mSelectionArgs1[0] = String.valueOf(rawContactId);
+ Cursor c = db.rawQuery(RawContactNameQuery.RAW_SQL, mSelectionArgs1);
+ try {
+ while (c.moveToNext()) {
+ int mimeType = c.getInt(RawContactNameQuery.MIMETYPE);
+ int source = getDisplayNameSourceForMimeTypeId(mimeType);
+ if (source < bestDisplayNameSource || source == DisplayNameSources.UNDEFINED) {
+ continue;
+ }
+
+ if (source == bestDisplayNameSource
+ && c.getInt(RawContactNameQuery.IS_PRIMARY) == 0) {
+ continue;
+ }
+
+ if (mimeType == getMimeTypeIdForStructuredName()) {
+ NameSplitter.Name name;
+ if (bestName != null) {
+ name = new NameSplitter.Name();
+ } else {
+ name = mName;
+ name.clear();
+ }
+ name.prefix = c.getString(RawContactNameQuery.PREFIX);
+ name.givenNames = c.getString(RawContactNameQuery.GIVEN_NAME);
+ name.middleName = c.getString(RawContactNameQuery.MIDDLE_NAME);
+ name.familyName = c.getString(RawContactNameQuery.FAMILY_NAME);
+ name.suffix = c.getString(RawContactNameQuery.SUFFIX);
+ name.fullNameStyle = c.isNull(RawContactNameQuery.FULL_NAME_STYLE)
+ ? FullNameStyle.UNDEFINED
+ : c.getInt(RawContactNameQuery.FULL_NAME_STYLE);
+ name.phoneticFamilyName = c.getString(RawContactNameQuery.PHONETIC_FAMILY_NAME);
+ name.phoneticMiddleName = c.getString(RawContactNameQuery.PHONETIC_MIDDLE_NAME);
+ name.phoneticGivenName = c.getString(RawContactNameQuery.PHONETIC_GIVEN_NAME);
+ name.phoneticNameStyle = c.isNull(RawContactNameQuery.PHONETIC_NAME_STYLE)
+ ? PhoneticNameStyle.UNDEFINED
+ : c.getInt(RawContactNameQuery.PHONETIC_NAME_STYLE);
+ if (!name.isEmpty()) {
+ bestDisplayNameSource = source;
+ bestName = name;
+ }
+ } else if (mimeType == getMimeTypeIdForOrganization()) {
+ mCharArrayBuffer.sizeCopied = 0;
+ c.copyStringToBuffer(RawContactNameQuery.DATA1, mCharArrayBuffer);
+ if (mCharArrayBuffer.sizeCopied != 0) {
+ bestDisplayNameSource = source;
+ bestDisplayName = new String(mCharArrayBuffer.data, 0,
+ mCharArrayBuffer.sizeCopied);
+ bestPhoneticName = c.getString(
+ RawContactNameQuery.ORGANIZATION_PHONETIC_NAME);
+ bestPhoneticNameStyle =
+ c.isNull(RawContactNameQuery.ORGANIZATION_PHONETIC_NAME_STYLE)
+ ? PhoneticNameStyle.UNDEFINED
+ : c.getInt(RawContactNameQuery.ORGANIZATION_PHONETIC_NAME_STYLE);
+ } else {
+ c.copyStringToBuffer(RawContactNameQuery.TITLE, mCharArrayBuffer);
+ if (mCharArrayBuffer.sizeCopied != 0) {
+ bestDisplayNameSource = source;
+ bestDisplayName = new String(mCharArrayBuffer.data, 0,
+ mCharArrayBuffer.sizeCopied);
+ bestPhoneticName = null;
+ bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
+ }
+ }
+ } else {
+ // Display name is at DATA1 in all other types.
+ // This is ensured in the constructor.
+
+ mCharArrayBuffer.sizeCopied = 0;
+ c.copyStringToBuffer(RawContactNameQuery.DATA1, mCharArrayBuffer);
+ if (mCharArrayBuffer.sizeCopied != 0) {
+ bestDisplayNameSource = source;
+ bestDisplayName = new String(mCharArrayBuffer.data, 0,
+ mCharArrayBuffer.sizeCopied);
+ bestPhoneticName = null;
+ bestPhoneticNameStyle = PhoneticNameStyle.UNDEFINED;
+ }
+ }
+ }
+
+ } finally {
+ c.close();
+ }
+
+ String displayNamePrimary;
+ String displayNameAlternative;
+ String sortKeyPrimary = null;
+ String sortKeyAlternative = null;
+ int displayNameStyle = FullNameStyle.UNDEFINED;
+
+ if (bestDisplayNameSource == DisplayNameSources.STRUCTURED_NAME) {
+ displayNameStyle = bestName.fullNameStyle;
+ if (displayNameStyle == FullNameStyle.CJK
+ || displayNameStyle == FullNameStyle.UNDEFINED) {
+ displayNameStyle = mNameSplitter.getAdjustedFullNameStyle(displayNameStyle);
+ bestName.fullNameStyle = displayNameStyle;
+ }
+
+ displayNamePrimary = mNameSplitter.join(bestName, true);
+ displayNameAlternative = mNameSplitter.join(bestName, false);
+
+ bestPhoneticName = mNameSplitter.joinPhoneticName(bestName);
+ bestPhoneticNameStyle = bestName.phoneticNameStyle;
+ } else {
+ displayNamePrimary = displayNameAlternative = bestDisplayName;
+ }
+
+ if (bestPhoneticName != null) {
+ sortKeyPrimary = sortKeyAlternative = bestPhoneticName;
+ if (bestPhoneticNameStyle == PhoneticNameStyle.UNDEFINED) {
+ bestPhoneticNameStyle = mNameSplitter.guessPhoneticNameStyle(bestPhoneticName);
+ }
+ } else {
+ if (displayNameStyle == FullNameStyle.UNDEFINED) {
+ displayNameStyle = mNameSplitter.guessFullNameStyle(bestDisplayName);
+ if (displayNameStyle == FullNameStyle.UNDEFINED
+ || displayNameStyle == FullNameStyle.CJK) {
+ displayNameStyle = mNameSplitter.getAdjustedNameStyleBasedOnPhoneticNameStyle(
+ displayNameStyle, bestPhoneticNameStyle);
+ }
+ displayNameStyle = mNameSplitter.getAdjustedFullNameStyle(displayNameStyle);
+ }
+ if (displayNameStyle == FullNameStyle.CHINESE ||
+ displayNameStyle == FullNameStyle.CJK) {
+ sortKeyPrimary = sortKeyAlternative =
+ ContactLocaleUtils.getIntance().getSortKey(
+ displayNamePrimary, displayNameStyle);
+ }
+ }
+
+ if (sortKeyPrimary == null) {
+ sortKeyPrimary = displayNamePrimary;
+ sortKeyAlternative = displayNameAlternative;
+ }
+
+ setDisplayName(rawContactId, bestDisplayNameSource, displayNamePrimary,
+ displayNameAlternative, bestPhoneticName, bestPhoneticNameStyle,
+ sortKeyPrimary, sortKeyAlternative);
+ }
+
public void setDisplayName(long rawContactId, int displayNameSource,
String displayNamePrimary, String displayNameAlternative, String phoneticName,
int phoneticNameStyle, String sortKeyPrimary, String sortKeyAlternative) {
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index d15d09a..4de1d13 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -1498,7 +1498,7 @@ public class ContactsProvider2 extends SQLiteContentProvider implements OnAccoun
}
for (long rawContactId : mTransactionContext.getInsertedRawContactIds()) {
- mContactAggregator.updateRawContactDisplayName(mDb, rawContactId);
+ mDbHelper.updateRawContactDisplayName(mDb, rawContactId);
mContactAggregator.onRawContactInsert(mTransactionContext, mDb, rawContactId);
}
@@ -1849,7 +1849,7 @@ public class ContactsProvider2 extends SQLiteContentProvider implements OnAccoun
}
public void updateRawContactDisplayName(SQLiteDatabase db, long rawContactId) {
- mContactAggregator.updateRawContactDisplayName(db, rawContactId);
+ mDbHelper.updateRawContactDisplayName(db, rawContactId);
}
/**
diff --git a/src/com/android/providers/contacts/DataRowHandler.java b/src/com/android/providers/contacts/DataRowHandler.java
index 667329b..32e6954 100644
--- a/src/com/android/providers/contacts/DataRowHandler.java
+++ b/src/com/android/providers/contacts/DataRowHandler.java
@@ -303,7 +303,7 @@ public abstract class DataRowHandler {
protected void fixRawContactDisplayName(SQLiteDatabase db, TransactionContext txContext,
long rawContactId) {
if (!isNewRawContact(txContext, rawContactId)) {
- mContactAggregator.updateRawContactDisplayName(db, rawContactId);
+ mDbHelper.updateRawContactDisplayName(db, rawContactId);
mContactAggregator.updateDisplayNameForRawContact(db, rawContactId);
}
}
diff --git a/src/com/android/providers/contacts/LegacyContactImporter.java b/src/com/android/providers/contacts/LegacyContactImporter.java
index 73d8cde..2f6c363 100644
--- a/src/com/android/providers/contacts/LegacyContactImporter.java
+++ b/src/com/android/providers/contacts/LegacyContactImporter.java
@@ -1218,7 +1218,7 @@ public class LegacyContactImporter {
try {
while (cursor.moveToNext()) {
long rawContactId = cursor.getLong(0);
- mContactsProvider.updateRawContactDisplayName(mTargetDb, rawContactId);
+ mDbHelper.updateRawContactDisplayName(mTargetDb, rawContactId);
mContactsProvider.updateLookupKeyForRawContact(mTargetDb, rawContactId);
}
} finally {