Fix locale in TextServicesManagerService

Bug: 6542210
Change-Id: I1670fac014beb834ec7c065ebf040d0ff3cf4161
This commit is contained in:
Satoshi Kataoka
2012-05-30 20:05:44 +09:00
parent 38616ccc94
commit 17150cf91b
2 changed files with 4 additions and 4 deletions

View File

@@ -217,7 +217,7 @@ public final class TextServicesManager {
public SpellCheckerSubtype getCurrentSpellCheckerSubtype(
boolean allowImplicitlySelectedSubtype) {
try {
// Passing null as a locale for ICS
// Passing null as a locale until we support multiple enabled spell checker subtypes.
return sService.getCurrentSpellCheckerSubtype(null, allowImplicitlySelectedSubtype);
} catch (RemoteException e) {
Log.e(TAG, "Error in getCurrentSpellCheckerSubtype: " + e);

View File

@@ -198,7 +198,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
}
// TODO: Respect allowImplicitlySelectedSubtype
// TODO: Save SpellCheckerSubtype by supported languages.
// TODO: Save SpellCheckerSubtype by supported languages by looking at "locale".
@Override
public SpellCheckerSubtype getCurrentSpellCheckerSubtype(
String locale, boolean allowImplicitlySelectedSubtype) {
@@ -250,10 +250,10 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
for (int i = 0; i < sci.getSubtypeCount(); ++i) {
final SpellCheckerSubtype scs = sci.getSubtypeAt(i);
if (hashCode == 0) {
if (candidateLocale.equals(locale)) {
final String scsLocale = scs.getLocale();
if (candidateLocale.equals(scsLocale)) {
return scs;
} else if (candidate == null) {
final String scsLocale = scs.getLocale();
if (candidateLocale.length() >= 2 && scsLocale.length() >= 2
&& candidateLocale.startsWith(scsLocale)) {
// Fall back to the applicable language