summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/aggregation
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2012-07-20 10:00:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-07-20 10:00:04 -0700
commit14a595d1d4b9e4616aa4f7a184f37b12e07049a2 (patch)
tree44255de54b5e7c7d313e4a19080857176ee12b39 /src/com/android/providers/contacts/aggregation
parentbcc85acf1b911a8a58c2411a103aa7d61d70d1a6 (diff)
parentd109b23736e4171d23356642bd5dbe28743341da (diff)
downloadpackages_providers_ContactsProvider-14a595d1d4b9e4616aa4f7a184f37b12e07049a2.zip
packages_providers_ContactsProvider-14a595d1d4b9e4616aa4f7a184f37b12e07049a2.tar.gz
packages_providers_ContactsProvider-14a595d1d4b9e4616aa4f7a184f37b12e07049a2.tar.bz2
am d109b237: am ff91ec35: Tolerate crashes during re-aggregation.
* commit 'd109b23736e4171d23356642bd5dbe28743341da': Tolerate crashes during re-aggregation.
Diffstat (limited to 'src/com/android/providers/contacts/aggregation')
-rw-r--r--src/com/android/providers/contacts/aggregation/util/ContactMatcher.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/aggregation/util/ContactMatcher.java b/src/com/android/providers/contacts/aggregation/util/ContactMatcher.java
index a29735d..2e552e9 100644
--- a/src/com/android/providers/contacts/aggregation/util/ContactMatcher.java
+++ b/src/com/android/providers/contacts/aggregation/util/ContactMatcher.java
@@ -18,6 +18,8 @@ package com.android.providers.contacts.aggregation.util;
import com.android.providers.contacts.ContactsDatabaseHelper.NameLookupType;
import com.android.providers.contacts.util.Hex;
+import android.util.Log;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -27,6 +29,7 @@ import java.util.List;
* Logic for matching contacts' data and accumulating match scores.
*/
public class ContactMatcher {
+ private static final String TAG = "ContactMatcher";
// Best possible match score
public static final int MAX_SCORE = 100;
@@ -296,8 +299,16 @@ public class ContactMatcher {
return;
}
- byte[] decodedCandidateName = Hex.decodeHex(candidateName);
- byte[] decodedName = Hex.decodeHex(name);
+ final byte[] decodedCandidateName;
+ final byte[] decodedName;
+ try {
+ decodedCandidateName = Hex.decodeHex(candidateName);
+ decodedName = Hex.decodeHex(name);
+ } catch (RuntimeException e) {
+ // How could this happen?? See bug 6827136
+ Log.e(TAG, "Failed to decode normalized name. Skipping.", e);
+ return;
+ }
NameDistance nameDistance = algorithm == MATCHING_ALGORITHM_CONSERVATIVE ?
mNameDistanceConservative : mNameDistanceApproximate;