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