OneSearch.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. package com.android.systemui.plugins;
  17. import android.os.Parcelable;
  18. import com.android.systemui.plugins.annotations.ProvidesInterface;
  19. import java.util.ArrayList;
  20. /**
  21. * Implement this interface to get suggest for one search.
  22. */
  23. @ProvidesInterface(action = OneSearch.ACTION, version = OneSearch.VERSION)
  24. public interface OneSearch extends Plugin {
  25. String ACTION = "com.android.systemui.action.PLUGIN_ONE_SEARCH";
  26. int VERSION = 5;
  27. /**
  28. * Get the content provider warmed up.
  29. */
  30. void warmUp();
  31. /**
  32. * Get the suggest search target list for the query.
  33. *
  34. * @param query The query to get the search suggests for.
  35. */
  36. ArrayList<Parcelable> getSuggests(Parcelable query);
  37. /** Get image bitmap with the URL. */
  38. Parcelable getImageBitmap(String imageUrl);
  39. /**
  40. * Notifies search events to plugin
  41. *
  42. * @param event the SearchTargetEvent event created due to user action
  43. */
  44. void notifyEvent(Parcelable event);
  45. }