Quick step/scrub/switch logging
- state transition happening due to Home and back is handled by
  specifying src target as 'from' container and dst target as the 'to'
  container
- Source and Destination container shows FROM and TO state for SWIPE/FLING
- event.isStateChange = true indicates that an action resulted in
  state transition
- Elapsed container millis is the screen time on the source container

Bug: 70181187

- logcat printout with setprop log.tag.UserEvent VERBOSE
1) State: WORKSPACE -> ALLAPPS
  action:FLING direction=UP
  Source child:HOTSEAT id=0	parent:WORKSPACE id=0
  Destination child:ALLAPPS
  Elapsed container 1225 ms, session 1225 ms, action 0 ms

2) ALLAPPS -> HOMESCREEN
  action:FLING direction=DOWN
  Source child:ALLAPPS	parent:ALLAPPS
  Destination child:WORKSPACE id=0
  Elapsed container 971 ms, session 2197 ms, action 0 ms

3) HOMESCREEN -> OVERVIEW
  action:FLING direction=UP
  Source child:NAVBAR	parent:WORKSPACE id=0
  Destination child:TASKSWITCHER
  Elapsed container 4834 ms, session 4834 ms, action 0 ms

4) OVERVIEW-> ALLAPPS
  action:FLING direction=UP
  Source child:TASK	parent:TASKSWITCHER
  Destination child:ALLAPPS
  Elapsed container 2176 ms, session 7010 ms, action 0 ms

5) ALLAPPS->OVERVIEW
  action:FLING direction=DOWN
  Source child:ALLAPPS	parent:ALLAPPS
  Destination child:TASKSWITCHER
  Elapsed container 3683 ms, session 10693 ms, action 0 ms

6) OVERVIEW-> HOMESCREEN
  action:FLING direction=DOWN
  Source child:TASK	parent:TASKSWITCHER
  Destination child:WORKSPACE id=0
  Elapsed container 2108 ms, session 12801 ms, action 0 ms

7) APPS-> OVERVIEW
  action:FLING direction=UP
  Source child:NAVBAR	parent:APP
  Destination child:TASKSWITCHER
  Elapsed container 104 ms, session 104 ms, action 0 ms

8) Quickscrub: action:DRAGANDDROP Source child: QUICK

9) Quickswitch: action:FLING Source child: QUICK

Change-Id: I5898230859ff600f48a2a873a40b670fe4d39a0d
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b4093b7..f76d4eb 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -783,7 +783,7 @@
 
         if (!mAppLaunchSuccess) {
             getUserEventDispatcher().logActionCommand(Action.Command.STOP,
-                    mStateManager.getState().containerType);
+                    mStateManager.getState().containerType, -1);
         }
         NotificationListener.removeNotificationsChangedListener();
         getStateManager().moveToRestState();
@@ -1280,7 +1280,8 @@
                 } else if (alreadyOnHome) {
                     Target target = newContainerTarget(mStateManager.getState().containerType);
                     target.pageIndex = mWorkspace.getCurrentPage();
-                    ued.logActionCommand(Action.Command.HOME_INTENT, target);
+                    ued.logActionCommand(Action.Command.HOME_INTENT, target,
+                            newContainerTarget(ContainerType.WORKSPACE));
                 }
 
                 // In all these cases, only animate if we're already on home
@@ -1656,7 +1657,8 @@
             topView.onBackPressed();
         } else if (!isInState(NORMAL)) {
             LauncherState lastState = mStateManager.getLastState();
-            ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType);
+            ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType,
+                    lastState.containerType);
             mStateManager.goToState(lastState);
         } else {
             // Back button is a no-op here, but give at least some feedback for the button press
@@ -1682,7 +1684,7 @@
 
         if (v instanceof Workspace) {
             if (isInState(OVERVIEW)) {
-                getUserEventDispatcher().logActionOnContainer(LauncherLogProto.Action.Type.TOUCH,
+                getUserEventDispatcher().logActionOnContainer(LauncherLogProto.Action.Touch.TAP,
                         LauncherLogProto.Action.Direction.NONE,
                         LauncherLogProto.ContainerType.OVERVIEW, mWorkspace.getCurrentPage());
                 mStateManager.goToState(NORMAL);
@@ -1693,7 +1695,7 @@
         if (v instanceof CellLayout) {
             if (isInState(OVERVIEW)) {
                 int page = mWorkspace.indexOfChild(v);
-                getUserEventDispatcher().logActionOnContainer(LauncherLogProto.Action.Type.TOUCH,
+                getUserEventDispatcher().logActionOnContainer(LauncherLogProto.Action.Touch.TAP,
                         LauncherLogProto.Action.Direction.NONE,
                         LauncherLogProto.ContainerType.OVERVIEW, page);
                 mWorkspace.snapToPageFromOverView(page);