summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java')
-rw-r--r--java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java
index a4142a41d..3be59b672 100644
--- a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java
+++ b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursor.java
@@ -27,16 +27,23 @@ import com.android.dialer.searchfragment.common.SearchCursor;
final class NearbyPlacesCursor extends MergeCursor implements SearchCursor {
private final Cursor nearbyPlacesCursor;
+ private final long directoryId;
- public static NearbyPlacesCursor newInstnace(Context context, Cursor nearbyPlacesCursor) {
+ /**
+ * @param directoryId unique directory id that doesn't collide with other remote/local
+ * directories. directoryIds are needed to load the correct quick contact card.
+ */
+ static NearbyPlacesCursor newInstance(
+ Context context, Cursor nearbyPlacesCursor, long directoryId) {
MatrixCursor headerCursor = new MatrixCursor(HEADER_PROJECTION);
headerCursor.addRow(new String[] {context.getString(R.string.nearby_places)});
- return new NearbyPlacesCursor(new Cursor[] {headerCursor, nearbyPlacesCursor});
+ return new NearbyPlacesCursor(new Cursor[] {headerCursor, nearbyPlacesCursor}, directoryId);
}
- private NearbyPlacesCursor(Cursor[] cursors) {
+ private NearbyPlacesCursor(Cursor[] cursors, long directoryId) {
super(cursors);
nearbyPlacesCursor = cursors[1];
+ this.directoryId = directoryId;
}
@Override
@@ -61,4 +68,9 @@ final class NearbyPlacesCursor extends MergeCursor implements SearchCursor {
int count = nearbyPlacesCursor.getCount();
return count == 0 ? 0 : count + 1;
}
+
+ @Override
+ public long getDirectoryId() {
+ return directoryId;
+ }
}