Fix the issue on matching the locale in TextServicesManagerService

Bug: 6542210

Change-Id: I42d84b684d5689e8fceecb705bb51d19d847477a
This commit is contained in:
satok
2012-05-24 18:10:37 +09:00
parent f927e17ae5
commit 7018a90c32

View File

@ -254,10 +254,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
return scs;
} else if (candidate == null) {
final String scsLocale = scs.getLocale();
if (candidateLocale.length() >= 2
&& scsLocale.length() >= 2
&& candidateLocale.substring(0, 2).equals(
scsLocale.substring(0, 2))) {
if (candidateLocale.length() >= 2 && scsLocale.length() >= 2
&& candidateLocale.startsWith(scsLocale)) {
// Fall back to the applicable language
candidate = scs;
}