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

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

Merge "Don't set super primary name on compact editor unless it changes" into mnc-dev

parents df45ec90 c59de249
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -345,12 +345,9 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl
        if (isInsert) {
            // For inserts, prevent any changes from being saved when the base fragment is destroyed
            mStatus = Status.CLOSING;
        } else {
            // Prevent a Toast from being displayed as we transition to the full editor
            mShowToastAfterSave = false;

        } else if (hasPendingChanges()) {
            // Save whatever is in the form
            save(SaveMode.RELOAD, /* backPressed =*/ false);
            save(SaveMode.CLOSE, /* backPressed =*/ false);
        }

        // Prepare an Intent to start the expanded editor
+0 −7
Original line number Diff line number Diff line
@@ -174,13 +174,6 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O
    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.more_fields && mListener != null ) {
            // We mark the name that was displayed as super primary before expanding
            // so that a save on the expanded editor (without a name change) does not
            // cause the displayed name to change.
            if (mNameValuesDelta != null) {
                mNameValuesDelta.setSuperPrimary(true);
            }

            mListener.onExpandEditor();
        }
    }
+1 −5
Original line number Diff line number Diff line
@@ -373,10 +373,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
    // Used to pre-populate the editor with a display name when a user edits a read-only contact.
    protected String mDefaultDisplayName;

    // Whether to show a Toast message after saves have completed.
    // Does not affect successful toasts shown after joins, which are never displayed.
    protected boolean mShowToastAfterSave = true;

    /**
     * The contact data loader listener.
     */
@@ -1343,7 +1339,7 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
            Uri contactLookupUri, Bundle updatedPhotos, boolean backPressed, long photoId) {
        if (hadChanges) {
            if (saveSucceeded) {
                if (saveMode != SaveMode.JOIN && mShowToastAfterSave) {
                if (saveMode != SaveMode.JOIN) {
                    Toast.makeText(mContext, R.string.contactSavedToast, Toast.LENGTH_SHORT).show();
                }
            } else {