diff options
Diffstat (limited to 'src/com/android/launcher3/logging/UserEventDispatcher.java')
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 0356a9c7b..56fdce834 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -37,6 +37,9 @@ import java.util.Locale; /** * Manages the creation of {@link LauncherEvent}. + * To debug this class, execute following command before sideloading a new apk. + * + * $ adb shell setprop log.tag.UserEvent VERBOSE */ public class UserEventDispatcher { @@ -137,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; } @@ -152,12 +151,17 @@ public class UserEventDispatcher { dispatchUserEvent(ev, intent); } + public void logActionOnItem(int action, int itemType) { + LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.ITEM); + event.action.touch = action; + event.srcTarget[0].itemType = itemType; + dispatchUserEvent(event, null); + } + public void logActionOnControl(int action, int controlType) { 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); } @@ -166,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); } @@ -181,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); } @@ -206,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); } @@ -230,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; } |