Search in sources :

Example 6 with LAUNCHER_APP_LAUNCH_TAP

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP in project android_packages_apps_Launcher3 by ArrowOS.

the class QuickstepLauncher method logAppLaunch.

@Override
public void logAppLaunch(StatsLogManager statsLogManager, ItemInfo info, InstanceId instanceId) {
    // LiveSearchManager to recreate the AllApps session on the server side.
    if (mAllAppsSessionLogId != null && ALL_APPS.equals(getStateManager().getCurrentStableState())) {
        instanceId = mAllAppsSessionLogId;
    }
    StatsLogger logger = statsLogManager.logger().withItemInfo(info).withInstanceId(instanceId);
    if (mAllAppsPredictions != null && (info.itemType == ITEM_TYPE_APPLICATION || info.itemType == ITEM_TYPE_SHORTCUT || info.itemType == ITEM_TYPE_DEEP_SHORTCUT)) {
        int count = mAllAppsPredictions.items.size();
        for (int i = 0; i < count; i++) {
            ItemInfo targetInfo = mAllAppsPredictions.items.get(i);
            if (targetInfo.itemType == info.itemType && targetInfo.user.equals(info.user) && Objects.equals(targetInfo.getIntent(), info.getIntent())) {
                logger.withRank(i);
                break;
            }
        }
    }
    logger.log(LAUNCHER_APP_LAUNCH_TAP);
    mHotseatPredictionController.logLaunchedAppRankingInfo(info, instanceId);
}
Also used : StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) ItemInfo(com.android.launcher3.model.data.ItemInfo)

Aggregations

StatsLogger (com.android.launcher3.logging.StatsLogManager.StatsLogger)6 ItemInfo (com.android.launcher3.model.data.ItemInfo)5 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)1 OptionalInt (java.util.OptionalInt)1