Search in sources :

Example 1 with LAUNCHER_HOTSEAT_RANKED

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

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)

Example 2 with LAUNCHER_HOTSEAT_RANKED

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

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)

Example 3 with LAUNCHER_HOTSEAT_RANKED

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

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)

Example 4 with LAUNCHER_HOTSEAT_RANKED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_RANKED in project android_packages_apps_404Launcher by P-404.

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)

Example 5 with LAUNCHER_HOTSEAT_RANKED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_RANKED in project android_packages_apps_Trebuchet by LineageOS.

the class HotseatPredictionController method logLaunchedAppRankingInfo.

/**
 * Logs rank info based on current list of predicted items
 */
public void logLaunchedAppRankingInfo(@NonNull ItemInfo itemInfo, InstanceId instanceId) {
    if (Utilities.IS_DEBUG_DEVICE) {
        final String pkg = itemInfo.getTargetComponent() != null ? itemInfo.getTargetComponent().getPackageName() : "unknown";
        HotseatFileLog.INSTANCE.get(mLauncher).log("UserEvent", "appLaunch: packageName:" + pkg + ",isWorkApp:" + (itemInfo.user != null && !Process.myUserHandle().equals(itemInfo.user)) + ",launchLocation:" + itemInfo.container);
    }
    if (itemInfo.getTargetComponent() == null || itemInfo.user == null) {
        return;
    }
    final ComponentKey key = new ComponentKey(itemInfo.getTargetComponent(), itemInfo.user);
    final List<ComponentKeyMapper> predictedApps = new ArrayList<>(mComponentKeyMappers);
    OptionalInt rank = IntStream.range(0, predictedApps.size()).filter(index -> key.equals(predictedApps.get(index).getComponentKey())).findFirst();
    if (!rank.isPresent()) {
        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.getAsInt());
    }
    mLauncher.getStatsLogManager().logger().withInstanceId(instanceId).withRank(rank.getAsInt()).withContainerInfo(ContainerInfo.newBuilder().setPredictedHotseatContainer(containerBuilder).build()).log(LAUNCHER_HOTSEAT_RANKED);
}
Also used : ComponentKeyMapper(com.android.launcher3.appprediction.ComponentKeyMapper) NonNull(androidx.annotation.NonNull) Animator(android.animation.Animator) LauncherSettings(com.android.launcher3.LauncherSettings) DynamicItemCache(com.android.launcher3.appprediction.DynamicItemCache) IconCache(com.android.launcher3.icons.IconCache) AppTarget(android.app.prediction.AppTarget) Process(android.os.Process) ShortcutKey(com.android.launcher3.shortcuts.ShortcutKey) LAUNCHER_HOTSEAT_RANKED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_RANKED) HotseatEduController.getSettingsIntent(com.android.launcher3.hybridhotseat.HotseatEduController.getSettingsIntent) FolderInfo(com.android.launcher3.model.data.FolderInfo) View(android.view.View) AnimationSuccessListener(com.android.launcher3.anim.AnimationSuccessListener) SCALE_PROPERTY(com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY) Log(android.util.Log) Utilities(com.android.launcher3.Utilities) AppPredictor(android.app.prediction.AppPredictor) QuickstepLauncher(com.android.launcher3.uioverrides.QuickstepLauncher) Launcher(com.android.launcher3.Launcher) ObjectAnimator(android.animation.ObjectAnimator) AppPredictionManager(android.app.prediction.AppPredictionManager) AllAppsStore(com.android.launcher3.allapps.AllAppsStore) PredictedAppIcon(com.android.launcher3.uioverrides.PredictedAppIcon) ViewGroup(android.view.ViewGroup) DragOptions(com.android.launcher3.dragndrop.DragOptions) HapticFeedbackConstants(android.view.HapticFeedbackConstants) List(java.util.List) Nullable(androidx.annotation.Nullable) AppPredictionContext(android.app.prediction.AppPredictionContext) NORMAL(com.android.launcher3.LauncherState.NORMAL) LauncherLogProto(com.android.launcher3.userevent.nano.LauncherLogProto) IntStream(java.util.stream.IntStream) AppInfo(com.android.launcher3.model.data.AppInfo) ContainerInfo(com.android.launcher3.logger.LauncherAtom.ContainerInfo) ItemInfo(com.android.launcher3.model.data.ItemInfo) Snackbar(com.android.launcher3.views.Snackbar) OptionalInt(java.util.OptionalInt) ArrayList(java.util.ArrayList) ItemLongClickListener(com.android.launcher3.touch.ItemLongClickListener) PredictedHotseatContainer(com.android.launcher3.logger.LauncherAtom.PredictedHotseatContainer) AppTargetEvent(android.app.prediction.AppTargetEvent) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) AnimatorSet(android.animation.AnimatorSet) DragSource(com.android.launcher3.DragSource) WeakReference(java.lang.ref.WeakReference) SystemShortcut(com.android.launcher3.popup.SystemShortcut) CHANGE_FLAG_GRID(com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_GRID) IntArray(com.android.launcher3.util.IntArray) InstanceId(com.android.launcher3.logging.InstanceId) ArrowTipView(com.android.launcher3.views.ArrowTipView) ComponentName(android.content.ComponentName) DropTarget(com.android.launcher3.DropTarget) LauncherAppState(com.android.launcher3.LauncherAppState) DragController(com.android.launcher3.dragndrop.DragController) OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) Hotseat(com.android.launcher3.Hotseat) InvariantDeviceProfile(com.android.launcher3.InvariantDeviceProfile) R(com.android.launcher3.R) ComponentKey(com.android.launcher3.util.ComponentKey) Collections(java.util.Collections) ItemInfoWithIcon(com.android.launcher3.model.data.ItemInfoWithIcon) 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) ComponentKey(com.android.launcher3.util.ComponentKey) ArrayList(java.util.ArrayList) OptionalInt(java.util.OptionalInt) ComponentKeyMapper(com.android.launcher3.appprediction.ComponentKeyMapper)

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