[Issue 2099504] Bypassing contact split dialog when there are only two raw contacts in the aggregate
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 0eafd7c..a668f79 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -54,6 +54,7 @@
 import android.os.Handler;
 import android.os.RemoteException;
 import android.os.ServiceManager;
+import android.provider.BaseColumns;
 import android.provider.ContactsContract;
 import android.provider.ContactsContract.AggregationExceptions;
 import android.provider.ContactsContract.CommonDataKinds;
@@ -480,12 +481,6 @@
         } else {
             mAdapter.setSections(mSections, SHOW_SEPARATORS);
         }
-
-//        else {
-//            Toast.makeText(this, R.string.invalidContactMessage, Toast.LENGTH_SHORT).show();
-//            Log.e(TAG, "invalid contact uri: " + mOriginalUri);
-//            finish();
-//        }
     }
 
     @Override
@@ -602,7 +597,11 @@
             }
 
             case MENU_ITEM_SPLIT_AGGREGATE: {
-                showSplitAggregateDialog();
+                if (mRawContactIds.size() == 2) {
+                    splitContact(mRawContactIds.get(1));
+                } else {
+                    showSplitAggregateDialog();
+                }
                 return true;
             }
 
@@ -706,7 +705,6 @@
      * The user picks a contact to be split into its own aggregate or clicks Cancel.
      */
     private void showSplitAggregateDialog() {
-
         // Wrap this dialog in a specific theme so that list items have correct text color.
         final ContextThemeWrapper dialogContext =
                 new ContextThemeWrapper(this, android.R.style.Theme_Light);
@@ -774,7 +772,7 @@
 
         // The split operation may have removed the original aggregate contact, so we need
         // to requery everything
-        Toast.makeText(this, R.string.contactsSplitMessage, Toast.LENGTH_SHORT).show();
+        Toast.makeText(this, R.string.contactsSplitMessage, Toast.LENGTH_LONG).show();
         startEntityQuery();
     }
 
@@ -791,8 +789,8 @@
             c.close();
         }
 
-        Toast.makeText(this, R.string.contactsJoinedMessage, Toast.LENGTH_SHORT).show();
-        mAdapter.notifyDataSetChanged();
+        Toast.makeText(this, R.string.contactsJoinedMessage, Toast.LENGTH_LONG).show();
+        startEntityQuery();
     }
 
     /**