Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40846c6a authored by Samuel Fufa's avatar Samuel Fufa
Browse files

Change logged hotseat values for beta

Bug: 153741765
Test: Manual
Change-Id: I8514264a2ea36809f6d3398c7aed4ca18e2d1a7f
parent 77cf9b78
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.UserEventDispatcher;
@@ -153,6 +154,12 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
    private void logUserAction(boolean migrated, int pageIndex) {
        LauncherLogProto.Action action = new LauncherLogProto.Action();
        LauncherLogProto.Target target = new LauncherLogProto.Target();

        int hotseatItemsCount = mLauncher.getHotseat().getShortcutsAndWidgets().getChildCount();
        // -1 to exclude smart space
        int workspaceItemCount = mLauncher.getWorkspace().getScreenWithId(
                Workspace.FIRST_SCREEN_ID).getShortcutsAndWidgets().getChildCount() - 1;

        action.type = LauncherLogProto.Action.Type.TOUCH;
        action.touch = LauncherLogProto.Action.Touch.TAP;
        target.containerType = LauncherLogProto.ContainerType.TIP;
@@ -162,7 +169,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
        target.rank = MIGRATION_EXPERIMENT_IDENTIFIER;
        // encoding migration type on pageIndex
        target.pageIndex = pageIndex;
        target.cardinality = HotseatPredictionController.MAX_ITEMS_FOR_MIGRATION;
        target.cardinality = (workspaceItemCount * 1000) + hotseatItemsCount;
        LauncherLogProto.LauncherEvent event = newLauncherEvent(action, target);
        UserEventDispatcher.newInstance(getContext()).dispatchUserEvent(event, null);
    }
+6 −6
Original line number Diff line number Diff line
@@ -91,9 +91,6 @@ public class HotseatPredictionController implements DragController.DragListener,
    private static final String TAG = "PredictiveHotseat";
    private static final boolean DEBUG = false;

    public static final int MAX_ITEMS_FOR_MIGRATION = DeviceConfig.getInt(
            DeviceFlag.NAMESPACE_LAUNCHER, "max_homepage_items_for_migration", 5);

    //TODO: replace this with AppTargetEvent.ACTION_UNPIN (b/144119543)
    private static final int APPTARGET_ACTION_UNPIN = 4;

@@ -606,6 +603,9 @@ public class HotseatPredictionController implements DragController.DragListener,
        if (isReady()) return;
        int hotseatItemsCount = mHotseat.getShortcutsAndWidgets().getChildCount();

        int maxItems = DeviceConfig.getInt(
                DeviceFlag.NAMESPACE_LAUNCHER, "max_homepage_items_for_migration", 5);

        // -1 to exclude smart space
        int workspaceItemCount = mLauncher.getWorkspace().getScreenWithId(
                Workspace.FIRST_SCREEN_ID).getShortcutsAndWidgets().getChildCount() - 1;
@@ -614,7 +614,7 @@ public class HotseatPredictionController implements DragController.DragListener,
        // open spots in their hotseat and have more than maxItems in their hotseat + workspace

        if (hotseatItemsCount == mHotSeatItemsCount && workspaceItemCount + hotseatItemsCount
                > MAX_ITEMS_FOR_MIGRATION) {
                > maxItems) {
            mLauncher.getSharedPrefs().edit().putBoolean(HotseatEduController.KEY_HOTSEAT_EDU_SEEN,
                    true).apply();

@@ -626,8 +626,8 @@ public class HotseatPredictionController implements DragController.DragListener,

            // temporarily encode details in log target (go/hotseat_migration)
            target.rank = 2;
            target.cardinality = MAX_ITEMS_FOR_MIGRATION;
            target.pageIndex = (workspaceItemCount * 1000) + hotseatItemsCount;
            target.cardinality = (workspaceItemCount * 1000) + hotseatItemsCount;
            target.pageIndex = maxItems;
            LauncherLogProto.LauncherEvent event = newLauncherEvent(action, target);
            UserEventDispatcher.newInstance(mLauncher).dispatchUserEvent(event, null);