Add logging for assistant gesture

Bug: 129867977
Change-Id: I6254bf06b7352f6076af229a581d4ebdd584a4a1
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index 85f9826..5518f09 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -142,6 +142,7 @@
     SWIPE = 3;
     FLING = 4;
     PINCH = 5;
+    SWIPE_NOOP = 6;
   }
 
   enum Direction {
@@ -150,6 +151,8 @@
     DOWN = 2;
     LEFT = 3;
     RIGHT = 4;
+    UPRIGHT = 5;
+    UPLEFT = 6;
   }
   enum Command {
     HOME_INTENT = 0;
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java
index c00b4dc..a1f4400 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java
@@ -21,6 +21,11 @@
 import static android.view.MotionEvent.ACTION_MOVE;
 import static android.view.MotionEvent.ACTION_POINTER_UP;
 import static android.view.MotionEvent.ACTION_UP;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.SWIPE;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.SWIPE_NOOP;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction.UPLEFT;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction.UPRIGHT;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.NAVBAR;
 
 import android.animation.ValueAnimator;
 import android.content.Context;
@@ -32,6 +37,7 @@
 import android.util.Log;
 import android.view.MotionEvent;
 import com.android.launcher3.anim.Interpolators;
+import com.android.launcher3.logging.UserEventDispatcher;
 import com.android.quickstep.util.MotionPauseDetector;
 import com.android.systemui.shared.recents.ISystemUiProxy;
 import com.android.launcher3.R;
@@ -66,6 +72,7 @@
     private long mDragTime;
     private float mLastProgress;
     private int mState;
+    private int mDirection;
 
     private final float mDistThreshold;
     private final long mTimeThreshold;
@@ -74,10 +81,12 @@
     private final MotionPauseDetector mMotionPauseDetector;
     private final ISystemUiProxy mSysUiProxy;
     private final InputConsumer mConsumerDelegate;
+    private final Context mContext;
 
     public AssistantTouchConsumer(Context context, ISystemUiProxy systemUiProxy,
             InputConsumer delegate) {
         final Resources res = context.getResources();
+        mContext = context;
         mSysUiProxy = systemUiProxy;
         mConsumerDelegate = delegate;
         mMotionPauseDetector = new MotionPauseDetector(context);
@@ -151,6 +160,7 @@
                         // Determine if angle is larger than threshold for assistant detection
                         float angle = (float) Math.toDegrees(
                                 Math.atan2(mDownPos.y - mLastPos.y, mDownPos.x - mLastPos.x));
+                        mDirection = angle > 90 ? UPLEFT : UPRIGHT;
                         angle = angle > 90 ? 180 - angle : angle;
                         if (angle > mAngleThreshold) {
                             mState = STATE_ASSISTANT_ACTIVE;
@@ -184,9 +194,12 @@
                 if (mState != STATE_DELEGATE_ACTIVE && !mLaunchedAssistant) {
                     ValueAnimator animator = ValueAnimator.ofFloat(mLastProgress, 0)
                             .setDuration(RETRACT_ANIMATION_DURATION_MS);
+                    UserEventDispatcher.newInstance(mContext).logActionOnContainer(
+                            SWIPE_NOOP, mDirection, NAVBAR);
                     animator.addUpdateListener(valueAnimator -> {
                             float progress = (float) valueAnimator.getAnimatedValue();
                             try {
+
                                 mSysUiProxy.onAssistantProgress(progress);
                             } catch (RemoteException e) {
                                 Log.w(TAG, "Failed to send SysUI start/send assistant progress: "
@@ -211,8 +224,9 @@
             mLastProgress = progress;
             try {
                 mSysUiProxy.onAssistantProgress(progress);
-
                 if (mDistance >= mDistThreshold && mTimeFraction >= 1) {
+                    UserEventDispatcher.newInstance(mContext).logActionOnContainer(
+                            SWIPE, mDirection, NAVBAR);
                     mSysUiProxy.startAssistant(new Bundle());
                     mLaunchedAssistant = true;
                 }
diff --git a/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java
index 4392851..6dff187 100644
--- a/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java
+++ b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java
@@ -34,7 +34,6 @@
  * quickstep interactions.
  */
 @SuppressWarnings("unused")
-@Deprecated
 public class UserEventDispatcherExtension extends UserEventDispatcher {
 
     private static final String TAG = "UserEventDispatcher";
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index e115168..6ccde62 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -62,7 +62,6 @@
  *
  * $ adb shell setprop log.tag.UserEvent VERBOSE
  */
-@Deprecated
 public class UserEventDispatcher implements ResourceBasedOverride {
 
     private static final String TAG = "UserEvent";