Add spinner for smart replies.

Add a spinner to MessagingGroup that is enabled
when the user has clicked on a smart reply.

Bug: 73607490
Test: atest SystemUiTests

Change-Id: I4d892c19b5df2b443761819929a83f016967e217
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
index 1431682..b4fa2e8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
@@ -26,7 +26,7 @@
 import com.android.systemui.Dependency;
 import com.android.systemui.R;
 import com.android.systemui.statusbar.NotificationData;
-import com.android.systemui.statusbar.SmartReplyLogger;
+import com.android.systemui.statusbar.SmartReplyController;
 import com.android.systemui.statusbar.notification.NotificationUtils;
 import com.android.systemui.statusbar.phone.KeyguardDismissUtil;
 
@@ -73,6 +73,8 @@
 
     private PriorityQueue<Button> mCandidateButtonQueueForSqueezing;
 
+    private View mSmartReplyContainer;
+
     public SmartReplyView(Context context, AttributeSet attrs) {
         super(context, attrs);
         mConstants = Dependency.get(SmartReplyConstants.class);
@@ -133,7 +135,9 @@
     }
 
     public void setRepliesFromRemoteInput(RemoteInput remoteInput, PendingIntent pendingIntent,
-            SmartReplyLogger smartReplyLogger, NotificationData.Entry entry) {
+            SmartReplyController smartReplyController, NotificationData.Entry entry,
+            View smartReplyContainer) {
+        mSmartReplyContainer = smartReplyContainer;
         removeAllViews();
         if (remoteInput != null && pendingIntent != null) {
             CharSequence[] choices = remoteInput.getChoices();
@@ -141,7 +145,7 @@
                 for (int i = 0; i < choices.length; ++i) {
                     Button replyButton = inflateReplyButton(
                             getContext(), this, i, choices[i], remoteInput, pendingIntent,
-                            smartReplyLogger, entry);
+                            smartReplyController, entry);
                     addView(replyButton);
                 }
             }
@@ -157,7 +161,7 @@
     @VisibleForTesting
     Button inflateReplyButton(Context context, ViewGroup root, int replyIndex,
             CharSequence choice, RemoteInput remoteInput, PendingIntent pendingIntent,
-            SmartReplyLogger smartReplyLogger, NotificationData.Entry entry) {
+            SmartReplyController smartReplyController, NotificationData.Entry entry) {
         Button b = (Button) LayoutInflater.from(context).inflate(
                 R.layout.smart_reply_button, root, false);
         b.setText(choice);
@@ -173,7 +177,8 @@
             } catch (PendingIntent.CanceledException e) {
                 Log.w(TAG, "Unable to send smart reply", e);
             }
-            smartReplyLogger.smartReplySent(entry, replyIndex);
+            smartReplyController.smartReplySent(entry, replyIndex, b.getText());
+            mSmartReplyContainer.setVisibility(View.GONE);
             return false; // do not defer
         };