Search in sources :

Example 1 with LauncherEvent

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

the class UserEventDispatcher method logAppLaunch.

// APP_ICON    SHORTCUT    WIDGET
// --------------------------------------------------------------
// packageNameHash      required    optional    required
// componentNameHash    required                required
// intentHash                       required
// --------------------------------------------------------------
@Deprecated
public void logAppLaunch(View v, Intent intent, @Nullable UserHandle userHandle) {
    Target itemTarget = newItemTarget(v, mInstantAppResolver);
    Action action = newTouchAction(Action.Touch.TAP);
    ArrayList<Target> targets = makeTargetsList(itemTarget);
    if (fillLogContainer(v, itemTarget, targets)) {
        onFillInLogContainerData((ItemInfo) v.getTag(), itemTarget, targets);
        fillIntentInfo(itemTarget, intent, userHandle);
    }
    LauncherEvent event = newLauncherEvent(action, targets);
    dispatchUserEvent(event, intent);
    mAppOrTaskLaunch = true;
}
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 2 with LauncherEvent

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

the class UserEventDispatcher method logActionTapOutside.

public void logActionTapOutside(Target target) {
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Type.TOUCH), target);
    event.action.isOutside = true;
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 3 with LauncherEvent

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

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)

Example 4 with LauncherEvent

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

the class UserEventDispatcher method logNotificationLaunch.

public void logNotificationLaunch(View v, PendingIntent intent) {
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.TAP), newItemTarget(v, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
    Target itemTarget = newItemTarget(v, mInstantAppResolver);
    ArrayList<Target> targets = makeTargetsList(itemTarget);
    if (fillLogContainer(v, itemTarget, targets)) {
        itemTarget.packageNameHash = (mUuidStr + intent.getCreatorPackage()).hashCode();
    }
    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)

Example 5 with LauncherEvent

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

the class UserEventDispatcher method logActionBack.

public void logActionBack(boolean completed, int downX, int downY, boolean isButton, boolean gestureSwipeLeft, int containerType) {
    int actionTouch = isButton ? Action.Touch.TAP : Action.Touch.SWIPE;
    Action action = newCommandAction(actionTouch);
    action.command = Action.Command.BACK;
    action.dir = isButton ? Action.Direction.NONE : gestureSwipeLeft ? Action.Direction.LEFT : Action.Direction.RIGHT;
    Target target = newControlTarget(isButton ? ControlType.BACK_BUTTON : ControlType.BACK_GESTURE);
    target.spanX = downX;
    target.spanY = downY;
    target.cardinality = completed ? 1 : 0;
    LauncherEvent event = newLauncherEvent(action, target, newContainerTarget(containerType));
    dispatchUserEvent(event, null);
}
Also used : 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) 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