Search in sources :

Example 6 with LAUNCHER_HOTSEAT_RANKED

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

the class HotseatPredictionController method logLaunchedAppRankingInfo.

/**
 * Logs rank info based on current list of predicted items
 */
public void logLaunchedAppRankingInfo(@NonNull ItemInfo itemInfo, InstanceId instanceId) {
    ComponentName targetCN = itemInfo.getTargetComponent();
    if (targetCN == null) {
        return;
    }
    int rank = -1;
    for (int i = mPredictedItems.size() - 1; i >= 0; i--) {
        ItemInfo info = mPredictedItems.get(i);
        if (targetCN.equals(info.getTargetComponent()) && itemInfo.user.equals(info.user)) {
            rank = i;
            break;
        }
    }
    if (rank < 0) {
        return;
    }
    int cardinality = 0;
    for (PredictedAppIcon icon : getPredictedIcons()) {
        ItemInfo info = (ItemInfo) icon.getTag();
        cardinality |= 1 << info.screenId;
    }
    PredictedHotseatContainer.Builder containerBuilder = PredictedHotseatContainer.newBuilder();
    containerBuilder.setCardinality(cardinality);
    if (itemInfo.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) {
        containerBuilder.setIndex(rank);
    }
    mLauncher.getStatsLogManager().logger().withInstanceId(instanceId).withRank(rank).withContainerInfo(ContainerInfo.newBuilder().setPredictedHotseatContainer(containerBuilder).build()).log(LAUNCHER_HOTSEAT_RANKED);
}
Also used : PredictedHotseatContainer(com.android.launcher3.logger.LauncherAtom.PredictedHotseatContainer) ItemInfo(com.android.launcher3.model.data.ItemInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) PredictedAppIcon(com.android.launcher3.uioverrides.PredictedAppIcon) ComponentName(android.content.ComponentName)

Aggregations

ComponentName (android.content.ComponentName)6 PredictedHotseatContainer (com.android.launcher3.logger.LauncherAtom.PredictedHotseatContainer)6 ItemInfo (com.android.launcher3.model.data.ItemInfo)6 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)6 PredictedAppIcon (com.android.launcher3.uioverrides.PredictedAppIcon)6 Animator (android.animation.Animator)1 AnimatorSet (android.animation.AnimatorSet)1 ObjectAnimator (android.animation.ObjectAnimator)1 AppPredictionContext (android.app.prediction.AppPredictionContext)1 AppPredictionManager (android.app.prediction.AppPredictionManager)1 AppPredictor (android.app.prediction.AppPredictor)1 AppTarget (android.app.prediction.AppTarget)1 AppTargetEvent (android.app.prediction.AppTargetEvent)1 Process (android.os.Process)1 Log (android.util.Log)1 HapticFeedbackConstants (android.view.HapticFeedbackConstants)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 NonNull (androidx.annotation.NonNull)1 Nullable (androidx.annotation.Nullable)1