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

Commit fc0a90d5 authored by Walter Jang's avatar Walter Jang Committed by Android (Google) Code Review
Browse files

Merge "Put back setting photo" into ub-contactsdialer-a-dev

parents 45b86d5e 4c9cf3ae
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -527,6 +527,22 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O
            mPhotoValuesDelta.setSuperPrimary(true);
        }

        // Even though high-res photos cannot be saved by passing them via
        // an EntityDeltaList (since they cause the Bundle size limit to be
        // exceeded), we still pass a low-res thumbnail. This simplifies
        // code all over the place, because we don't have to test whether
        // there is a change in EITHER the delta-list OR a changed photo...
        // this way, there is always a change in the delta-list.
        try {
            final byte[] bytes = EditorUiUtils.getCompressedThumbnailBitmapBytes(
                    getContext(), photoUri);
            if (bytes != null) {
                mPhotoValuesDelta.setPhoto(bytes);
            }
        } catch (FileNotFoundException e) {
            elog("Failed to get bitmap from photo Uri");
        }

        mPhotoView.setFullSizedPhoto(photoUri);
    }