am f5e59e12: am 2e4713a5: Merge "Check the length of the word when add to userhistory." into jb-mr1-dev

* commit 'f5e59e12c41337d1b3f9a967d79c9539bd52b907':
  Check the length of the word when add to userhistory.
main
Ken Wakasa 2012-09-04 02:39:33 -07:00 committed by Android Git Automerger
commit f70fdb0d47
1 changed files with 4 additions and 0 deletions

View File

@ -182,6 +182,10 @@ public class UserHistoryDictionary extends ExpandableDictionary {
* The second word may not be null (a NullPointerException would be thrown).
*/
public int addToUserHistory(final String word1, String word2, boolean isValid) {
if (word2.length() >= BinaryDictionary.MAX_WORD_LENGTH ||
(word1 != null && word1.length() >= BinaryDictionary.MAX_WORD_LENGTH)) {
return -1;
}
if (mBigramListLock.tryLock()) {
try {
super.addWord(