[automerger] Revert "Select only preinstalled Spell Checker Services" am: 170e24d4e1 am: fb3b187f10 am: 7abf49d3b7
Change-Id: I019b36991306a8f7887b7a0b8233b2c9f1c9ed32
This commit is contained in:
@@ -183,7 +183,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
buildSpellCheckerMapLocked(mContext, mSpellCheckerList, mSpellCheckerMap, mSettings);
|
buildSpellCheckerMapLocked(mContext, mSpellCheckerList, mSpellCheckerMap, mSettings);
|
||||||
SpellCheckerInfo sci = getCurrentSpellChecker(null);
|
SpellCheckerInfo sci = getCurrentSpellChecker(null);
|
||||||
if (sci == null) {
|
if (sci == null) {
|
||||||
sci = findAvailSystemSpellCheckerLocked(null);
|
sci = findAvailSpellCheckerLocked(null);
|
||||||
if (sci != null) {
|
if (sci != null) {
|
||||||
// Set the current spell checker if there is one or more spell checkers
|
// Set the current spell checker if there is one or more spell checkers
|
||||||
// available. In this case, "sci" is the first one in the available spell
|
// available. In this case, "sci" is the first one in the available spell
|
||||||
@@ -227,7 +227,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE
|
change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE
|
||||||
// Package modified
|
// Package modified
|
||||||
|| isPackageModified(packageName)) {
|
|| isPackageModified(packageName)) {
|
||||||
sci = findAvailSystemSpellCheckerLocked(packageName);
|
sci = findAvailSpellCheckerLocked(packageName);
|
||||||
if (sci != null) {
|
if (sci != null) {
|
||||||
setCurrentSpellCheckerLocked(sci.getId());
|
setCurrentSpellCheckerLocked(sci.getId());
|
||||||
}
|
}
|
||||||
@@ -371,16 +371,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
mSpellCheckerBindGroups.clear();
|
mSpellCheckerBindGroups.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpellCheckerInfo findAvailSystemSpellCheckerLocked(String prefPackage) {
|
private SpellCheckerInfo findAvailSpellCheckerLocked(String prefPackage) {
|
||||||
// Filter the spell checker list to remove spell checker services that are not pre-installed
|
final int spellCheckersCount = mSpellCheckerList.size();
|
||||||
ArrayList<SpellCheckerInfo> spellCheckerList = new ArrayList<>();
|
|
||||||
for (SpellCheckerInfo sci : mSpellCheckerList) {
|
|
||||||
if ((sci.getServiceInfo().applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
|
||||||
spellCheckerList.add(sci);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final int spellCheckersCount = spellCheckerList.size();
|
|
||||||
if (spellCheckersCount == 0) {
|
if (spellCheckersCount == 0) {
|
||||||
Slog.w(TAG, "no available spell checker services found");
|
Slog.w(TAG, "no available spell checker services found");
|
||||||
return null;
|
return null;
|
||||||
@@ -390,7 +382,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
final SpellCheckerInfo sci = mSpellCheckerList.get(i);
|
final SpellCheckerInfo sci = mSpellCheckerList.get(i);
|
||||||
if (prefPackage.equals(sci.getPackageName())) {
|
if (prefPackage.equals(sci.getPackageName())) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Slog.d(TAG, "findAvailSystemSpellCheckerLocked: " + sci.getPackageName());
|
Slog.d(TAG, "findAvailSpellCheckerLocked: " + sci.getPackageName());
|
||||||
}
|
}
|
||||||
return sci;
|
return sci;
|
||||||
}
|
}
|
||||||
@@ -404,7 +396,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
final ArrayList<Locale> suitableLocales =
|
final ArrayList<Locale> suitableLocales =
|
||||||
InputMethodUtils.getSuitableLocalesForSpellChecker(systemLocal);
|
InputMethodUtils.getSuitableLocalesForSpellChecker(systemLocal);
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Slog.w(TAG, "findAvailSystemSpellCheckerLocked suitableLocales="
|
Slog.w(TAG, "findAvailSpellCheckerLocked suitableLocales="
|
||||||
+ Arrays.toString(suitableLocales.toArray(new Locale[suitableLocales.size()])));
|
+ Arrays.toString(suitableLocales.toArray(new Locale[suitableLocales.size()])));
|
||||||
}
|
}
|
||||||
final int localeCount = suitableLocales.size();
|
final int localeCount = suitableLocales.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user