From 60240139536e7df688517cb7aac82301a1a464b8 Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Tue, 8 Nov 2022 02:56:10 +0000 Subject: [PATCH] Add SearchResultCode to onSearchResult() Bug: 204781396 Test: Manual Change-Id: Ia776be0fdd42e1d5fa405911e28d9b0a12c1fdde --- .../allapps/ActivityAllAppsContainerView.java | 12 +++++++++++- .../android/launcher3/search/SearchCallback.java | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 08b42cd24c..c86f08d1fb 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -102,6 +102,16 @@ public class ActivityAllAppsContainerView results, int searchResultCode) { + setSearchResults(results); + } + private void animateToSearchState(boolean goingToSearch) { animateToSearchState(goingToSearch, DEFAULT_SEARCH_TRANSITION_DURATION_MS); } @@ -311,7 +321,7 @@ public class ActivityAllAppsContainerView { + // Search Result Codes + int UNKNOWN = 0; + int INTERMEDIATE = 1; + int FINAL = 2; + /** * Called when the search from primary source is complete. * @@ -31,6 +36,17 @@ public interface SearchCallback { */ void onSearchResult(String query, ArrayList items); + /** + * Called when the search from primary source is complete. + * + * @param items list of search results + * @param searchResultCode indicates if the result is final or intermediate for a given query + * since we can get search results from multiple sources. + */ + default void onSearchResult(String query, ArrayList items, int searchResultCode) { + onSearchResult(query, items); + } + /** * Called when the search results should be cleared. */