summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/LegacyApiSupport.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2009-09-01 20:08:34 -0700
committerJeff Sharkey <jsharkey@android.com>2009-09-02 22:19:30 -0700
commit622e0a2f00b3de248926ec9e89b11a6425919819 (patch)
tree1236fc99ff4a3f175d060424e1c2a20c85cecbfd /src/com/android/providers/contacts/LegacyApiSupport.java
parentb3ce7aaa2390698c9424d17df4d2979dcd902cfd (diff)
downloadpackages_providers_ContactsProvider-622e0a2f00b3de248926ec9e89b11a6425919819.zip
packages_providers_ContactsProvider-622e0a2f00b3de248926ec9e89b11a6425919819.tar.gz
packages_providers_ContactsProvider-622e0a2f00b3de248926ec9e89b11a6425919819.tar.bz2
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.
Diffstat (limited to 'src/com/android/providers/contacts/LegacyApiSupport.java')
-rw-r--r--src/com/android/providers/contacts/LegacyApiSupport.java6
1 files changed, 4 insertions, 2 deletions
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 "