From 2ea58f749187ec3360b7ce8acac632bece24929e Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Wed, 20 Sep 2017 11:43:15 -0700 Subject: 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 --- .../com/android/dialer/searchfragment/list/SearchCursorManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/searchfragment') 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; -- cgit v1.2.3