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