summaryrefslogtreecommitdiff
path: root/src_plugins
diff options
context:
space:
mode:
author Hyunyoung Song <hyunyoungs@google.com> 2020-10-12 13:56:02 -0700
committer Hyunyoung Song <hyunyoungs@google.com> 2020-10-19 22:09:10 -0700
commitcaa1e9c39978cb3b467b5ac441eb39b5e883fa2e (patch)
tree28181f088cdaf27d917611a97ecc9df8f3c40a00 /src_plugins
parent744a0fbeae8efaa942d21c61e25012d86f5ff81e (diff)
Search query method should support multiple consumers
Bug: 170488559 Change-Id: I64bef9523d3c3950c4ca3a4b9ce1d506d1672200
Diffstat (limited to 'src_plugins')
-rw-r--r--src_plugins/com/android/systemui/plugins/AllAppsSearchPlugin.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src_plugins/com/android/systemui/plugins/AllAppsSearchPlugin.java b/src_plugins/com/android/systemui/plugins/AllAppsSearchPlugin.java
index aa3ab8f7e0..5cc238da23 100644
--- a/src_plugins/com/android/systemui/plugins/AllAppsSearchPlugin.java
+++ b/src_plugins/com/android/systemui/plugins/AllAppsSearchPlugin.java
@@ -17,6 +17,8 @@
package com.android.systemui.plugins;
import android.app.Activity;
+import android.os.Bundle;
+import android.os.CancellationSignal;
import android.view.View;
import com.android.systemui.plugins.annotations.ProvidesInterface;
@@ -32,7 +34,7 @@ import java.util.function.Consumer;
@ProvidesInterface(action = AllAppsSearchPlugin.ACTION, version = AllAppsSearchPlugin.VERSION)
public interface AllAppsSearchPlugin extends Plugin {
String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_SEARCH_ACTIONS";
- int VERSION = 7;
+ int VERSION = 8;
void setup(Activity activity, View view);
@@ -49,10 +51,21 @@ public interface AllAppsSearchPlugin extends Plugin {
void onWindowVisibilityChanged(int visibility);
/**
- * Send signal when user starts typing, perform search, when search ends
+ * Send signal when user starts typing, perform search, notify search target
+ * event when search ends.
*/
void startedSearchSession();
- void performSearch(String query, Consumer<List<SearchTarget>> results);
+
+ /**
+ * Main function that triggers search.
+ *
+ * @param input string that has been typed by a user
+ * @param inputArgs extra info that may be relevant for the input query
+ * @param results contains the result that will be rendered in all apps search surface
+ * @param cancellationSignal {@link CancellationSignal} can be used to share status of current
+ */
+ void query(String input, Bundle inputArgs, Consumer<List<SearchTarget>> results,
+ CancellationSignal cancellationSignal);
/**
* Send over search target interaction events to Plugin