Search in sources :

Example 6 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logActionOnContainer.

public void logActionOnContainer(int action, int dir, int containerType, int pageIndex) {
    LauncherEvent event = newLauncherEvent(newTouchAction(action), newContainerTarget(containerType));
    event.action.dir = dir;
    event.srcTarget[0].pageIndex = pageIndex;
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 7 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logActionOnControl.

/**
 * Logs control action with proper parent hierarchy
 */
public void logActionOnControl(int actionType, int controlType, @Nullable View controlInContainer, int... parentTypes) {
    Target control = newTarget(Target.Type.CONTROL);
    control.controlType = controlType;
    Action action = newAction(actionType);
    ArrayList<Target> targets = makeTargetsList(control);
    if (controlInContainer != null) {
        fillLogContainer(controlInContainer, control, targets);
    }
    for (int parentContainerType : parentTypes) {
        if (parentContainerType < 0)
            continue;
        targets.add(newContainerTarget(parentContainerType));
    }
    LauncherEvent event = newLauncherEvent(action, targets);
    if (actionType == Action.Touch.DRAGDROP) {
        event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
    }
    dispatchUserEvent(event, null);
}
Also used : LoggerUtils.newTarget(com.android.launcher3.logging.LoggerUtils.newTarget) Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LoggerUtils.newControlTarget(com.android.launcher3.logging.LoggerUtils.newControlTarget) LoggerUtils.newItemTarget(com.android.launcher3.logging.LoggerUtils.newItemTarget) DropTarget(com.android.launcher3.DropTarget) LoggerUtils.newContainerTarget(com.android.launcher3.logging.LoggerUtils.newContainerTarget) LoggerUtils.newDropTarget(com.android.launcher3.logging.LoggerUtils.newDropTarget) LoggerUtils.newCommandAction(com.android.launcher3.logging.LoggerUtils.newCommandAction) LoggerUtils.newTouchAction(com.android.launcher3.logging.LoggerUtils.newTouchAction) LoggerUtils.newAction(com.android.launcher3.logging.LoggerUtils.newAction) Action(com.android.launcher3.userevent.nano.LauncherLogProto.Action) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 8 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logActionCommand.

public void logActionCommand(int command, Target srcTarget, Target dstTarget) {
    LauncherEvent event = newLauncherEvent(newCommandAction(command), srcTarget);
    if (command == Action.Command.STOP) {
        if (mAppOrTaskLaunch || !mSessionStarted) {
            mSessionStarted = false;
            return;
        }
    }
    if (dstTarget != null) {
        event.destTarget = new Target[1];
        event.destTarget[0] = dstTarget;
        event.action.isStateChange = true;
    }
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 9 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logDeepShortcutsOpen.

public void logDeepShortcutsOpen(View icon) {
    LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(icon);
    if (icon == null || !(icon.getTag() instanceof ItemInfo || provider == null)) {
        return;
    }
    ItemInfo info = (ItemInfo) icon.getTag();
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.LONGPRESS), newItemTarget(info, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
    provider.fillInLogContainerData(icon, info, event.srcTarget[0], event.srcTarget[1]);
    dispatchUserEvent(event, null);
    resetElapsedContainerMillis("deep shortcut open");
}
Also used : ItemInfo(com.android.launcher3.ItemInfo) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent) LogContainerProvider(com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)

Example 10 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logActionOnItem.

/**
 * Creates new {@link LauncherEvent} of ITEM target type with input arguments and dispatches it.
 *
 * @param touchAction ENUM value of {@link LauncherLogProto.Action.Touch} Action
 * @param dir         ENUM value of {@link LauncherLogProto.Action.Direction} Action
 * @param itemType    ENUM value of {@link LauncherLogProto.ItemType}
 * @param gridX       Nullable X coordinate of item's position on the workspace grid
 * @param gridY       Nullable Y coordinate of item's position on the workspace grid
 */
public void logActionOnItem(int touchAction, int dir, int itemType, @Nullable Integer gridX, @Nullable Integer gridY) {
    Target itemTarget = newTarget(Target.Type.ITEM);
    itemTarget.itemType = itemType;
    ofNullable(gridX).ifPresent(value -> itemTarget.gridX = value);
    ofNullable(gridY).ifPresent(value -> itemTarget.gridY = value);
    LauncherEvent event = newLauncherEvent(newTouchAction(touchAction), itemTarget);
    event.action.dir = dir;
    dispatchUserEvent(event, null);
}
Also used : LoggerUtils.newTarget(com.android.launcher3.logging.LoggerUtils.newTarget) Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LoggerUtils.newControlTarget(com.android.launcher3.logging.LoggerUtils.newControlTarget) LoggerUtils.newItemTarget(com.android.launcher3.logging.LoggerUtils.newItemTarget) DropTarget(com.android.launcher3.DropTarget) LoggerUtils.newContainerTarget(com.android.launcher3.logging.LoggerUtils.newContainerTarget) LoggerUtils.newDropTarget(com.android.launcher3.logging.LoggerUtils.newDropTarget) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Aggregations

LauncherEvent (com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent)32 LoggerUtils.newLauncherEvent (com.android.launcher3.logging.LoggerUtils.newLauncherEvent)29 DropTarget (com.android.launcher3.DropTarget)9 LoggerUtils.newContainerTarget (com.android.launcher3.logging.LoggerUtils.newContainerTarget)9 LoggerUtils.newControlTarget (com.android.launcher3.logging.LoggerUtils.newControlTarget)9 LoggerUtils.newDropTarget (com.android.launcher3.logging.LoggerUtils.newDropTarget)9 LoggerUtils.newItemTarget (com.android.launcher3.logging.LoggerUtils.newItemTarget)9 LoggerUtils.newTarget (com.android.launcher3.logging.LoggerUtils.newTarget)9 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)9 LoggerUtils.newAction (com.android.launcher3.logging.LoggerUtils.newAction)4 LoggerUtils.newCommandAction (com.android.launcher3.logging.LoggerUtils.newCommandAction)4 LoggerUtils.newTouchAction (com.android.launcher3.logging.LoggerUtils.newTouchAction)4 Action (com.android.launcher3.userevent.nano.LauncherLogProto.Action)4 LogContainerProvider (com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)3 ItemInfo (com.android.launcher3.ItemInfo)1 LauncherLogProto (com.android.launcher3.userevent.LauncherLogProto)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1