am cfbb7fbd: Fix: Read lock is wrongly used for gutSuggestions.
* commit 'cfbb7fbd48125909ed61e58500e56b06afc12709': Fix: Read lock is wrongly used for gutSuggestions.main
commit
551091ef39
|
@ -196,7 +196,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
||||||
final String prevWord, final ProximityInfo proximityInfo,
|
final String prevWord, final ProximityInfo proximityInfo,
|
||||||
final boolean blockOffensiveWords) {
|
final boolean blockOffensiveWords) {
|
||||||
asyncReloadDictionaryIfRequired();
|
asyncReloadDictionaryIfRequired();
|
||||||
if (mLocalDictionaryController.readLock().tryLock()) {
|
// Write lock because getSuggestions in native updates session status.
|
||||||
|
if (mLocalDictionaryController.writeLock().tryLock()) {
|
||||||
try {
|
try {
|
||||||
final ArrayList<SuggestedWordInfo> inMemDictSuggestion =
|
final ArrayList<SuggestedWordInfo> inMemDictSuggestion =
|
||||||
mDictionaryWriter.getSuggestions(composer, prevWord, proximityInfo,
|
mDictionaryWriter.getSuggestions(composer, prevWord, proximityInfo,
|
||||||
|
@ -217,7 +218,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
||||||
return inMemDictSuggestion;
|
return inMemDictSuggestion;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
mLocalDictionaryController.readLock().unlock();
|
mLocalDictionaryController.writeLock().unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue