From d8fcffb8fe61a0288a85ac588ae51f7ed064f7c7 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 3 Oct 2016 14:01:25 -0700 Subject: [PATCH] Add user event logging for tap on search b/31772967 Change-Id: I71ececb8195d46405623a8ae2a99d001088d9181 --- src/com/android/launcher3/logging/LoggerUtils.java | 4 ++++ .../android/launcher3/logging/UserEventDispatcher.java | 18 +++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java index 845dbc2bc..c2b97eb2d 100644 --- a/src/com/android/launcher3/logging/LoggerUtils.java +++ b/src/com/android/launcher3/logging/LoggerUtils.java @@ -60,6 +60,7 @@ public class LoggerUtils { case LauncherLogProto.WIDGET: typeStr = "WIDGET"; break; case LauncherLogProto.DEEPSHORTCUT: typeStr = "DEEPSHORTCUT"; break; case LauncherLogProto.FOLDER_ICON: typeStr = "FOLDERICON"; break; + case LauncherLogProto.SEARCHBOX: typeStr = "SEARCHBOX"; break; default: typeStr = "UNKNOWN"; } @@ -73,6 +74,9 @@ public class LoggerUtils { if (t.intentHash != 0) { typeStr += ", intentHash=" + t.intentHash; } + if (t.spanX != 0) { + typeStr += ", spanX=" + t.spanX; + } return typeStr += ", grid=(" + t.gridX + "," + t.gridY + "), id=" + t.pageIndex; } diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index b5da04966..56fdce834 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -140,10 +140,6 @@ public class UserEventDispatcher { new ComponentKey(cn, itemInfo.user)); } } - - // Fill in the duration of time spent navigating in Launcher and the container. - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; return event; } @@ -159,8 +155,6 @@ public class UserEventDispatcher { LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.ITEM); event.action.touch = action; event.srcTarget[0].itemType = itemType; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -168,8 +162,6 @@ public class UserEventDispatcher { LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.CONTROL); event.action.touch = action; event.srcTarget[0].controlType = controlType; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -178,8 +170,6 @@ public class UserEventDispatcher { event.action.touch = action; event.action.dir = dir; event.srcTarget[0].containerType = containerType; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -193,8 +183,6 @@ public class UserEventDispatcher { ItemInfo info = (ItemInfo) icon.getTag(); provider.fillInLaunchSourceData(icon, info, event.srcTarget[0], event.srcTarget[1]); event.action.touch = Action.LONGPRESS; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -218,9 +206,6 @@ public class UserEventDispatcher { dragObj.dragInfo, event.destTarget[0], event.destTarget[1]); } - - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis; dispatchUserEvent(event, null); } @@ -242,6 +227,9 @@ public class UserEventDispatcher { } public void dispatchUserEvent(LauncherEvent ev, Intent intent) { + ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; + ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; + if (!mIsVerbose) { return; } -- 2.11.0