aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-09-17 17:16:59 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-09-18 18:51:23 +0900
commitf4c7eb478f67874e81cce786bf91ab112da316e1 (patch)
tree58feda8ba625620d26dba73d868c19806277fc59 /java/src/com/android/inputmethod/latin/Suggest.java
parent90f06760b917fcd8ce47228c4a541059c0075d72 (diff)
downloadlatinime-f4c7eb478f67874e81cce786bf91ab112da316e1.tar.gz
latinime-f4c7eb478f67874e81cce786bf91ab112da316e1.tar.xz
latinime-f4c7eb478f67874e81cce786bf91ab112da316e1.zip
Fix showing important notice even at beginning of sentence
This is a cherry-pick of Ic72d6fecc3 from lmp-dev. Bug: 17536096 Change-Id: Id76b8f8dc85d03bc7ed5f24800301c081a82a8d2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 4ad5ba65e..1ecc995b2 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -188,8 +188,14 @@ public final class Suggest {
suggestionsList = suggestionsContainer;
}
- final int inputStyle = resultsArePredictions ? SuggestedWords.INPUT_STYLE_PREDICTION :
- inputStyleIfNotPrediction;
+ final int inputStyle;
+ if (resultsArePredictions) {
+ inputStyle = suggestionResults.mIsBeginningOfSentence
+ ? SuggestedWords.INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION
+ : SuggestedWords.INPUT_STYLE_PREDICTION;
+ } else {
+ inputStyle = inputStyleIfNotPrediction;
+ }
callback.onGetSuggestedWords(new SuggestedWords(suggestionsList,
suggestionResults.mRawSuggestions,
// TODO: this first argument is lying. If this is a whitelisted word which is an
@@ -244,6 +250,8 @@ public final class Suggest {
// In the batch input mode, the most relevant suggested word should act as a "typed word"
// (typedWordValid=true), not as an "auto correct word" (willAutoCorrect=false).
+ // Note that because this method is never used to get predictions, there is no need to
+ // modify inputType such in getSuggestedWordsForNonBatchInput.
callback.onGetSuggestedWords(new SuggestedWords(suggestionsContainer,
suggestionResults.mRawSuggestions,
true /* typedWordValid */,