From bdd6c995cee664e6cd025235be2d00fc439afb1d Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Tue, 10 Mar 2015 18:43:13 -0700 Subject: [PATCH] Delete user history files. Bug 19669016. Change-Id: I8069fe561347851bf3c27423dbd8ba99d38c049e --- .../com/android/inputmethod/keyboard/KeyboardLayoutSet.java | 2 +- .../android/inputmethod/latin/DictionaryFacilitator.java | 6 +++--- .../inputmethod/latin/DictionaryFacilitatorImpl.java | 2 +- java/src/com/android/inputmethod/latin/LatinIME.java | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java index d71dc5956..47013fe9e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java @@ -63,7 +63,7 @@ import javax.annotation.Nullable; */ public final class KeyboardLayoutSet { private static final String TAG = KeyboardLayoutSet.class.getSimpleName(); - private static final boolean DEBUG_CACHE = DebugFlags.DEBUG_ENABLED; + private static final boolean DEBUG_CACHE = false; private static final String TAG_KEYBOARD_SET = "KeyboardLayoutSet"; private static final String TAG_ELEMENT = "Element"; diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java index 7e916003b..3b120f390 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java @@ -169,10 +169,10 @@ public interface DictionaryFacilitator { int getMaxFrequencyOfExactMatches(final String word); - void clearUserHistoryDictionary(); - + void clearUserHistoryDictionary(final Context context); + String dump(final Context context); - + void dumpDictionaryForDebug(final String dictName); ArrayList> getStatsOfEnabledSubDicts(); diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java index 6080900a1..e68f8f767 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java @@ -776,7 +776,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator { } @Override - public void clearUserHistoryDictionary() { + public void clearUserHistoryDictionary(final Context context) { clearSubDictionary(Dictionary.TYPE_USER_HISTORY); } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0f9915778..ec7b5f801 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -609,7 +609,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void refreshPersonalizationDictionarySession( final SettingsValues currentSettingsValues) { - // TODO: Remove all existing personalized dictionaries. mDictionaryFacilitator.setIsMonolingualUser( mRichImm.isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes()); final boolean shouldKeepUserHistoryDictionaries; @@ -621,7 +620,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (!shouldKeepUserHistoryDictionaries) { // Remove user history dictionaries. PersonalizationHelper.removeAllUserHistoryDictionaries(this); - mDictionaryFacilitator.clearUserHistoryDictionary(); + mDictionaryFacilitator.clearUserHistoryDictionary(this); } } @@ -1802,7 +1801,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // DO NOT USE THIS for any other purpose than testing. @UsedForTesting /* package for test */ void clearPersonalizedDictionariesForTest() { - mDictionaryFacilitator.clearUserHistoryDictionary(); + mDictionaryFacilitator.clearUserHistoryDictionary(this); } @UsedForTesting