diff options
author | Paul Soulos <psoulos@google.com> | 2014-09-15 15:48:02 -0700 |
---|---|---|
committer | Paul Soulos <psoulos@google.com> | 2014-09-15 22:48:48 +0000 |
commit | f19dda97bfdef84e3f39ba069a981004a5c797b1 (patch) | |
tree | 6b22cb1c6e0abed1bce67211cc47cbc8aa03720f /src/com/android/contacts/editor/ContactEditorFragment.java | |
parent | 0a90373fd7d704c6b711e9eadc3a34ae3bcb3127 (diff) | |
download | packages_apps_Contacts-f19dda97bfdef84e3f39ba069a981004a5c797b1.tar.gz packages_apps_Contacts-f19dda97bfdef84e3f39ba069a981004a5c797b1.tar.bz2 packages_apps_Contacts-f19dda97bfdef84e3f39ba069a981004a5c797b1.zip |
Disables the delete menu option on "insert or edit" actions
bug: 17468225
Change-Id: I9c26279cbedfe773d6fbd39ad49470d39ac88f2e
Diffstat (limited to 'src/com/android/contacts/editor/ContactEditorFragment.java')
-rw-r--r-- | src/com/android/contacts/editor/ContactEditorFragment.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java index f1128477d..ed2520dad 100644 --- a/src/com/android/contacts/editor/ContactEditorFragment.java +++ b/src/com/android/contacts/editor/ContactEditorFragment.java @@ -125,6 +125,7 @@ public class ContactEditorFragment extends Fragment implements private static final String KEY_STATUS = "status"; private static final String KEY_NEW_LOCAL_PROFILE = "newLocalProfile"; private static final String KEY_IS_USER_PROFILE = "isUserProfile"; + private static final String KEY_DISABLE_DELETE_MENU_OPTION = "disableDeleteMenuOption"; private static final String KEY_UPDATED_PHOTOS = "updatedPhotos"; private static final String KEY_IS_EDIT = "isEdit"; private static final String KEY_HAS_NEW_CONTACT = "hasNewContact"; @@ -146,6 +147,9 @@ public class ContactEditorFragment extends Fragment implements public static final String INTENT_EXTRA_NEW_LOCAL_PROFILE = "newLocalProfile"; + public static final String INTENT_EXTRA_DISABLE_DELETE_MENU_OPTION = + "disableDeleteMenuOption"; + /** * Modes that specify what the AsyncTask has to perform after saving */ @@ -339,6 +343,7 @@ public class ContactEditorFragment extends Fragment implements private boolean mRequestFocus; private boolean mNewLocalProfile = false; private boolean mIsUserProfile = false; + private boolean mDisableDeleteMenuOption = false; public ContactEditorFragment() { } @@ -471,6 +476,8 @@ public class ContactEditorFragment extends Fragment implements && mIntentExtras.containsKey(INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY); mNewLocalProfile = mIntentExtras != null && mIntentExtras.getBoolean(INTENT_EXTRA_NEW_LOCAL_PROFILE); + mDisableDeleteMenuOption = mIntentExtras != null + && mIntentExtras.getBoolean(INTENT_EXTRA_DISABLE_DELETE_MENU_OPTION); } public void setListener(Listener value) { @@ -504,6 +511,7 @@ public class ContactEditorFragment extends Fragment implements mEnabled = savedState.getBoolean(KEY_ENABLED); mStatus = savedState.getInt(KEY_STATUS); mNewLocalProfile = savedState.getBoolean(KEY_NEW_LOCAL_PROFILE); + mDisableDeleteMenuOption = savedState.getBoolean(KEY_DISABLE_DELETE_MENU_OPTION); mIsUserProfile = savedState.getBoolean(KEY_IS_USER_PROFILE); mUpdatedPhotos = savedState.getParcelable(KEY_UPDATED_PHOTOS); mIsEdit = savedState.getBoolean(KEY_IS_EDIT); @@ -1072,6 +1080,7 @@ public class ContactEditorFragment extends Fragment implements splitMenu.setVisible(mState.size() > 1 && !isEditingUserProfile()); // Cannot join a user profile joinMenu.setVisible(!isEditingUserProfile()); + deleteMenu.setVisible(!mDisableDeleteMenuOption); } else { // something else, so don't show the help menu helpMenu.setVisible(false); @@ -1767,6 +1776,7 @@ public class ContactEditorFragment extends Fragment implements outState.putLong(KEY_SHOW_JOIN_SUGGESTIONS, mAggregationSuggestionsRawContactId); outState.putBoolean(KEY_ENABLED, mEnabled); outState.putBoolean(KEY_NEW_LOCAL_PROFILE, mNewLocalProfile); + outState.putBoolean(KEY_DISABLE_DELETE_MENU_OPTION, mDisableDeleteMenuOption); outState.putBoolean(KEY_IS_USER_PROFILE, mIsUserProfile); outState.putInt(KEY_STATUS, mStatus); outState.putParcelable(KEY_UPDATED_PHOTOS, mUpdatedPhotos); |