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

Commit 22417833 authored by Walter Jang's avatar Walter Jang
Browse files

Allow split of aggregate contact composed of >1 read-only contacts

Bug 22382957

Change-Id: I33f22a5ba9c55fe722601b54cecc59a173d6940b
parent 551df337
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -770,9 +770,15 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
            deleteMenu.setVisible(false);
        } else if (isEdit(mAction)) {
            HelpUtils.prepareHelpMenuItem(mContext, helpMenu, R.string.help_url_people_edit);
            // Split only if there is more than one raw (non-user profile) contact and doing so
            // won't result in an empty contact
            splitMenu.setVisible(mState.size() > 1 && !isEditingUserProfile() && !mHasNewContact);
            // Split only if there is more than one raw contact, it is not a user-profile, and
            // splitting won't result in an empty contact. For the empty contact case, we only guard
            // against this when there is a single read-only contact in the aggregate.  If the user
            // has joined >1 read-only contacts together, we allow them to split it,
            // even if they have never added their own information and splitting will create a
            // name only contact.
            final boolean isSingleReadOnlyContact = mHasNewContact && mState.size() == 2;
            splitMenu.setVisible(mState.size() > 1 && !isEditingUserProfile()
                    && !isSingleReadOnlyContact);
            // Cannot join a user profile
            joinMenu.setVisible(!isEditingUserProfile());
            deleteMenu.setVisible(!mDisableDeleteMenuOption);