summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/searchfragment
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2017-09-20 11:43:15 -0700
committerEric Erfanian <erfanian@google.com>2017-09-20 13:37:08 -0700
commit2ea58f749187ec3360b7ce8acac632bece24929e (patch)
treec7aeada070f1fbdb602efeef5f542323df2724cc /java/com/android/dialer/searchfragment
parenta6ac6b5eb080a7de2352e8dd9e5105fc7d86b289 (diff)
Fixed issue where all contacts weren't beign shown.
The underlying issue was that if a query was input that filtered out all of the on device contacts, then the device rotated, the cursor would be reloaded with all contacts filtered and getCount == 0. This would cause the cursor to never be set in SearchCursorManager and on device contacts would no longer be shown because the cursor wasn't being saved. The reason this check was here, was because cursor headers were being managed by SearchCursorManager. Since headers were moved into the cursors we no longer need to set cursors to null if they are empty. Bug: 65859191 Test: existing PiperOrigin-RevId: 169425922 Change-Id: I0baf31c3747d679f394f3746f609b9487e52472d
Diffstat (limited to 'java/com/android/dialer/searchfragment')
-rw-r--r--java/com/android/dialer/searchfragment/list/SearchCursorManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/com/android/dialer/searchfragment/list/SearchCursorManager.java b/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
index 95bede001..3704e817d 100644
--- a/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
+++ b/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
@@ -96,7 +96,7 @@ public final class SearchCursorManager {
contactsCursor.close();
}
- if (cursor != null && cursor.getCount() > 0) {
+ if (cursor != null) {
contactsCursor = cursor;
} else {
contactsCursor = null;
@@ -114,7 +114,7 @@ public final class SearchCursorManager {
nearbyPlacesCursor.close();
}
- if (cursor != null && cursor.getCount() > 0) {
+ if (cursor != null) {
nearbyPlacesCursor = cursor;
} else {
nearbyPlacesCursor = null;
@@ -132,7 +132,7 @@ public final class SearchCursorManager {
corpDirectoryCursor.close();
}
- if (cursor != null && cursor.getCount() > 0) {
+ if (cursor != null) {
corpDirectoryCursor = cursor;
} else {
corpDirectoryCursor = null;