Periodic GC for personalization dict.

Change-Id: I1ef922684cbf1de10c45c66eb119c2343d194da3
main
Keisuke Kuroyanagi 2014-05-08 17:20:43 +09:00
parent e3e331aebb
commit 89eaa6701f
2 changed files with 2 additions and 3 deletions

View File

@ -61,6 +61,7 @@ public class DictionaryDecayBroadcastReciever extends BroadcastReceiver {
final String action = intent.getAction();
if (action.equals(DICTIONARY_DECAY_INTENT_ACTION)) {
PersonalizationHelper.runGCOnAllOpenedUserHistoryDictionaries();
PersonalizationHelper.runGCOnAllOpenedPersonalizationDictionaries();
}
}
}

View File

@ -16,7 +16,6 @@
package com.android.inputmethod.latin.personalization;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.utils.CollectionUtils;
import com.android.inputmethod.latin.utils.FileUtils;
@ -66,8 +65,8 @@ public class PersonalizationHelper {
if (TimeUnit.MILLISECONDS.toSeconds(
DictionaryDecayBroadcastReciever.DICTIONARY_DECAY_INTERVAL)
< currentTimestamp - sCurrentTimestampForTesting) {
// TODO: Run GC for both PersonalizationDictionary and UserHistoryDictionary.
runGCOnAllOpenedUserHistoryDictionaries();
runGCOnAllOpenedPersonalizationDictionaries();
}
}
@ -75,7 +74,6 @@ public class PersonalizationHelper {
runGCOnAllDictionariesIfRequired(sLangUserHistoryDictCache);
}
@UsedForTesting
public static void runGCOnAllOpenedPersonalizationDictionaries() {
runGCOnAllDictionariesIfRequired(sLangPersonalizationDictCache);
}