aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-15 17:57:38 +0900
committerJean Chalard <jchalard@google.com>2012-08-15 18:32:59 +0900
commite234aed4288efd7b4336f3755a958c25a1540b98 (patch)
tree4107e33951a3bfb4be7fe0b76cf68d63ddd7bff7 /java/src/com/android/inputmethod/latin/LatinIME.java
parent05384933097c1e9c35e8be5c03757d072e5ffa46 (diff)
downloadlatinime-e234aed4288efd7b4336f3755a958c25a1540b98.tar.gz
latinime-e234aed4288efd7b4336f3755a958c25a1540b98.tar.xz
latinime-e234aed4288efd7b4336f3755a958c25a1540b98.zip
Refresh editor info when the text field attributes changes.
For some reason we get a "restarting" flag from the browser some times when the input field is different. The attributes however are not the same, so we can detect that and reload appropriately. Bug: 6946793 Change-Id: I6762dae6f41db690497b026a707d9cc89c840b34
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 446d44e7a..884e6db29 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -670,7 +670,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
accessUtils.onStartInputViewInternal(mainKeyboardView, editorInfo, restarting);
}
- if (!restarting) {
+ final boolean selectionChanged = mLastSelectionStart != editorInfo.initialSelStart
+ || mLastSelectionEnd != editorInfo.initialSelEnd;
+ final boolean inputTypeChanged = !mCurrentSettings.isSameInputType(editorInfo);
+ final boolean isDifferentTextField = !restarting || inputTypeChanged;
+ if (isDifferentTextField) {
mSubtypeSwitcher.updateParametersOnStartInputView();
}
@@ -679,9 +683,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
updateFullscreenMode();
mApplicationSpecifiedCompletions = null;
- final boolean selectionChanged = mLastSelectionStart != editorInfo.initialSelStart
- || mLastSelectionEnd != editorInfo.initialSelEnd;
- if (!restarting || selectionChanged) {
+ if (isDifferentTextField || selectionChanged) {
// If the selection changed, we reset the input state. Essentially, we come here with
// restarting == true when the app called setText() or similar. We should reset the
// state if the app set the text to something else, but keep it if it set a suggestion
@@ -696,7 +698,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- if (!restarting) {
+ if (isDifferentTextField) {
mainKeyboardView.closing();
loadSettings();