Skip to content
Snippets Groups Projects
Commit f356a25f authored by Jean Chalard's avatar Jean Chalard
Browse files

[DO NOT MERGE] Fix a bug where autocaps would jam auto-commit

Cherry-pick of I62955e36

Bug: 11311002
Change-Id: I5b11cb48e6dd0563fc29566fe0d27864be2beb0a
parent 47568d5e
No related branches found
No related tags found
No related merge requests found
......@@ -475,7 +475,7 @@ public final class Suggest {
}
return new SuggestedWordInfo(sb.toString(), wordInfo.mScore, wordInfo.mKind,
wordInfo.mSourceDict, wordInfo.mIndexOfTouchPointOfSecondWord,
SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */);
wordInfo.mAutoCommitFirstWordConfidence);
}
public void close() {
......
......@@ -25,6 +25,7 @@ import com.android.inputmethod.latin.utils.CollectionUtils;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Random;
@SmallTest
public class SuggestedWordsTests extends AndroidTestCase {
......@@ -72,15 +73,20 @@ public class SuggestedWordsTests extends AndroidTestCase {
return new SuggestedWordInfo(s, 100,
SuggestedWordInfo.KIND_TYPED, null /* sourceDict */,
SuggestedWordInfo.NOT_AN_INDEX /* indexOfTouchPointOfSecondWord */,
SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */);
new Random().nextInt(1000000) /* autoCommitFirstWordConfidence */);
}
// Helper for testGetTransformedWordInfo
private SuggestedWordInfo transformWordInfo(final String info,
final int trailingSingleQuotesCount) {
return Suggest.getTransformedSuggestedWordInfo(createWordInfo(info),
final SuggestedWordInfo suggestedWordInfo = createWordInfo(info);
final SuggestedWordInfo returnedWordInfo =
Suggest.getTransformedSuggestedWordInfo(suggestedWordInfo,
Locale.ENGLISH, false /* isAllUpperCase */, false /* isFirstCharCapitalized */,
trailingSingleQuotesCount);
assertEquals(suggestedWordInfo.mAutoCommitFirstWordConfidence,
returnedWordInfo.mAutoCommitFirstWordConfidence);
return returnedWordInfo;
}
public void testGetTransformedSuggestedWordInfo() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment