diff options
Diffstat (limited to 'java/com/android/dialer/searchfragment/remote')
-rw-r--r-- | java/com/android/dialer/searchfragment/remote/RemoteContactsCursor.java | 5 | ||||
-rw-r--r-- | java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursor.java b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursor.java index 5d80a452c..e9e83c19b 100644 --- a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursor.java +++ b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursor.java @@ -60,7 +60,10 @@ public final class RemoteContactsCursor extends MergeCursor implements SearchCur public static RemoteContactsCursor newInstance( Context context, Cursor[] cursors, List<Directory> directories) { Assert.checkArgument( - cursors.length == directories.size(), "Directories and cursors must be the same size."); + cursors.length == directories.size(), + "Directories (%d) and cursors (%d) must be the same size.", + directories.size(), + cursors.length); Cursor[] cursorsWithHeaders = insertHeaders(context, cursors, directories); if (cursorsWithHeaders.length > 0) { return new RemoteContactsCursor(cursorsWithHeaders); diff --git a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java index 771b7f183..37695be50 100644 --- a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java @@ -28,6 +28,7 @@ import android.support.annotation.VisibleForTesting; import android.text.TextUtils; import com.android.dialer.searchfragment.common.Projections; import com.android.dialer.searchfragment.remote.RemoteDirectoriesCursorLoader.Directory; +import java.util.ArrayList; import java.util.List; /** @@ -58,7 +59,7 @@ public final class RemoteContactsCursorLoader extends CursorLoader { null, Phone.SORT_KEY_PRIMARY); this.query = query; - this.directories = directories; + this.directories = new ArrayList<>(directories); cursors = new Cursor[directories.size()]; } |