aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BinaryDictionary.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 88174ba83..38359fc15 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -460,6 +460,7 @@ public final class BinaryDictionary extends Dictionary {
dictFile.length(), mIsUpdatable);
}
+ // Flush to dict file if the dictionary has been updated.
public void flush() {
if (!isValidDictionary()) return;
if (mHasUpdated) {
@@ -468,6 +469,14 @@ public final class BinaryDictionary extends Dictionary {
}
}
+ // Run GC and flush to dict file if the dictionary has been updated.
+ public void flushWithGCIfHasUpdated() {
+ if (mHasUpdated) {
+ flushWithGC();
+ }
+ }
+
+ // Run GC and flush to dict file.
public void flushWithGC() {
if (!isValidDictionary()) return;
flushWithGCNative(mNativeDict, mDictFilePath);