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

Commit 5af45baf authored by Walter Jang's avatar Walter Jang Committed by Android Git Automerger
Browse files

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

* commit '22417833':
  Allow split of aggregate contact composed of >1 read-only contacts
parents de226dc7 22417833
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);