Split a method for reuse
Change-Id: I9a82e538903f05bedad51bc195866abbd9daf957
This commit is contained in:
parent
a77bbc64f0
commit
8403611960
1 changed files with 5 additions and 1 deletions
|
@ -353,6 +353,11 @@ public class AndroidSpellCheckerService extends SpellCheckerService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onUnbind(final Intent intent) {
|
public boolean onUnbind(final Intent intent) {
|
||||||
|
closeAllDictionaries();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeAllDictionaries() {
|
||||||
final Map<String, DictionaryPool> oldPools = mDictionaryPools;
|
final Map<String, DictionaryPool> oldPools = mDictionaryPools;
|
||||||
mDictionaryPools = Collections.synchronizedMap(new TreeMap<String, DictionaryPool>());
|
mDictionaryPools = Collections.synchronizedMap(new TreeMap<String, DictionaryPool>());
|
||||||
final Map<String, Dictionary> oldUserDictionaries = mUserDictionaries;
|
final Map<String, Dictionary> oldUserDictionaries = mUserDictionaries;
|
||||||
|
@ -378,7 +383,6 @@ public class AndroidSpellCheckerService extends SpellCheckerService
|
||||||
dictToClose.close();
|
dictToClose.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DictionaryPool getDictionaryPool(final String locale) {
|
private DictionaryPool getDictionaryPool(final String locale) {
|
||||||
|
|
Loading…
Reference in a new issue