mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix: Read lock is wrongly used for gutSuggestions.
Bug: 9737865 Change-Id: I017f80b46c5dc48c40f2de7c4d516a042992feb4
This commit is contained in:
parent
58b2a6372f
commit
cfbb7fbd48
@ -196,7 +196,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
||||
final String prevWord, final ProximityInfo proximityInfo,
|
||||
final boolean blockOffensiveWords) {
|
||||
asyncReloadDictionaryIfRequired();
|
||||
if (mLocalDictionaryController.readLock().tryLock()) {
|
||||
// Write lock because getSuggestions in native updates session status.
|
||||
if (mLocalDictionaryController.writeLock().tryLock()) {
|
||||
try {
|
||||
final ArrayList<SuggestedWordInfo> inMemDictSuggestion =
|
||||
mDictionaryWriter.getSuggestions(composer, prevWord, proximityInfo,
|
||||
@ -217,7 +218,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
||||
return inMemDictSuggestion;
|
||||
}
|
||||
} finally {
|
||||
mLocalDictionaryController.readLock().unlock();
|
||||
mLocalDictionaryController.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user