Remove a meaningless separation (A18)

Change-Id: I267177044c7d7b0d9119839a11057b2bbf41f75f
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 3b420aab..4e8bf19 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -59,10 +59,8 @@
     public static final String DICT_KEY_CONTACTS = "contacts";
     // User dictionary, the system-managed one.
     public static final String DICT_KEY_USER = "user";
-    // User history dictionary for the unigram map, internal to LatinIME
-    public static final String DICT_KEY_USER_HISTORY_UNIGRAM = "history_unigram";
-    // User history dictionary for the bigram map, internal to LatinIME
-    public static final String DICT_KEY_USER_HISTORY_BIGRAM = "history_bigram";
+    // User history dictionary internal to LatinIME
+    public static final String DICT_KEY_USER_HISTORY = "history";
     public static final String DICT_KEY_WHITELIST ="whitelist";
     // TODO: remove this map. This only serves as backward compatibility with a feature
     // that has never been used and has been broken for a while.
@@ -71,8 +69,7 @@
     static {
         sDictKeyToDictIndex.put(DICT_KEY_MAIN, DIC_MAIN);
         sDictKeyToDictIndex.put(DICT_KEY_USER, DIC_USER);
-        sDictKeyToDictIndex.put(DICT_KEY_USER_HISTORY_UNIGRAM, DIC_USER_HISTORY);
-        sDictKeyToDictIndex.put(DICT_KEY_USER_HISTORY_BIGRAM, DIC_USER_HISTORY);
+        sDictKeyToDictIndex.put(DICT_KEY_USER_HISTORY, DIC_USER_HISTORY);
         sDictKeyToDictIndex.put(DICT_KEY_CONTACTS, DIC_CONTACTS);
         sDictKeyToDictIndex.put(DICT_KEY_WHITELIST, DIC_WHITELIST);
     }
@@ -195,10 +192,8 @@
     }
 
     public void setUserHistoryDictionary(UserHistoryDictionary userHistoryDictionary) {
-        addOrReplaceDictionary(mUnigramDictionaries, DICT_KEY_USER_HISTORY_UNIGRAM,
-                userHistoryDictionary);
-        addOrReplaceDictionary(mBigramDictionaries, DICT_KEY_USER_HISTORY_BIGRAM,
-                userHistoryDictionary);
+        addOrReplaceDictionary(mUnigramDictionaries, DICT_KEY_USER_HISTORY, userHistoryDictionary);
+        addOrReplaceDictionary(mBigramDictionaries, DICT_KEY_USER_HISTORY, userHistoryDictionary);
     }
 
     public void setAutoCorrectionThreshold(float threshold) {
@@ -269,8 +264,8 @@
                     }
                     for (final SuggestedWordInfo suggestion : suggestions) {
                         final String suggestionStr = suggestion.mWord.toString();
-                        oldAddWord(suggestionStr.toCharArray(), null, 0, suggestionStr.length(),
-                                suggestion.mScore, dicTypeId, Dictionary.BIGRAM);
+                        addWord(suggestionStr.toCharArray(), null, 0, suggestionStr.length(),
+                                suggestion.mScore, dicTypeId, Dictionary.BIGRAM, mSuggestions);
                     }
                 }
             }
@@ -287,7 +282,7 @@
             // At second character typed, search the unigrams (scores being affected by bigrams)
             for (final String key : mUnigramDictionaries.keySet()) {
                 // Skip UserUnigramDictionary and WhitelistDictionary to lookup
-                if (key.equals(DICT_KEY_USER_HISTORY_UNIGRAM) || key.equals(DICT_KEY_WHITELIST))
+                if (key.equals(DICT_KEY_USER_HISTORY) || key.equals(DICT_KEY_WHITELIST))
                     continue;
                 final int dicTypeId = sDictKeyToDictIndex.get(key);
                 final Dictionary dictionary = mUnigramDictionaries.get(key);
@@ -295,8 +290,8 @@
                         wordComposerForLookup, prevWordForBigram, proximityInfo);
                 for (final SuggestedWordInfo suggestion : suggestions) {
                     final String suggestionStr = suggestion.mWord.toString();
-                    oldAddWord(suggestionStr.toCharArray(), null, 0, suggestionStr.length(),
-                            suggestion.mScore, dicTypeId, Dictionary.UNIGRAM);
+                    addWord(suggestionStr.toCharArray(), null, 0, suggestionStr.length(),
+                            suggestion.mScore, dicTypeId, Dictionary.UNIGRAM, mSuggestions);
                 }
             }
         }
@@ -404,13 +399,11 @@
     }
 
     // TODO: Use codepoint instead of char
-    public boolean oldAddWord(final char[] word, int[] indices, final int offset, final int length,
-            int score, final int dicTypeId, final int dataType) {
+    public boolean addWord(final char[] word, int[] indices, final int offset, final int length,
+            int score, final int dicTypeId, final int dataType,
+            final ArrayList<SuggestedWordInfo> suggestions) {
         int dataTypeForLog = dataType;
-        final ArrayList<SuggestedWordInfo> suggestions;
-        final int prefMaxSuggestions;
-        suggestions = mSuggestions;
-        prefMaxSuggestions = MAX_SUGGESTIONS;
+        final int prefMaxSuggestions = MAX_SUGGESTIONS;
 
         int pos = 0;
 
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index 3bf18c5..5f4d660 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -238,8 +238,8 @@
             mScores = new int[mMaxLength];
         }
 
-        synchronized public boolean oldAddWord(char[] word, int[] spaceIndices, int wordOffset,
-                int wordLength, int score, int dicTypeId /* unused */, int dataType) {
+        synchronized public boolean addWord(char[] word, int[] spaceIndices, int wordOffset,
+                int wordLength, int score) {
             final int positionIndex = Arrays.binarySearch(mScores, 0, mLength, score);
             // binarySearch returns the index if the element exists, and -<insertion index> - 1
             // if it doesn't. See documentation for binarySearch.
@@ -784,9 +784,8 @@
                             composer, prevWord, dictInfo.mProximityInfo);
                     for (final SuggestedWordInfo suggestion : suggestions) {
                         final String suggestionStr = suggestion.mWord.toString();
-                        suggestionsGatherer.oldAddWord(suggestionStr.toCharArray(), null, 0,
-                                suggestionStr.length(), suggestion.mScore, 0 /* ignored */,
-                                Dictionary.UNIGRAM);
+                        suggestionsGatherer.addWord(suggestionStr.toCharArray(), null, 0,
+                                suggestionStr.length(), suggestion.mScore);
                     }
                     isInDict = dictInfo.mDictionary.isValidWord(text);
                     if (!isInDict && CAPITALIZE_NONE != capitalizeType) {