Search in sources :

Example 26 with LauncherEvent

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

the class UserEventDispatcher method logTaskLaunchOrDismiss.

@Deprecated
public void logTaskLaunchOrDismiss(int action, int direction, int taskIndex, ComponentKey componentKey) {
    LauncherEvent event = newLauncherEvent(// TAP or SWIPE or FLING
    newTouchAction(action), newTarget(Target.Type.ITEM));
    if (action == Action.Touch.SWIPE || action == Action.Touch.FLING) {
        // Direction DOWN means the task was launched, UP means it was dismissed.
        event.action.dir = direction;
    }
    event.srcTarget[0].itemType = ItemType.TASK;
    event.srcTarget[0].pageIndex = taskIndex;
    fillComponentInfo(event.srcTarget[0], componentKey.componentName);
    dispatchUserEvent(event, null);
    mAppOrTaskLaunch = true;
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 27 with LauncherEvent

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

the class LoggerUtils method newLauncherEvent.

public static LauncherEvent newLauncherEvent(Action action, Target... srcTargets) {
    LauncherEvent event = new LauncherEvent();
    event.srcTarget = srcTargets;
    event.action = action;
    return event;
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent)

Example 28 with LauncherEvent

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

the class UserEventDispatcher method logDragNDrop.

public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) {
    Target srcChild = newItemTarget(dragObj.originalDragInfo, mInstantAppResolver);
    ArrayList<Target> srcTargets = makeTargetsList(srcChild);
    Target destChild = newItemTarget(dragObj.originalDragInfo, mInstantAppResolver);
    ArrayList<Target> destTargets = makeTargetsList(destChild);
    dragObj.dragSource.fillInLogContainerData(dragObj.originalDragInfo, srcChild, srcTargets);
    if (dropTargetAsView instanceof LogContainerProvider) {
        ((LogContainerProvider) dropTargetAsView).fillInLogContainerData(dragObj.dragInfo, destChild, destTargets);
    } else {
        destTargets.add(newDropTarget(dropTargetAsView));
    }
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.DRAGDROP), srcTargets);
    Target[] destTargetsArray = new Target[destTargets.size()];
    destTargets.toArray(destTargetsArray);
    event.destTarget = destTargetsArray;
    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) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent) LogContainerProvider(com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)

Example 29 with LauncherEvent

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

the class UserEventDispatcher method logStateChangeAction.

/**
 * Used primarily for swipe up and down when state changes when swipe up happens from the
 * navbar bezel, the {@param srcChildContainerType} is NAVBAR and
 * {@param srcParentContainerType} is either one of the two
 * (1) WORKSPACE: if the launcher is the foreground activity
 * (2) APP: if another app was the foreground activity
 */
public void logStateChangeAction(int action, int dir, int downX, int downY, int srcChildTargetType, int srcParentContainerType, int dstContainerType, int pageIndex) {
    LauncherEvent event;
    if (srcChildTargetType == ItemType.TASK) {
        event = newLauncherEvent(newTouchAction(action), newItemTarget(srcChildTargetType), newContainerTarget(srcParentContainerType));
    } else {
        event = newLauncherEvent(newTouchAction(action), newContainerTarget(srcChildTargetType), newContainerTarget(srcParentContainerType));
    }
    event.destTarget = new Target[1];
    event.destTarget[0] = newContainerTarget(dstContainerType);
    event.action.dir = dir;
    event.action.isStateChange = true;
    event.srcTarget[0].pageIndex = pageIndex;
    event.srcTarget[0].spanX = downX;
    event.srcTarget[0].spanY = downY;
    dispatchUserEvent(event, null);
    resetElapsedContainerMillis("state changed");
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 30 with LauncherEvent

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

the class UserEventDispatcher method logActionBounceTip.

public void logActionBounceTip(int containerType) {
    LauncherEvent event = newLauncherEvent(newAction(Action.Type.TIP), newContainerTarget(containerType));
    event.srcTarget[0].tipType = TipType.BOUNCE;
    dispatchUserEvent(event, null);
}
Also used : 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