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