summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-09-27 18:07:00 -0700
committerHyunyoung Song <hyunyoungs@google.com>2016-09-27 18:07:00 -0700
commitffad962092e2b42e336918c2f1e8f5ec48cc08a9 (patch)
tree5ec83c94841640937113760df60592ef98e810f5 /src
parent1b7e9bc063117f53d053bec003da34079aa11380 (diff)
downloadandroid_packages_apps_Trebuchet-ffad962092e2b42e336918c2f1e8f5ec48cc08a9.tar.gz
android_packages_apps_Trebuchet-ffad962092e2b42e336918c2f1e8f5ec48cc08a9.tar.bz2
android_packages_apps_Trebuchet-ffad962092e2b42e336918c2f1e8f5ec48cc08a9.zip
Add user event logging for action on search box
b/31772967 Change-Id: Ide652ddfad931e392b21f5a2bbdf9f07729d0383
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/logging/UserEventDispatcher.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index 0356a9c7b..b5da04966 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 {
@@ -152,6 +155,15 @@ 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;
+ event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis;
+ event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis;
+ dispatchUserEvent(event, null);
+ }
+
public void logActionOnControl(int action, int controlType) {
LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.CONTROL);
event.action.touch = action;