Skip to content

Commit 7018a90

Browse files
committed
Fix the issue on matching the locale in TextServicesManagerService
Bug: 6542210 Change-Id: I42d84b684d5689e8fceecb705bb51d19d847477a
1 parent f927e17 commit 7018a90

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

services/java/com/android/server/TextServicesManagerService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ public SpellCheckerSubtype getCurrentSpellCheckerSubtype(
254254
return scs;
255255
} else if (candidate == null) {
256256
final String scsLocale = scs.getLocale();
257-
if (candidateLocale.length() >= 2
258-
&& scsLocale.length() >= 2
259-
&& candidateLocale.substring(0, 2).equals(
260-
scsLocale.substring(0, 2))) {
257+
if (candidateLocale.length() >= 2 && scsLocale.length() >= 2
258+
&& candidateLocale.startsWith(scsLocale)) {
261259
// Fall back to the applicable language
262260
candidate = scs;
263261
}

0 commit comments

Comments
 (0)