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

Commit 59976666 authored by kaiyiz's avatar kaiyiz Committed by Steve Kondik
Browse files

Contacts: Fix the "Remove photo" doesn't work issue

If popup shown, it will leak when contact editor fragment bind editors.
So it need dismiss with content view remove all views.

Dismiss the popup when context view remove all views.

CRs-Fixed: 537228

Change-Id: Id7ca52f2b7dc470b3c8b6f47ec46721cb05fbf4a
parent 87551107
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -216,6 +216,8 @@ public class ContactEditorFragment extends Fragment implements
     */
    private PhotoHandler mCurrentPhotoHandler;

    private PhotoHandler mBindPhotoHandler;

    private final EntityDeltaComparator mComparator = new EntityDeltaComparator();

    private Cursor mGroupMetaData;
@@ -790,6 +792,14 @@ public class ContactEditorFragment extends Fragment implements
        // Remove any existing editors and rebuild any visible
        mContent.removeAllViews();

        // If photoActionPopup shown, the popup will leak when contact editor
        // fragment bind editors. The popup need dismiss with content view
        // remove all views.
        if (mBindPhotoHandler != null) {
            mBindPhotoHandler.destroy();
            mBindPhotoHandler = null;
        }

        final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                Context.LAYOUT_INFLATER_SERVICE);
        final AccountTypeManager accountTypes = AccountTypeManager.getInstance(mContext);
@@ -939,6 +949,8 @@ public class ContactEditorFragment extends Fragment implements
        if (mRawContactIdRequestingPhoto == editor.getRawContactId()) {
            mCurrentPhotoHandler = photoHandler;
        }

        mBindPhotoHandler = photoHandler;
    }

    private void bindGroupMetaData() {