From 2cc2d31418b482e26df657746e2b2711f73aabac Mon Sep 17 00:00:00 2001 From: Jatin Matani Date: Fri, 27 Mar 2015 11:10:00 -0700 Subject: [PATCH] Don't notify dictpack for updates for service dump Bug:19961803 Change-Id: I464e840bc5f75d164a519d84b0f09d8e64ed5061 --- .../android/inputmethod/latin/BinaryDictionaryGetter.java | 8 +++++--- .../com/android/inputmethod/latin/DictionaryFactory.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index f4300c462..a1c1b6d3c 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -273,12 +273,14 @@ final public class BinaryDictionaryGetter { * @return The list of addresses of valid dictionary files, or null. */ public static ArrayList getDictionaryFiles(final Locale locale, - final Context context) { + final Context context, boolean notifyDictionaryPackForUpdates) { final boolean hasDefaultWordList = DictionaryInfoUtils.isDictionaryAvailable( context, locale); - BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context, - hasDefaultWordList); + if (notifyDictionaryPackForUpdates) { + BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context, + hasDefaultWordList); + } final File[] cachedWordLists = getCachedWordLists(locale.toString(), context); final String mainDictId = DictionaryInfoUtils.getMainDictId(locale); final DictPackSettings dictPackSettings = new DictPackSettings(context); diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java index 49608d830..5dd02bd1c 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java @@ -53,7 +53,7 @@ public final class DictionaryFactory { final LinkedList dictList = new LinkedList<>(); final ArrayList assetFileList = - BinaryDictionaryGetter.getDictionaryFiles(locale, context); + BinaryDictionaryGetter.getDictionaryFiles(locale, context, true); if (null != assetFileList) { for (final AssetFileAddress f : assetFileList) { final ReadOnlyBinaryDictionary readOnlyBinaryDictionary =