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
42de819a
Commit
42de819a
authored
11 years ago
by
Jean Chalard
Committed by
Android Git Automerger
11 years ago
Browse files
Options
Downloads
Plain Diff
am
1875860d
: Stopgap solution for a crash.
* commit '
1875860d
': Stopgap solution for a crash.
parents
d869e1fd
1875860d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/RichInputConnection.java
+8
-1
8 additions, 1 deletion
...rc/com/android/inputmethod/latin/RichInputConnection.java
with
8 additions
and
1 deletion
java/src/com/android/inputmethod/latin/RichInputConnection.java
+
8
−
1
View file @
42de819a
...
...
@@ -294,7 +294,14 @@ public final class RichInputConnection {
// the text field, then we can return the cached version right away.
if
(
cachedLength
>=
n
||
cachedLength
>=
mExpectedCursorPosition
)
{
final
StringBuilder
s
=
new
StringBuilder
(
mCommittedTextBeforeComposingText
);
s
.
append
(
mComposingText
);
// We call #toString() here to create a temporary object.
// In some situations, this method is called on a worker thread, and it's possible
// the main thread touches the contents of mComposingText while this worker thread
// is suspended, because mComposingText is a StringBuilder. This may lead to crashes,
// so we call #toString() on it. That will result in the return value being strictly
// speaking wrong, but since this is used for basing bigram probability off, and
// it's only going to matter for one getSuggestions call, it's fine in the practice.
s
.
append
(
mComposingText
.
toString
());
if
(
s
.
length
()
>
n
)
{
s
.
delete
(
0
,
s
.
length
()
-
n
);
}
...
...
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