From 622e0a2f00b3de248926ec9e89b11a6425919819 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 1 Sep 2009 20:08:34 -0700 Subject: Relaxed type and label checking, structured consistency. For CommonDataKinds rows, we strictly require that TYPE be set when LABEL appears. Previously we had enforced that LABEL could only exist under TYPE_CUSTOM, but this doesn't hold true for providers that want to allow additional TYPE values to have labels. This fixes http://b/2089080 and http://b/2065904 This change also helps maintain consistency between structured and unstructured fields for StructuredPostal and StructuredName. That is, when an update updates one without also updating the other, we provide the additional values required to keep them consistent. If the client specifies both sets, we let them pass through. Fixes http://b/2087358 Also adds unit tests, including fixing broken ones. --- src/com/android/providers/contacts/LegacyApiSupport.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/com/android/providers/contacts/LegacyApiSupport.java') diff --git a/src/com/android/providers/contacts/LegacyApiSupport.java b/src/com/android/providers/contacts/LegacyApiSupport.java index 6fe530e..74ec8e5 100644 --- a/src/com/android/providers/contacts/LegacyApiSupport.java +++ b/src/com/android/providers/contacts/LegacyApiSupport.java @@ -54,6 +54,7 @@ import android.provider.ContactsContract.CommonDataKinds.StructuredName; import android.provider.ContactsContract.CommonDataKinds.StructuredPostal; import java.util.HashMap; +import java.util.Locale; public class LegacyApiSupport implements OpenHelper.Delegate { @@ -452,8 +453,9 @@ public class LegacyApiSupport implements OpenHelper.Delegate { mGlobalSearchSupport = globalSearchSupport; mOpenHelper.setDelegate(this); - mPhoneticNameSplitter = new NameSplitter("", "", "", - context.getString(com.android.internal.R.string.common_name_conjunctions)); + mPhoneticNameSplitter = new NameSplitter("", "", "", context + .getString(com.android.internal.R.string.common_name_conjunctions), Locale + .getDefault()); SQLiteDatabase db = mOpenHelper.getReadableDatabase(); mLastTimeContactedUpdate = db.compileStatement("UPDATE " + Tables.RAW_CONTACTS + " SET " -- cgit v1.1