am 1cd2c24a: am f5d37174: Merge "Minor changes to validateAction()." into jb-mr1.1-dev
* commit '1cd2c24a772cc5ac1fc4ef5c3e7c173996cf3217':
Minor changes to validateAction().
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index e29e488..028c01f 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -118,9 +118,6 @@
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 @@
* @throws IllegalArgumentException when the action is invalid.
*/
private void validateAction(String action) {
- for (String validAction : VALID_ACTIONS) {
- if (validAction.equals(action)) {
- return;
- }
+ 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