Add basic logs for tap outside action.

Change-Id: I6288610b9870c3abe88794c53309b1d76dd2780f
This commit is contained in:
Jon Miranda 2017-02-07 17:12:36 -08:00
parent 4b20e0c312
commit c6cf493b07
6 changed files with 31 additions and 1 deletions

View File

@ -121,4 +121,6 @@ public abstract class AbstractFloatingView extends LinearLayout {
public static AbstractFloatingView getTopOpenView(Launcher launcher) {
return getOpenView(launcher, TYPE_FOLDER | TYPE_POPUP_CONTAINER_WITH_ARROW);
}
public abstract int getLogContainerType();
}

View File

@ -111,6 +111,7 @@ import com.android.launcher3.pageindicators.PageIndicator;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
@ -2272,7 +2273,11 @@ public class Launcher extends BaseActivity
if (v instanceof CellLayout) {
if (mWorkspace.isInOverviewMode()) {
mWorkspace.snapToPageFromOverView(mWorkspace.indexOfChild(v));
int page = mWorkspace.indexOfChild(v);
getUserEventDispatcher().logActionOnContainer(LauncherLogProto.Action.Type.TOUCH,
LauncherLogProto.Action.Direction.NONE,
LauncherLogProto.ContainerType.OVERVIEW, page);
mWorkspace.snapToPageFromOverView(page);
showWorkspace(true);
}
return;

View File

@ -57,6 +57,8 @@ import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.logging.LoggerUtils;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TouchController;
@ -192,6 +194,8 @@ public class DragLayer extends InsettableFrameLayout {
return true;
}
} else {
mLauncher.getUserEventDispatcher().logActionTapOutside(
LoggerUtils.newContainerTarget(topView.getLogContainerType()));
topView.close(true);
// We let touches on the original icon go through so that users can launch

View File

@ -74,6 +74,7 @@ import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.pageindicators.PageIndicatorDots;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.CircleRevealOutlineProvider;
@ -1532,4 +1533,9 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC
public static Folder getOpen(Launcher launcher) {
return getOpenView(launcher, TYPE_FOLDER);
}
@Override
public int getLogContainerType() {
return ContainerType.FOLDER;
}
}

View File

@ -28,6 +28,7 @@ import com.android.launcher3.DropTarget;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent;
@ -196,6 +197,13 @@ public class UserEventDispatcher {
dispatchUserEvent(event, null);
}
public void logActionTapOutside(Target target) {
LauncherEvent event = newLauncherEvent(newTouchAction(Action.Type.TOUCH),
target);
event.action.isOutside = true;
dispatchUserEvent(event, null);
}
public void logActionOnContainer(int action, int dir, int containerType) {
logActionOnContainer(action, dir, containerType, 0);
}

View File

@ -825,4 +825,9 @@ public class PopupContainerWithArrow extends AbstractFloatingView
public static PopupContainerWithArrow getOpen(Launcher launcher) {
return getOpenView(launcher, TYPE_POPUP_CONTAINER_WITH_ARROW);
}
@Override
public int getLogContainerType() {
return ContainerType.DEEPSHORTCUTS;
}
}