am 2b72aa07: Disconnect app data search client after fetching all data.

* commit '2b72aa07a9ac952e5d28cf657632e8d31d247baf':
  Disconnect app data search client after fetching all data.
main
Keisuke Kuroyanagi 2014-02-24 05:57:01 -08:00 committed by Android Git Automerger
commit 099051772f
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();
} }