Don't show groups on the compact editor if there's more than 1

Bug 24980001
Bug 23589603

Change-Id: I4492c0036f826d591f59e5ab18b034afe21990ff
diff --git a/src/com/android/contacts/editor/CompactRawContactsEditorView.java b/src/com/android/contacts/editor/CompactRawContactsEditorView.java
index 836579a..b3e4349 100644
--- a/src/com/android/contacts/editor/CompactRawContactsEditorView.java
+++ b/src/com/android/contacts/editor/CompactRawContactsEditorView.java
@@ -66,7 +66,6 @@
 import android.widget.ListPopupWindow;
 import android.widget.TextView;
 
-import java.io.FileNotFoundException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -76,7 +75,6 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.TreeSet;
 
 /**
@@ -995,6 +993,14 @@
                 continue;
             }
 
+            // Don't show more than one group editor on the compact editor.
+            // Groups will still be editable for each raw contact individually on the full editor.
+            if (GroupMembership.CONTENT_ITEM_TYPE.equals(mimeType)
+                    && kindSectionDataList.size() > 1) {
+                vlog("kind: " + i + " " + mimeType + " dropped");
+                continue;
+            }
+
             if (kindSectionDataList != null && !kindSectionDataList.isEmpty()) {
                 vlog("kind: " + i + " " + mimeType + ": " + kindSectionDataList.size() +
                         " kindSectionData(s)");