am 1b679754: am 58c9a4bc: Merge "Don\'t load photo if it\'s id is 0. Saves one database query Bug:2546767" into froyo

Merge commit '1b679754b6f6fd5da8f5fc48415cad65cc8f3a56' into kraken

* commit '1b679754b6f6fd5da8f5fc48415cad65cc8f3a56':
  Don't load photo if it's id is 0. Saves one database query
This commit is contained in:
Daniel Lehmann
2010-03-30 17:05:42 -07:00
committed by Android Git Automerger

View File

@@ -269,9 +269,19 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
bindContactInfo(cursor);
Uri lookupUri = Contacts.getLookupUri(cursor.getLong(ContactQuery._ID),
cursor.getString(ContactQuery.LOOKUP_KEY));
startPhotoQuery(cursor.getLong(ContactQuery.PHOTO_ID),
lookupUri, false /* don't reset query handler */);
invalidate();
final long photoId = cursor.getLong(ContactQuery.PHOTO_ID);
if (photoId == 0) {
mPhotoView.setImageBitmap(loadPlaceholderPhoto(null));
if (cookie != null && cookie instanceof Uri) {
mPhotoView.assignContactUri((Uri) cookie);
}
invalidate();
} else {
startPhotoQuery(photoId, lookupUri,
false /* don't reset query handler */);
}
} else {
// shouldn't really happen
setDisplayName(null, null);