diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2011-05-31 19:46:06 -0700 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2011-05-31 19:47:16 -0700 |
commit | 65b8c0327b00beda9309c7b7c116013d03b06d90 (patch) | |
tree | b547601b7205d9a2372bf4005894ce027a4e18cd /chips/src/com/android/ex/chips/BaseRecipientAdapter.java | |
parent | b5ebb8916a1bb178062a0ccb59e80de27ec1bb2d (diff) | |
download | android_frameworks_ex-65b8c0327b00beda9309c7b7c116013d03b06d90.tar.gz android_frameworks_ex-65b8c0327b00beda9309c7b7c116013d03b06d90.tar.bz2 android_frameworks_ex-65b8c0327b00beda9309c7b7c116013d03b06d90.zip |
Use long for ids
Also optimize update method
Bug: 4443828
Change-Id: Ie51a3b40e0852cfab8f81c2a56cbc13f5072ad6c
Diffstat (limited to 'chips/src/com/android/ex/chips/BaseRecipientAdapter.java')
-rw-r--r-- | chips/src/com/android/ex/chips/BaseRecipientAdapter.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java index b90bf3c..939ff3c 100644 --- a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java +++ b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java @@ -283,7 +283,7 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter * mEntries are less than mPreferredMaxResultCount, contacts in * mNonAggregatedEntries are also used. */ - private final LinkedHashMap<Integer, List<RecipientEntry>> mEntryMap; + private final LinkedHashMap<Long, List<RecipientEntry>> mEntryMap; private final List<RecipientEntry> mNonAggregatedEntries; private final List<RecipientEntry> mEntries; private final Set<String> mExistingDestinations; @@ -315,7 +315,7 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter mInflater = LayoutInflater.from(context); mQueryType = queryType; mPreferredMaxResultCount = preferredMaxResultCount; - mEntryMap = new LinkedHashMap<Integer, List<RecipientEntry>>(); + mEntryMap = new LinkedHashMap<Long, List<RecipientEntry>>(); mNonAggregatedEntries = new ArrayList<RecipientEntry>(); mEntries = new ArrayList<RecipientEntry>(); mExistingDestinations = new HashSet<String>(); @@ -486,20 +486,20 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter while (cursor.moveToNext()) { final String displayName; final String destination; - final int contactId; - final int dataId; + final long contactId; + final long dataId; final String thumbnailUriString; if (mQueryType == QUERY_TYPE_EMAIL) { displayName = cursor.getString(EmailQuery.NAME); destination = cursor.getString(EmailQuery.ADDRESS); - contactId = cursor.getInt(EmailQuery.CONTACT_ID); - dataId = cursor.getInt(EmailQuery.DATA_ID); + contactId = cursor.getLong(EmailQuery.CONTACT_ID); + dataId = cursor.getLong(EmailQuery.DATA_ID); thumbnailUriString = cursor.getString(EmailQuery.PHOTO_THUMBNAIL_URI); } else if (mQueryType == QUERY_TYPE_PHONE) { displayName = cursor.getString(PhoneQuery.NAME); destination = cursor.getString(PhoneQuery.NUMBER); - contactId = cursor.getInt(PhoneQuery.CONTACT_ID); - dataId = cursor.getInt(PhoneQuery.DATA_ID); + contactId = cursor.getLong(PhoneQuery.CONTACT_ID); + dataId = cursor.getLong(PhoneQuery.DATA_ID); thumbnailUriString = cursor.getString(PhoneQuery.PHOTO_THUMBNAIL_URI); } else { throw new IndexOutOfBoundsException("Unexpected query type: " + mQueryType); @@ -539,7 +539,7 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter private void constructEntryList() { mEntries.clear(); int validEntryCount = 0; - for (Map.Entry<Integer, List<RecipientEntry>> mapEntry : mEntryMap.entrySet()) { + for (Map.Entry<Long, List<RecipientEntry>> mapEntry : mEntryMap.entrySet()) { final List<RecipientEntry> entryList = mapEntry.getValue(); final int size = entryList.size(); for (int i = 0; i < size; i++) { |