From 57e70bb3e70f9fe9b2916696fae45e686f567592 Mon Sep 17 00:00:00 2001 From: Daniel Lehmann Date: Mon, 6 Feb 2012 21:26:32 -0800 Subject: 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 --- .../android/providers/contacts/GlobalSearchSupport.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') 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(); -- cgit v1.1