Add autocomplete suggestion analytics.

Change-Id: Ib116e1a66ee50a59fd589eefdae0bb7d67fb7294
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 7903ab9..46fb6cc 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -126,7 +126,8 @@
 public class ComposeActivity extends Activity implements OnClickListener, OnNavigationListener,
         RespondInlineListener, TextWatcher,
         AttachmentAddedOrDeletedListener, OnAccountChangedListener,
-        LoaderManager.LoaderCallbacks<Cursor>, TextView.OnEditorActionListener {
+        LoaderManager.LoaderCallbacks<Cursor>, TextView.OnEditorActionListener,
+        RecipientEditTextView.RecipientEntryItemClickedListener {
     /**
      * An {@link Intent} action that launches {@link ComposeActivity}, but is handled as if the
      * {@link Activity} were launched with no special action.
@@ -2041,6 +2042,7 @@
 
     private void setupRecipients(RecipientEditTextView view) {
         view.setAdapter(new RecipientAdapter(this, mAccount));
+        view.setRecipientEntryItemClickedListener(this);
         if (mValidator == null) {
             final String accountName = mAccount.getEmailAddress();
             int offset = accountName.indexOf("@") + 1;
@@ -2209,6 +2211,13 @@
         sendOrSaveWithSanityChecks(true, showToast, false, false);
     }
 
+    @Override
+    public void onRecipientEntryItemClicked(int charactersTyped, int position) {
+        // Send analytics of characters typed and position in dropdown selected.
+        Analytics.getInstance().sendEvent(
+                "suggest_click", Integer.toString(charactersTyped), Integer.toString(position), 0);
+    }
+
     @VisibleForTesting
     public interface SendOrSaveCallback {
         public void initializeSendOrSave(SendOrSaveTask sendOrSaveTask);