summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Lehmann <lehmannd@google.com>2012-02-06 21:26:32 -0800
committerMathew Inwood <mathewi@google.com>2012-02-10 11:44:11 +0000
commit57e70bb3e70f9fe9b2916696fae45e686f567592 (patch)
tree8b45269659594fd1e5650d22bedc36722cfe85b6 /src
parent85ff6534e410880d51b30a3ce362c0d3798375ca (diff)
downloadpackages_providers_ContactsProvider-57e70bb3e70f9fe9b2916696fae45e686f567592.zip
packages_providers_ContactsProvider-57e70bb3e70f9fe9b2916696fae45e686f567592.tar.gz
packages_providers_ContactsProvider-57e70bb3e70f9fe9b2916696fae45e686f567592.tar.bz2
Reset suggestion fields before reusing the object.
This avoids leaking data from one suggestion into the next for option attributes. Bug:5845926 Change-Id: I6c70cb042bf4b92c1e5fd80e8da96d625ef7f7db
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/contacts/GlobalSearchSupport.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/GlobalSearchSupport.java b/src/com/android/providers/contacts/GlobalSearchSupport.java
index 2acae60..70dbd31 100644
--- a/src/com/android/providers/contacts/GlobalSearchSupport.java
+++ b/src/com/android/providers/contacts/GlobalSearchSupport.java
@@ -174,6 +174,21 @@ public class GlobalSearchSupport {
private String buildUri() {
return Contacts.getLookupUri(contactId, lookupKey).toString();
}
+
+ public void reset() {
+ contactId = 0;
+ photoUri = null;
+ lookupKey = null;
+ presence = -1;
+ text1 = null;
+ text2 = null;
+ icon1 = null;
+ icon2 = null;
+ intentData = null;
+ intentAction = null;
+ filter = null;
+ lastAccessTime = null;
+ }
}
private final ContactsProvider2 mContactsProvider;
@@ -370,6 +385,7 @@ public class GlobalSearchSupport {
suggestion.text2 = shortenSnippet(c.getString(6));
}
cursor.addRow(suggestion.asList(projection));
+ suggestion.reset();
}
} finally {
c.close();