Add user event logging for clear all button
Bug: 72222505

----------------------------------------------
Verified

UserEvent: action:TAP
UserEvent:  Source child:CLEAR_ALL_BUTTON
UserEvent:  Elapsed container 8142 ms, session 11322 ms, action 0 ms
----------------------------------------------
Change-Id: I3ace51c30129728017c5eb198c52ab1bfd94c0ac
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index 4013429..7e15434 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -106,6 +106,7 @@
   BACK_BUTTON = 11; // Deprecated, use enum Command instead
   // GO_TO_PLAYSTORE
   QUICK_SCRUB_BUTTON = 12;
+  CLEAR_ALL_BUTTON = 13;
 }
 
 // Used to define the action component of the LauncherEvent.
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 6b89b66..6381fef 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -1,5 +1,8 @@
 package com.android.quickstep.views;
 
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.CLEAR_ALL_BUTTON;
+
 import android.content.Context;
 import android.graphics.Rect;
 import android.util.AttributeSet;
@@ -9,6 +12,7 @@
 import android.view.View;
 
 import com.android.launcher3.InsettableFrameLayout;
+import com.android.launcher3.Launcher;
 import com.android.launcher3.R;
 
 public class RecentsViewContainer extends InsettableFrameLayout {
@@ -29,9 +33,12 @@
 
     private RecentsView mRecentsView;
     private View mClearAllButton;
+    private final Context mContext;
+
 
     public RecentsViewContainer(Context context, AttributeSet attrs) {
         super(context, attrs);
+        mContext = context;
     }
 
     @Override
@@ -40,6 +47,8 @@
 
         mClearAllButton = findViewById(R.id.clear_all_button);
         mClearAllButton.setOnClickListener((v) -> {
+            Launcher.getLauncher(mContext).getUserEventDispatcher()
+                    .logActionOnControl(TAP, CLEAR_ALL_BUTTON);
             mRecentsView.dismissAllTasks();
         });