Disconnect app data search client after fetching all data.

Bug: 13138201
Change-Id: Ibaa3c2c22a4fe44ea23e92ce8576141bbad09b12
main
Keisuke Kuroyanagi 2014-02-24 14:47:54 +09:00
parent 584e9c9c22
commit 2b72aa07a9
2 changed files with 11 additions and 0 deletions

View File

@ -232,6 +232,12 @@ public class DictionaryFacilitatorForSuggest {
return null != mPersonalizationDictionary; return null != mPersonalizationDictionary;
} }
public void flushPersonalizationDictionary() {
if (hasPersonalizationDictionary()) {
mPersonalizationDictionary.flush();
}
}
public void waitForLoadingMainDictionary(final long timeout, final TimeUnit unit) public void waitForLoadingMainDictionary(final long timeout, final TimeUnit unit)
throws InterruptedException { throws InterruptedException {
mLatchForWaitingLoadingMainDictionary.await(timeout, unit); mLatchForWaitingLoadingMainDictionary.await(timeout, unit);

View File

@ -68,6 +68,11 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB
dumpAllWordsForDebug(); dumpAllWordsForDebug();
} }
// Flush pending writes. // Flush pending writes.
flush();
// TODO: Quit depending on finalize() and really close the dictionary file.
}
public void flush() {
asyncFlushBinaryDictionary(); asyncFlushBinaryDictionary();
} }