summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2015-11-11 13:48:39 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-07 13:34:41 -0700
commitd6942db8a9887c506fb680afa62bdd168a550434 (patch)
tree5223391b6d9c3f99cd4256421828620fcb4a885c
parent22eeaf50aa43112156d11b665857cc867d21ae63 (diff)
downloadpackages_providers_ContactsProvider-d6942db8a9887c506fb680afa62bdd168a550434.zip
packages_providers_ContactsProvider-d6942db8a9887c506fb680afa62bdd168a550434.tar.gz
packages_providers_ContactsProvider-d6942db8a9887c506fb680afa62bdd168a550434.tar.bz2
ContactsProvider: Join raw_contacts and data on the proper ID
For some reason, we selected the wrong ID to join these tables on. contact_id may be completely different from the raw_contact_id in data. Change-Id: Idd067a90a67a126b22f7bb0281c69e93ad6bed10
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 31d3764..143f6b6 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -5339,7 +5339,8 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
// Todo: make more performant
sb.append(Tables.RAW_CONTACTS +
" JOIN " + Views.DATA + " data_view ON (data_view.raw_contact_id = "
- + Tables.RAW_CONTACTS + ".contact_id) WHERE data1 = '" + lookupData + "'");
+ + Tables.RAW_CONTACTS + "._id) WHERE data1 = ");
+ DatabaseUtils.appendEscapedSQLString(sb, lookupData);
}
private void appendPhoneLookupSelection(StringBuilder sb, String number, String numberE164) {