Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 726e838c authored by Daniel Lehmann's avatar Daniel Lehmann Committed by Android Git Automerger
Browse files

am 22d7142d: am 1b679754: am 58c9a4bc: Merge "Don\'t load photo if it\'s id is...

am 22d7142d: am 1b679754: am 58c9a4bc: Merge "Don\'t load photo if it\'s id is 0. Saves one database query Bug:2546767" into froyo
parents cdf67195 22d7142d
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -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 */);

                            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);