From b684d2d2e4ae4a43a6f499a263a421760fc5c175 Mon Sep 17 00:00:00 2001
From: Jatin Matani <jatinm@google.com>
Date: Mon, 23 Feb 2015 15:14:21 -0800
Subject: [PATCH] Share decoders among latinime components.

Change-Id: I6c8d3cf10e05e606308cea42d1e935a415ada9f8
---
 .../inputmethod/latin/DictionaryFacilitatorProvider.java       | 2 +-
 .../inputmethod/latin/DictionaryFacilitatorLruCache.java       | 3 ++-
 java/src/com/android/inputmethod/latin/LatinIME.java           | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java b/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java
index 2a3774b989..a48b41fa72 100644
--- a/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java
+++ b/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java
@@ -20,7 +20,7 @@ package com.android.inputmethod.latin;
  * Factory for instantiating DictionaryFacilitator objects.
  */
 public class DictionaryFacilitatorProvider {
-    public static DictionaryFacilitator getDictionaryFacilitator() {
+    public static DictionaryFacilitator getDictionaryFacilitator(boolean isNeededForSpellChecking) {
         return new DictionaryFacilitatorImpl();
     }
 }
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
index 1b3e9ca72d..2a1ae36847 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
@@ -41,7 +41,8 @@ public class DictionaryFacilitatorLruCache {
     public DictionaryFacilitatorLruCache(final Context context, final String dictionaryNamePrefix) {
         mContext = context;
         mDictionaryNamePrefix = dictionaryNamePrefix;
-        mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator();
+        mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator(
+                true /* isNeededForSpellChecking */);
     }
 
     private static void waitForLoadingMainDictionary(
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 550efa59f7..5b62135c1d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -127,7 +127,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
 
     final Settings mSettings;
     private final DictionaryFacilitator mDictionaryFacilitator =
-            DictionaryFacilitatorProvider.getDictionaryFacilitator();
+            DictionaryFacilitatorProvider.getDictionaryFacilitator(
+                    false /* isNeededForSpellChecking */);
     final InputLogic mInputLogic = new InputLogic(this /* LatinIME */,
             this /* SuggestionStripViewAccessor */, mDictionaryFacilitator);
     // We expect to have only one decoder in almost all cases, hence the default capacity of 1.
-- 
GitLab