AppLaunchEventsPlugin.java 1.9 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.content.ComponentName;
  18. import android.os.UserHandle;
  19. import com.android.systemui.plugins.annotations.ProvidesInterface;
  20. /**
  21. * Plugin interface which sends app launch events.
  22. */
  23. @ProvidesInterface(action = AppLaunchEventsPlugin.ACTION, version = AppLaunchEventsPlugin.VERSION)
  24. public interface AppLaunchEventsPlugin extends Plugin {
  25. String ACTION = "com.android.systemui.action.PLUGIN_APP_EVENTS";
  26. int VERSION = 1;
  27. /**
  28. * Receives onStartShortcut event from
  29. * {@link com.android.launcher3.appprediction.PredictionAppTracker}.
  30. */
  31. void onStartShortcut(String packageName, String shortcutId, UserHandle user, String container);
  32. /**
  33. * Receives onStartApp event from
  34. * {@link com.android.launcher3.appprediction.PredictionAppTracker}.
  35. */
  36. void onStartApp(ComponentName componentName, UserHandle user, String container);
  37. /**
  38. * Receives onDismissApp event from
  39. * {@link com.android.launcher3.appprediction.PredictionAppTracker}.
  40. */
  41. void onDismissApp(ComponentName componentName, UserHandle user, String container);
  42. /**
  43. * Receives onReturnedToHome event from
  44. * {@link com.android.launcher3.appprediction.PredictionAppTracker}.
  45. */
  46. void onReturnedToHome();
  47. }