Remove join/split buttons for profile

Bug: 5149871 There should not be a way to Join/Split profiles
Change-Id: I4c7782d67f04fe494ed1825e631d2b8c1ae5810b
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index afc3ab1..f502cb3 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -803,7 +803,14 @@
         // TODO: Find a better way to handle shortcuts, i.e. onKeyDown()?
         menu.findItem(R.id.menu_done).setVisible(false);
 
-        menu.findItem(R.id.menu_split).setVisible(mState != null && mState.size() > 1);
+        boolean editingUserProfile = mIsUserProfile || mNewLocalProfile;
+        // Split only if more than one raw profile and not a user profile
+        menu.findItem(R.id.menu_split).setVisible(mState != null && mState.size() > 1 &&
+                !editingUserProfile);
+        // Cannot join a user profile
+        menu.findItem(R.id.menu_join).setVisible(!editingUserProfile);
+
+
         int size = menu.size();
         for (int i = 0; i < size; i++) {
             menu.getItem(i).setEnabled(mEnabled);