Merge "Split a method for reuse"

main
Jean Chalard 2012-03-26 02:12:20 -07:00 committed by Android (Google) Code Review
commit d2cd3d54f9
1 changed files with 5 additions and 1 deletions

View File

@ -353,6 +353,11 @@ public class AndroidSpellCheckerService extends SpellCheckerService
@Override
public boolean onUnbind(final Intent intent) {
closeAllDictionaries();
return false;
}
private void closeAllDictionaries() {
final Map<String, DictionaryPool> oldPools = mDictionaryPools;
mDictionaryPools = Collections.synchronizedMap(new TreeMap<String, DictionaryPool>());
final Map<String, Dictionary> oldUserDictionaries = mUserDictionaries;
@ -378,7 +383,6 @@ public class AndroidSpellCheckerService extends SpellCheckerService
dictToClose.close();
}
}
return false;
}
private DictionaryPool getDictionaryPool(final String locale) {