@Override
  public void pickSuggestionManually(
      int index, CharSequence suggestion, boolean withAutoSpaceEnabled) {
    if (getCurrentComposedWord().isAtTagsSearchState()) {
      if (index == 0) {
        // this is a special case for tags-searcher
        // since we append a magnifying glass to the suggestions, the "suggestion"
        // value is not a valid output suggestion
        suggestion = getCurrentComposedWord().getTypedWord().toString();
      } else {
        // regular emoji. Storing in history.
        getQuickKeyHistoryRecords().store(suggestion.toString(), suggestion.toString());
      }
    }

    super.pickSuggestionManually(index, suggestion, withAutoSpaceEnabled);
  }
@Test
  public void testPickingTypedTagDoesNotTryToAddToAutoDictionary() throws Exception {
    verifyNoSuggestionsInteractions();
    mAnySoftKeyboardUnderTest.simulateTextTyping(":face");

    Mockito.reset(mAnySoftKeyboardUnderTest.getSuggest());
    mAnySoftKeyboardUnderTest.pickSuggestionManually(0, ":face");

    Mockito.verify(mAnySoftKeyboardUnderTest.getSuggest(), Mockito.never())
        .isValidWord(Mockito.any(CharSequence.class));
  }