<UserEventLogging> Log app launches
b/26494415

1) Current Logger can capture taps from
- homescreen
- folder inside homescreen
- apps prediction
- all apps a-z
- tap from hotseat
2) Deprecate LauncherCallback methods that is no longer needed

Future CL.
3) Stats and Logger will be merged. Bundle used for Stats can be
replaced with LauncherLogProto
4) Logging anything else other than app launches

Change-Id: Id52eb615f66142017b5c490a220ce6654d325681
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index ce96261..7b53f9f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -108,6 +108,7 @@
 import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.dragndrop.DragView;
 import com.android.launcher3.model.WidgetsModel;
+import com.android.launcher3.userevent.Logger;
 import com.android.launcher3.util.ComponentKey;
 import com.android.launcher3.util.LongArrayMap;
 import com.android.launcher3.util.TestingUtils;
@@ -367,6 +368,8 @@
     }
 
     private Stats mStats;
+    private Logger mUserEventLogger;
+
     public FocusIndicatorView mFocusHandler;
     private boolean mRotationEnabled = false;
 
@@ -424,6 +427,7 @@
         mDragController = new DragController(this);
         mStateTransitionAnimation = new LauncherStateTransitionAnimation(this);
 
+        mUserEventLogger = new Logger(this);
         mStats = new Stats(this);
 
         mAppWidgetManager = AppWidgetManagerCompat.getInstance(this);
@@ -627,6 +631,7 @@
     public Stats getStats() {
         return mStats;
     }
+    public Logger getLogger() {return mUserEventLogger; }
 
     public boolean isDraggingEnabled() {
         // We prevent dragging when we are loading the workspace as it is possible to pick up a view
@@ -950,6 +955,7 @@
         }
 
         super.onResume();
+        mUserEventLogger.resetElapsedSessionMillis();
 
         // Restore the previous launcher state
         if (mOnResumeState == State.WORKSPACE) {
@@ -3331,6 +3337,7 @@
             getWindow().getDecorView()
                     .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
         }
+        mUserEventLogger.resetElapsedContainerMillis();
         return changed;
     }