Merge "Remove clearAndFlushDictionary() and use clear()."
commit
3d658a63ca
|
@ -542,7 +542,7 @@ public class DictionaryFacilitatorForSuggest {
|
|||
if (userHistoryDict == null) {
|
||||
return;
|
||||
}
|
||||
userHistoryDict.clearAndFlushDictionary();
|
||||
userHistoryDict.clear();
|
||||
}
|
||||
|
||||
// This method gets called only when the IME receives a notification to remove the
|
||||
|
@ -553,7 +553,7 @@ public class DictionaryFacilitatorForSuggest {
|
|||
if (personalizationDict == null) {
|
||||
return;
|
||||
}
|
||||
personalizationDict.clearAndFlushDictionary();
|
||||
personalizationDict.clear();
|
||||
}
|
||||
|
||||
public void addMultipleDictionaryEntriesToPersonalizationDictionary(
|
||||
|
|
|
@ -244,7 +244,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
|||
true /* useFullEditDistance */, mLocale, mDictType, true /* isUpdatable */);
|
||||
}
|
||||
|
||||
protected void clear() {
|
||||
public void clear() {
|
||||
ExecutorUtils.getExecutor(mDictName).execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -135,19 +135,11 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB
|
|||
// No initial contents.
|
||||
}
|
||||
|
||||
@UsedForTesting
|
||||
public void clearAndFlushDictionary() {
|
||||
// Clear the node structure on memory
|
||||
clear();
|
||||
// Then flush the cleared state of the dictionary on disk.
|
||||
asyncFlushBinaryDictionary();
|
||||
}
|
||||
|
||||
@UsedForTesting
|
||||
public void clearAndFlushDictionaryWithAdditionalAttributes(
|
||||
final Map<String, String> attributeMap) {
|
||||
mAdditionalAttributeMap = attributeMap;
|
||||
clearAndFlushDictionary();
|
||||
clear();
|
||||
}
|
||||
|
||||
/* package */ void runGCIfRequired() {
|
||||
|
|
|
@ -135,7 +135,7 @@ public class PersonalizationHelper {
|
|||
if (entry.getValue() != null) {
|
||||
final DecayingExpandableBinaryDictionaryBase dict = entry.getValue().get();
|
||||
if (dict != null) {
|
||||
dict.clearAndFlushDictionary();
|
||||
dict.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class UserHistoryDictionaryTests extends AndroidTestCase {
|
|||
final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
|
||||
mContext, locale);
|
||||
dict.waitAllTasksForTests();
|
||||
dict.clearAndFlushDictionary();
|
||||
dict.clear();
|
||||
dict.close();
|
||||
dict.waitAllTasksForTests();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue