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
0ab1c664
Commit
0ab1c664
authored
12 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Avoid Resources$NotFoundException
bug: 6410653 Change-Id: I4263632e76b44abf8ecd9114a9eb185ad39201fd
parent
7570954a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/ImfUtils.java
+1
-0
1 addition, 0 deletions
java/src/com/android/inputmethod/latin/ImfUtils.java
java/src/com/android/inputmethod/latin/SubtypeLocale.java
+5
-2
5 additions, 2 deletions
java/src/com/android/inputmethod/latin/SubtypeLocale.java
with
6 additions
and
2 deletions
java/src/com/android/inputmethod/latin/ImfUtils.java
+
1
−
0
View file @
0ab1c664
...
@@ -66,6 +66,7 @@ public class ImfUtils {
...
@@ -66,6 +66,7 @@ public class ImfUtils {
public
static
boolean
checkIfSubtypeBelongsToThisIme
(
Context
context
,
InputMethodSubtype
ims
)
{
public
static
boolean
checkIfSubtypeBelongsToThisIme
(
Context
context
,
InputMethodSubtype
ims
)
{
final
InputMethodInfo
myImi
=
getInputMethodInfoOfThisIme
(
context
);
final
InputMethodInfo
myImi
=
getInputMethodInfoOfThisIme
(
context
);
final
InputMethodManager
imm
=
getInputMethodManager
(
context
);
final
InputMethodManager
imm
=
getInputMethodManager
(
context
);
// TODO: Cache all subtypes of this IME for optimization
final
List
<
InputMethodSubtype
>
subtypes
=
imm
.
getEnabledInputMethodSubtypeList
(
myImi
,
true
);
final
List
<
InputMethodSubtype
>
subtypes
=
imm
.
getEnabledInputMethodSubtypeList
(
myImi
,
true
);
for
(
final
InputMethodSubtype
subtype
:
subtypes
)
{
for
(
final
InputMethodSubtype
subtype
:
subtypes
)
{
if
(
subtype
.
equals
(
ims
))
{
if
(
subtype
.
equals
(
ims
))
{
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/SubtypeLocale.java
+
5
−
2
View file @
0ab1c664
...
@@ -33,11 +33,10 @@ public class SubtypeLocale {
...
@@ -33,11 +33,10 @@ public class SubtypeLocale {
// Special language code to represent "no language".
// Special language code to represent "no language".
public
static
final
String
NO_LANGUAGE
=
"zz"
;
public
static
final
String
NO_LANGUAGE
=
"zz"
;
public
static
final
String
QWERTY
=
"qwerty"
;
public
static
final
String
QWERTY
=
"qwerty"
;
public
static
final
int
UNKNOWN_KEYBOARD_LAYOUT
=
R
.
string
.
subtype_generic
;
public
static
final
int
UNKNOWN_KEYBOARD_LAYOUT
=
R
.
string
.
subtype_generic
;
private
static
Context
sContext
;
private
static
String
[]
sPredefinedKeyboardLayoutSet
;
private
static
String
[]
sPredefinedKeyboardLayoutSet
;
// Keyboard layout to its display name map.
// Keyboard layout to its display name map.
private
static
final
HashMap
<
String
,
String
>
sKeyboardKayoutToDisplayNameMap
=
private
static
final
HashMap
<
String
,
String
>
sKeyboardKayoutToDisplayNameMap
=
...
@@ -58,6 +57,7 @@ public class SubtypeLocale {
...
@@ -58,6 +57,7 @@ public class SubtypeLocale {
}
}
public
static
void
init
(
Context
context
)
{
public
static
void
init
(
Context
context
)
{
sContext
=
context
;
final
Resources
res
=
context
.
getResources
();
final
Resources
res
=
context
.
getResources
();
final
String
[]
predefinedLayoutSet
=
res
.
getStringArray
(
R
.
array
.
predefined_layouts
);
final
String
[]
predefinedLayoutSet
=
res
.
getStringArray
(
R
.
array
.
predefined_layouts
);
...
@@ -128,6 +128,9 @@ public class SubtypeLocale {
...
@@ -128,6 +128,9 @@ public class SubtypeLocale {
// zz azerty T No language (AZERTY)
// zz azerty T No language (AZERTY)
public
static
String
getSubtypeDisplayName
(
InputMethodSubtype
subtype
,
Resources
res
)
{
public
static
String
getSubtypeDisplayName
(
InputMethodSubtype
subtype
,
Resources
res
)
{
// TODO: Remove this check when InputMethodManager.getLastInputMethodSubtype is
// fixed.
if
(!
ImfUtils
.
checkIfSubtypeBelongsToThisIme
(
sContext
,
subtype
))
return
""
;
final
String
language
=
getSubtypeLocaleDisplayName
(
subtype
.
getLocale
());
final
String
language
=
getSubtypeLocaleDisplayName
(
subtype
.
getLocale
());
return
res
.
getString
(
subtype
.
getNameResId
(),
language
);
return
res
.
getString
(
subtype
.
getNameResId
(),
language
);
}
}
...
...
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