aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index a0e55c65f..330be377b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -94,7 +94,6 @@ import com.android.inputmethod.latin.utils.ViewLayoutUtils;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
@@ -793,6 +792,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@SuppressWarnings("deprecation")
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
super.onStartInputView(editorInfo, restarting);
+
+ mDictionaryFacilitator.onStartInput();
// Switch to the null consumer to handle cases leading to early exit below, for which we
// also wouldn't be consuming gesture data.
mGestureConsumer = GestureConsumer.NULL_GESTURE_CONSUMER;
@@ -971,6 +972,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
void onFinishInputInternal() {
super.onFinishInput();
+ mDictionaryFacilitator.onFinishInput();
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
if (mainKeyboardView != null) {
mainKeyboardView.closing();
@@ -1255,7 +1257,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Implement {@link ImportantNoticeDialog.ImportantNoticeDialogListener}
@Override
public void onClickSettingsOfImportantNoticeDialog(final int nextVersion) {
- launchSettings();
+ launchSettings(SettingsActivity.EXTRA_ENTRY_VALUE_NOTICE_DIALOG);
}
// Implement {@link ImportantNoticeDialog.ImportantNoticeDialogListener}
@@ -1384,7 +1386,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onUpdateBatchInput(final InputPointers batchPointers) {
- mInputLogic.onUpdateBatchInput(mSettings.getCurrent(), batchPointers, mKeyboardSwitcher);
+ mInputLogic.onUpdateBatchInput(batchPointers);
}
@Override
@@ -1408,7 +1410,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
*/
public void onTailBatchInputResultShown(final SuggestedWords suggestedWords) {
mGestureConsumer.onImeSuggestionsProcessed(suggestedWords,
- mInputLogic.getComposingStart(), mInputLogic.getComposingLength());
+ mInputLogic.getComposingStart(), mInputLogic.getComposingLength(),
+ mDictionaryFacilitator);
}
// This method must run on the UI Thread.
@@ -1451,7 +1454,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
final boolean shouldShowImportantNotice =
- ImportantNoticeUtils.shouldShowImportantNotice(this);
+ ImportantNoticeUtils.shouldShowImportantNotice(this, currentSettingsValues);
final boolean shouldShowSuggestionCandidates =
currentSettingsValues.mInputAttributes.mShouldShowSuggestions
&& currentSettingsValues.isSuggestionsEnabledPerUserSettings();
@@ -1531,10 +1534,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// punctuation suggestions (if it's disabled).
@Override
public void setNeutralSuggestionStrip() {
- setSuggestedWords(SuggestedWords.getEmptyInstance());
+ final SettingsValues currentSettings = mSettings.getCurrent();
+ final SuggestedWords neutralSuggestions = currentSettings.mBigramPredictionEnabled
+ ? SuggestedWords.getEmptyInstance()
+ : currentSettings.mSpacingAndPunctuations.mSuggestPuncList;
+ setSuggestedWords(neutralSuggestions);
}
- // TODO: Make this private
// Outside LatinIME, only used by the {@link InputTestsBase} test suite.
@UsedForTesting
void loadKeyboard() {
@@ -1692,7 +1698,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
};
- void launchSettings() {
+ void launchSettings(final String extraEntryValue) {
mInputLogic.commitTyped(mSettings.getCurrent(), LastComposedWord.NOT_A_SEPARATOR);
requestHideSelf(0);
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
@@ -1705,6 +1711,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(SettingsActivity.EXTRA_SHOW_HOME_AS_UP, false);
+ intent.putExtra(SettingsActivity.EXTRA_ENTRY_KEY, extraEntryValue);
startActivity(intent);
}
@@ -1732,7 +1739,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
startActivity(intent);
break;
case 1:
- launchSettings();
+ launchSettings(SettingsActivity.EXTRA_ENTRY_VALUE_LONG_PRESS_COMMA);
break;
}
}
@@ -1764,7 +1771,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
dialog.show();
}
- // TODO: can this be removed somehow without breaking the tests?
@UsedForTesting
SuggestedWords getSuggestedWordsForTest() {
// You may not use this method for anything else than debug