Search in sources :

Example 1 with AppTargetIdCompat

use of com.saggitt.omega.predictions.AppTargetIdCompat in project Neo-Launcher by NeoApplications.

the class PredictionAppTracker method onStartApp.

@Override
@UiThread
public void onStartApp(ComponentName cn, UserHandle user, String container) {
    if (cn != null) {
        AppTargetCompat target = new AppTargetCompat.Builder(new AppTargetIdCompat("app:" + cn), cn.getPackageName(), user).setClassName(cn.getClassName()).build();
        sendLaunch(target, container);
        // Relay onStartApp to every connected plugin.
        mAppLaunchEventsPluginsList.forEach(plugin -> plugin.onStartApp(cn, user, container != null ? container : CONTAINER_DEFAULT));
    }
}
Also used : AppTargetCompat(com.saggitt.omega.predictions.AppTargetCompat) AppTargetIdCompat(com.saggitt.omega.predictions.AppTargetIdCompat) UiThread(androidx.annotation.UiThread)

Example 2 with AppTargetIdCompat

use of com.saggitt.omega.predictions.AppTargetIdCompat in project Neo-Launcher by NeoApplications.

the class PredictionAppTracker method onDismissApp.

@Override
@UiThread
public void onDismissApp(ComponentName cn, UserHandle user, String container) {
    if (cn == null)
        return;
    AppTargetCompat target = new AppTargetCompat.Builder(new AppTargetIdCompat("app: " + cn), cn.getPackageName(), user).setClassName(cn.getClassName()).build();
    sendDismiss(target, container);
    // Relay onDismissApp to every connected plugin.
    mAppLaunchEventsPluginsList.forEach(plugin -> plugin.onDismissApp(cn, user, container != null ? container : CONTAINER_DEFAULT));
}
Also used : AppTargetCompat(com.saggitt.omega.predictions.AppTargetCompat) AppTargetIdCompat(com.saggitt.omega.predictions.AppTargetIdCompat) UiThread(androidx.annotation.UiThread)

Example 3 with AppTargetIdCompat

use of com.saggitt.omega.predictions.AppTargetIdCompat in project Neo-Launcher by NeoApplications.

the class PredictionAppTracker method onStartShortcut.

@Override
@UiThread
public void onStartShortcut(String packageName, String shortcutId, UserHandle user, String container) {
    // TODO: Use the full shortcut info
    AppTargetCompat target = new AppTargetCompat.Builder(new AppTargetIdCompat("shortcut:" + shortcutId), packageName, user).setClassName(shortcutId).build();
    sendLaunch(target, container);
    // Relay onStartShortcut info to every connected plugin.
    mAppLaunchEventsPluginsList.forEach(plugin -> plugin.onStartShortcut(packageName, shortcutId, user, container != null ? container : CONTAINER_DEFAULT));
}
Also used : AppTargetCompat(com.saggitt.omega.predictions.AppTargetCompat) AppTargetIdCompat(com.saggitt.omega.predictions.AppTargetIdCompat) UiThread(androidx.annotation.UiThread)

Aggregations

UiThread (androidx.annotation.UiThread)3 AppTargetCompat (com.saggitt.omega.predictions.AppTargetCompat)3 AppTargetIdCompat (com.saggitt.omega.predictions.AppTargetIdCompat)3