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
03ca17c8
Commit
03ca17c8
authored
12 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Optimize InputConnection.getCursorCapsMode calling
Bug: 6464226 Change-Id: I30c1b01be5e1719ded5f7f8a7e24a38e9bbc3637
parent
67b2c584
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/LatinIME.java
+18
-6
18 additions, 6 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
with
18 additions
and
6 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
+
18
−
6
View file @
03ca17c8
...
...
@@ -1026,13 +1026,25 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public
boolean
getCurrentAutoCapsState
()
{
if
(!
mSettingsValues
.
mAutoCap
)
return
false
;
final
EditorInfo
ei
=
getCurrentInputEditorInfo
();
if
(
ei
==
null
)
return
false
;
final
int
inputType
=
ei
.
inputType
;
if
((
inputType
&
InputType
.
TYPE_TEXT_FLAG_CAP_CHARACTERS
)
!=
0
)
return
true
;
final
boolean
noNeedToCheckCapsMode
=
(
inputType
&
(
InputType
.
TYPE_TEXT_FLAG_CAP_SENTENCES
|
InputType
.
TYPE_TEXT_FLAG_CAP_WORDS
))
==
0
;
if
(
noNeedToCheckCapsMode
)
return
false
;
final
InputConnection
ic
=
getCurrentInputConnection
();
EditorInfo
ei
=
getCurrentInputEditorInfo
()
;
if
(
mSettingsValues
.
mAutoCap
&&
ic
!=
null
&&
ei
!=
null
&&
ei
.
inputType
!=
InputType
.
TYPE_NULL
)
{
return
ic
.
getCursorCapsMode
(
ei
.
inputType
)
!=
0
;
}
return
false
;
if
(
ic
==
null
)
return
false
;
// TODO: This blocking IPC call is heavy. Consider doing this without using IPC calls.
// Note: getCursorCapsMode() returns the current capitalization mode that is any
// combination of CAP_MODE_CHARACTERS, CAP_MODE_WORDS, and CAP_MODE_SENTENCES. 0 means none
// of them.
return
ic
.
getCursorCapsMode
(
inputType
)
!=
0
;
}
// "ic" may be null
...
...
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