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;
}
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;
}
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);
}
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");
}
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);
}
Aggregations