Merge "Fix fragment carousel going to wrong scroll position after rotation"
diff --git a/res/mipmap-hdpi/ic_launcher_contacts.png b/res/mipmap-hdpi/ic_launcher_contacts.png
index 5ebe2e0..fa60a53 100644
--- a/res/mipmap-hdpi/ic_launcher_contacts.png
+++ b/res/mipmap-hdpi/ic_launcher_contacts.png
Binary files differ
diff --git a/res/mipmap-hdpi/ic_launcher_phone.png b/res/mipmap-hdpi/ic_launcher_phone.png
index e56c507..5a3dff1 100644
--- a/res/mipmap-hdpi/ic_launcher_phone.png
+++ b/res/mipmap-hdpi/ic_launcher_phone.png
Binary files differ
diff --git a/res/mipmap-mdpi/ic_launcher_contacts.png b/res/mipmap-mdpi/ic_launcher_contacts.png
index c79ae14..b50d7dd 100644
--- a/res/mipmap-mdpi/ic_launcher_contacts.png
+++ b/res/mipmap-mdpi/ic_launcher_contacts.png
Binary files differ
diff --git a/res/mipmap-mdpi/ic_launcher_phone.png b/res/mipmap-mdpi/ic_launcher_phone.png
index 1f40fd0..9ea0d8c 100644
--- a/res/mipmap-mdpi/ic_launcher_phone.png
+++ b/res/mipmap-mdpi/ic_launcher_phone.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_contacts.png b/res/mipmap-xhdpi/ic_launcher_contacts.png
index ca3aa63..4b7eaaa 100644
--- a/res/mipmap-xhdpi/ic_launcher_contacts.png
+++ b/res/mipmap-xhdpi/ic_launcher_contacts.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_phone.png b/res/mipmap-xhdpi/ic_launcher_phone.png
index e23a58c..e97836c 100644
--- a/res/mipmap-xhdpi/ic_launcher_phone.png
+++ b/res/mipmap-xhdpi/ic_launcher_phone.png
Binary files differ
diff --git a/src/com/android/contacts/list/CustomContactListFilterActivity.java b/src/com/android/contacts/list/CustomContactListFilterActivity.java
index 638a28e..d5395bd 100644
--- a/src/com/android/contacts/list/CustomContactListFilterActivity.java
+++ b/src/com/android/contacts/list/CustomContactListFilterActivity.java
@@ -373,13 +373,21 @@
                 }
             } else if (isUpdate()) {
                 if (mUngrouped) {
+                    String accountName = this.getAsString(Settings.ACCOUNT_NAME);
+                    String accountType = this.getAsString(Settings.ACCOUNT_TYPE);
+                    String dataSet = this.getAsString(Settings.DATA_SET);
+                    StringBuilder selection = new StringBuilder(Settings.ACCOUNT_NAME + "=? AND "
+                            + Settings.ACCOUNT_TYPE + "=?");
+                    String[] selectionArgs;
+                    if (dataSet == null) {
+                        selection.append(" AND " + Settings.DATA_SET + " IS NULL");
+                        selectionArgs = new String[] {accountName, accountType};
+                    } else {
+                        selection.append(" AND " + Settings.DATA_SET + "=?");
+                        selectionArgs = new String[] {accountName, accountType, dataSet};
+                    }
                     return ContentProviderOperation.newUpdate(Settings.CONTENT_URI)
-                            .withSelection(Settings.ACCOUNT_NAME + "=? AND "
-                                    + Settings.ACCOUNT_TYPE + "=?",
-                                    new String[] {
-                                        this.getAsString(Settings.ACCOUNT_NAME),
-                                        this.getAsString(Settings.ACCOUNT_TYPE)
-                                    })
+                            .withSelection(selection.toString(), selectionArgs)
                             .withValues(mAfter)
                             .build();
                 } else {