Fix the issue on matching the locale in TextServicesManagerService
Bug: 6542210 Change-Id: I42d84b684d5689e8fceecb705bb51d19d847477a
This commit is contained in:
@ -254,10 +254,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
return scs;
|
return scs;
|
||||||
} else if (candidate == null) {
|
} else if (candidate == null) {
|
||||||
final String scsLocale = scs.getLocale();
|
final String scsLocale = scs.getLocale();
|
||||||
if (candidateLocale.length() >= 2
|
if (candidateLocale.length() >= 2 && scsLocale.length() >= 2
|
||||||
&& scsLocale.length() >= 2
|
&& candidateLocale.startsWith(scsLocale)) {
|
||||||
&& candidateLocale.substring(0, 2).equals(
|
|
||||||
scsLocale.substring(0, 2))) {
|
|
||||||
// Fall back to the applicable language
|
// Fall back to the applicable language
|
||||||
candidate = scs;
|
candidate = scs;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user