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

Commit f5d37174 authored by Chiao Cheng's avatar Chiao Cheng Committed by Android (Google) Code Review
Browse files

Merge "Minor changes to validateAction()." into jb-mr1.1-dev

parents 3603b6cf e8e94423
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -118,9 +118,6 @@ public class ContactEditorFragment extends Fragment implements
    private static final String KEY_IS_USER_PROFILE = "isUserProfile";
    private static final String KEY_UPDATED_PHOTOS = "updatedPhotos";

    private static final String[] VALID_ACTIONS = {Intent.ACTION_EDIT, Intent.ACTION_INSERT,
            ContactEditorActivity.ACTION_SAVE_COMPLETED};

    public static final String SAVE_MODE_EXTRA_KEY = "saveMode";


@@ -405,13 +402,13 @@ public class ContactEditorFragment extends Fragment implements
     * @throws IllegalArgumentException when the action is invalid.
     */
    private void validateAction(String action) {
        for (String validAction : VALID_ACTIONS) {
            if (validAction.equals(action)) {
        if (Intent.ACTION_EDIT.equals(action) || Intent.ACTION_INSERT.equals(action) ||
                ContactEditorActivity.ACTION_SAVE_COMPLETED.equals(action)) {
            return;
        }
        }
        throw new IllegalArgumentException("Unknown Action String " + mAction +
                ". Only support " + Intent.ACTION_EDIT + " or " + Intent.ACTION_INSERT);
                ". Only support " + Intent.ACTION_EDIT + " or " + Intent.ACTION_INSERT + " or " +
                ContactEditorActivity.ACTION_SAVE_COMPLETED);
    }

    @Override