Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
a118d19f
Commit
a118d19f
authored
11 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Don't distrust the cursor pos so much as to bug on IPC delay"
parents
e03e4257
3c84eb88
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/LatinIME.java
+6
-3
6 additions, 3 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
java/src/com/android/inputmethod/latin/RichInputConnection.java
+0
-14
0 additions, 14 deletions
...rc/com/android/inputmethod/latin/RichInputConnection.java
with
6 additions
and
17 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
+
6
−
3
View file @
a118d19f
...
@@ -799,19 +799,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -799,19 +799,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
suggest
=
mInputLogic
.
mSuggest
;
suggest
=
mInputLogic
.
mSuggest
;
}
}
// Sometimes, while rotating, for some reason the framework tells the app we are not
// connected to it and that means we can't refresh the cache. In this case, schedule a
// refresh later.
// TODO[IL]: Can the following be moved to InputLogic#startInput?
// TODO[IL]: Can the following be moved to InputLogic#startInput?
final
boolean
canReachInputConnection
;
final
boolean
canReachInputConnection
;
if
(!
mInputLogic
.
mConnection
.
resetCachesUponCursorMoveAndReturnSuccess
(
if
(!
mInputLogic
.
mConnection
.
resetCachesUponCursorMoveAndReturnSuccess
(
editorInfo
.
initialSelStart
,
editorInfo
.
initialSelEnd
,
editorInfo
.
initialSelStart
,
editorInfo
.
initialSelEnd
,
false
/* shouldFinishComposition */
))
{
false
/* shouldFinishComposition */
))
{
// Sometimes, while rotating, for some reason the framework tells the app we are not
// connected to it and that means we can't refresh the cache. In this case, schedule a
// refresh later.
// We try resetting the caches up to 5 times before giving up.
// We try resetting the caches up to 5 times before giving up.
mHandler
.
postResetCaches
(
isDifferentTextField
,
5
/* remainingTries */
);
mHandler
.
postResetCaches
(
isDifferentTextField
,
5
/* remainingTries */
);
// mLastSelection{Start,End} are reset later in this method, don't need to do it here
// mLastSelection{Start,End} are reset later in this method, don't need to do it here
canReachInputConnection
=
false
;
canReachInputConnection
=
false
;
}
else
{
}
else
{
// When rotating, initialSelStart and initialSelEnd sometimes are lying. Make a best
// effort to work around this bug.
mInputLogic
.
mConnection
.
tryFixLyingCursorPosition
();
if
(
isDifferentTextField
)
{
if
(
isDifferentTextField
)
{
mHandler
.
postResumeSuggestions
();
mHandler
.
postResumeSuggestions
();
}
}
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/RichInputConnection.java
+
0
−
14
View file @
a118d19f
...
@@ -172,20 +172,6 @@ public final class RichInputConnection {
...
@@ -172,20 +172,6 @@ public final class RichInputConnection {
Log
.
d
(
TAG
,
"Will try to retrieve text later."
);
Log
.
d
(
TAG
,
"Will try to retrieve text later."
);
return
false
;
return
false
;
}
}
final
int
lengthOfTextBeforeCursor
=
mCommittedTextBeforeComposingText
.
length
();
if
(
lengthOfTextBeforeCursor
>
newSelStart
||
(
newSelStart
!=
lengthOfTextBeforeCursor
&&
lengthOfTextBeforeCursor
<
Constants
.
EDITOR_CONTENTS_CACHE_SIZE
&&
newSelStart
<
Constants
.
EDITOR_CONTENTS_CACHE_SIZE
))
{
// newSelStart and newSelEnd may be lying -- when rotating the device (probably a
// framework bug). If the values don't agree and we have less chars than we asked
// for, then we know how many chars we have. If we got more than newSelStart says, then
// we also know it was lying. In both cases the length is more reliable. Note that we
// only have to check newSelStart (not newSelEnd) since if newSelEnd is wrong, then
// newSelStart will be wrong as well.
mExpectedSelStart
=
lengthOfTextBeforeCursor
;
mExpectedSelEnd
=
lengthOfTextBeforeCursor
;
}
if
(
null
!=
mIC
&&
shouldFinishComposition
)
{
if
(
null
!=
mIC
&&
shouldFinishComposition
)
{
mIC
.
finishComposingText
();
mIC
.
finishComposingText
();
if
(
ProductionFlag
.
USES_DEVELOPMENT_ONLY_DIAGNOSTICS
)
{
if
(
ProductionFlag
.
USES_DEVELOPMENT_ONLY_DIAGNOSTICS
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment