From 0d4899026c16f7e830cfe32c717951e8bb494c84 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Thu, 17 Nov 2016 12:23:33 -0800 Subject: [PATCH] Add logging for workspace rearrangement in overview mode b/32457561 Change-Id: Ic38fbd540616a74f26c19a09ab4247fe8f9174b4 --- src/com/android/launcher3/Workspace.java | 2 +- .../logging/UserEventDispatcher.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 340177d38d..950a40766a 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -2045,7 +2045,7 @@ public class Workspace extends PagedView CellLayout cl = ((CellLayout) getChildAt(i)); mScreenOrder.add(getIdForScreen(cl)); } - + mLauncher.getUserEventDispatcher().logOverviewReorder(); mLauncher.getModel().updateWorkspaceScreenOrder(mLauncher, mScreenOrder); // Re-enable auto layout transitions for page deletion. diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 56fdce8343..53a2f5dc8f 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -27,6 +27,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.LauncherEvent; import com.android.launcher3.userevent.nano.LauncherLogProto.Target; @@ -190,6 +191,25 @@ public class UserEventDispatcher { mPredictedApps = predictedApps; } + /* Currently we are only interested in whether this event happens or not and don't + * care about which screen moves to where. */ + public void logOverviewReorder() { + LauncherEvent event = new LauncherLogProto.LauncherEvent(); + + event.srcTarget = new LauncherLogProto.Target[2]; + event.srcTarget[0] = new LauncherLogProto.Target(); + event.srcTarget[0].type = Target.CONTAINER; + event.srcTarget[0].containerType = LauncherLogProto.WORKSPACE; + event.srcTarget[1] = new LauncherLogProto.Target(); + event.srcTarget[1].type = Target.CONTAINER; + event.srcTarget[1].containerType = LauncherLogProto.OVERVIEW; + + event.action = new LauncherLogProto.Action(); + event.action.type = Action.TOUCH; + event.action.touch = Action.DRAGDROP; + dispatchUserEvent(event, null); + + } public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) { LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, dragObj.dragView,