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