diff options
author | Tony Wickham <twickham@google.com> | 2016-08-10 16:06:22 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-08-10 18:26:41 -0700 |
commit | be06874c8105cf1beec8171235600da9f4ee035e (patch) | |
tree | c328c49a09e9da56de3fc14c814d598c79584beb /src/com/android/launcher3/logging | |
parent | 37aba27bbcc89417588a638d61099288553387df (diff) | |
download | android_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.tar.gz android_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.tar.bz2 android_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.zip |
Log shortcuts open on ACTION_UP instead of in showForIcon().
- We only want to log when the container is opened and potentially
used, not when a long press is followed by a drag-and-drop.
- Also cleaned up code that was determining the container of the
app icon, since LaunchSourceProvider.fillInLaunchSourceData()
can do that instead (it's more robust and consistent).
Bug: 30791570
Change-Id: I05b6750f26182fda8a9940ac66f1371c2d228ca9
Diffstat (limited to 'src/com/android/launcher3/logging')
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index e780cc91b..64a5f573d 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -147,12 +147,14 @@ public class UserEventDispatcher { dispatchUserEvent(event, null); } - public void logDeepShortcutsOpen(int containerType) { + public void logDeepShortcutsOpen(View icon) { LauncherEvent event = LoggerUtils.initLauncherEvent( Action.TOUCH, Target.ITEM, Target.CONTAINER); - event.action.touch = Action.LONGPRESS; + LaunchSourceProvider provider = getLaunchProviderRecursive(icon); + ItemInfo info = (ItemInfo) icon.getTag(); + provider.fillInLaunchSourceData(icon, info, event.srcTarget[0], event.srcTarget[1]); event.srcTarget[0].itemType = LauncherLogProto.DEEPSHORTCUT; - event.srcTarget[1].containerType = containerType; + event.action.touch = Action.LONGPRESS; event.elapsedContainerMillis = System.currentTimeMillis() - mElapsedContainerMillis; event.elapsedSessionMillis = System.currentTimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); |