diff options
author | Brian Attwell <brianattwell@google.com> | 2014-08-26 21:46:20 -0700 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-08-26 21:52:21 -0700 |
commit | 78c550493787bc702a80f124c1eda067cffb9444 (patch) | |
tree | edb90e7dc70144c4bfc7e7f2af66c620f2fa4b67 /src/com/android/contacts/common/model/Contact.java | |
parent | e486de9f87e38d034efbebfa25fb3f496e66b7f8 (diff) | |
download | android_packages_apps_ContactsCommon-78c550493787bc702a80f124c1eda067cffb9444.tar.gz android_packages_apps_ContactsCommon-78c550493787bc702a80f124c1eda067cffb9444.tar.bz2 android_packages_apps_ContactsCommon-78c550493787bc702a80f124c1eda067cffb9444.zip |
ContactLoader always stores thumbnail blob
Bugle always uses Contact.PHOTO for color extraction. Therefore, in
order for Contacts' color extraction to match Bugles' color extraction
ContactLoader needs to include Contact.PHOTO regardless of whether a large
contact photo is available.
Previously, Contacts was downscaling the full sized image returned from
ContactsLoader. The resulting thumbnail was different enough from the thumbnails
synced by ContactSyncAdapter that about 20% of contact photos had different
extracted colors in Bugle and Contacts.
Bug: 17258486
Change-Id: Ib274da7bd6b6159a91beee0b2e35e0ffdfaab74a
Diffstat (limited to 'src/com/android/contacts/common/model/Contact.java')
-rw-r--r-- | src/com/android/contacts/common/model/Contact.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/model/Contact.java b/src/com/android/contacts/common/model/Contact.java index 74b5596d..9b96f861 100644 --- a/src/com/android/contacts/common/model/Contact.java +++ b/src/com/android/contacts/common/model/Contact.java @@ -85,6 +85,11 @@ public class Contact { private ImmutableList<GroupMetaData> mGroups; private byte[] mPhotoBinaryData; + /** + * Small version of the contact photo loaded from a blob instead of from a file. If a large + * contact photo is not available yet, then this has the same value as mPhotoBinaryData. + */ + private byte[] mThumbnailPhotoBinaryData; private final boolean mSendToVoicemail; private final String mCustomRingtone; private final boolean mIsUserProfile; @@ -218,6 +223,10 @@ public class Contact { mPhotoBinaryData = photoBinaryData; } + /* package */ void setThumbnailPhotoBinaryData(byte[] photoBinaryData) { + mThumbnailPhotoBinaryData = photoBinaryData; + } + /** * Returns the URI for the contact that contains both the lookup key and the ID. This is * the best URI to reference a contact. @@ -417,6 +426,10 @@ public class Contact { return mPhotoBinaryData; } + public byte[] getThumbnailPhotoBinaryData() { + return mThumbnailPhotoBinaryData; + } + public ArrayList<ContentValues> getContentValues() { if (mRawContacts.size() != 1) { throw new IllegalStateException( |