1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.systemui.plugins;
18 
19 import android.os.Parcelable;
20 
21 import com.android.systemui.plugins.annotations.ProvidesInterface;
22 
23 import java.util.ArrayList;
24 
25 /**
26  * Implement this interface to get suggest for one search.
27  */
28 @ProvidesInterface(action = OneSearch.ACTION, version = OneSearch.VERSION)
29 public interface OneSearch extends Plugin {
30     String ACTION = "com.android.systemui.action.PLUGIN_ONE_SEARCH";
31     int VERSION = 6;
32 
33     /**
34      * Get the content provider warmed up.
35      */
warmUp()36     void warmUp();
37 
38     /**
39      * Get the suggest search target list for the query.
40      *
41      * @param query The query to get the search suggests for.
42      */
getSuggests(Parcelable query)43     ArrayList<Parcelable> getSuggests(Parcelable query);
44 
45     /** Get image bitmap with the URL. */
getImageBitmap(String imageUrl)46     Parcelable getImageBitmap(String imageUrl);
47 
setSuggestOnChrome(boolean enable)48     void setSuggestOnChrome(boolean enable);
49 
50     /**
51      * Notifies search events to plugin
52      *
53      * @param event the SearchTargetEvent event created due to user action
54      */
notifyEvent(Parcelable event)55     void notifyEvent(Parcelable event);
56 }
57