diff options
-rw-r--r-- | protos/launcher_log.proto | 1 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto index 37305555a..448cf6420 100644 --- a/protos/launcher_log.proto +++ b/protos/launcher_log.proto @@ -62,6 +62,7 @@ enum ItemType { WIDGET = 3; FOLDER_ICON = 4; DEEPSHORTCUT = 5; + SEARCHBOX = 6; } // Used to define what type of container a Target would represent. 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; |