Fix: Read lock is wrongly used for gutSuggestions.
Bug: 9737865 Change-Id: I017f80b46c5dc48c40f2de7c4d516a042992feb4
This commit is contained in:
parent
58b2a6372f
commit
cfbb7fbd48
1 changed files with 3 additions and 2 deletions
|
@ -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 a new issue