Search in sources :

Example 31 with LauncherEvent

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

the class UserEventDispatcher method logActionCommand.

/**
 * TODO: Make this function work when a container view is passed as the 2nd param.
 */
public void logActionCommand(int command, View itemView, int srcContainerType) {
    LauncherEvent event = newLauncherEvent(newCommandAction(command), newItemTarget(itemView, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
    Target itemTarget = newItemTarget(itemView, mInstantAppResolver);
    ArrayList<Target> targets = makeTargetsList(itemTarget);
    if (fillLogContainer(itemView, itemTarget, targets)) {
        // TODO: Remove the following two lines once fillInLogContainerData can take in a
        // container view.
        itemTarget.type = Target.Type.CONTAINER;
        itemTarget.containerType = srcContainerType;
    }
    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 32 with LauncherEvent

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

the class UserEventDispatcher method dispatchUserEvent.

public void dispatchUserEvent(LauncherEvent ev, Intent intent) {
    if (mPreviousHomeGesture) {
        mPreviousHomeGesture = false;
    }
    mAppOrTaskLaunch = false;
    ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis;
    ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis;
    if (!IS_VERBOSE) {
        return;
    }
    LauncherLogProto.LauncherEvent liteLauncherEvent;
    try {
        liteLauncherEvent = LauncherLogProto.LauncherEvent.parseFrom(MessageNano.toByteArray(ev));
    } catch (InvalidProtocolBufferException e) {
        throw new RuntimeException("Cannot parse LauncherEvent from Nano to Lite version");
    }
    Log.d(TAG, liteLauncherEvent.toString());
}
Also used : LauncherLogProto(com.android.launcher3.userevent.LauncherLogProto) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException)

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