diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
index bc094b1..d50dd3e 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
@@ -68,7 +68,6 @@
         // These only need to be initialized if the kill switch is off.
         sInstance.initInternal(context);
         KeyCodeDescriptionMapper.init();
-        AccessibleKeyboardViewProxy.init(context);
     }
 
     public static AccessibilityUtils getInstance() {
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
similarity index 88%
rename from java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
rename to java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
index 15f79f3..1092942 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
@@ -36,9 +36,7 @@
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
 
-public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
-    private static final AccessibleKeyboardViewProxy sInstance = new AccessibleKeyboardViewProxy();
-
+public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelegateCompat {
     /** Map of keyboard modes to resource IDs. */
     private static final SparseIntArray KEYBOARD_MODE_RES_IDS = new SparseIntArray();
 
@@ -54,9 +52,9 @@
         KEYBOARD_MODE_RES_IDS.put(KeyboardId.MODE_URL, R.string.keyboard_mode_url);
     }
 
-    private MainKeyboardView mView;
+    private final MainKeyboardView mView;
     private Keyboard mKeyboard;
-    private AccessibilityEntityProvider mAccessibilityNodeProvider;
+    private MainKeyboardAccessibilityNodeProvider mAccessibilityNodeProvider;
 
     private Key mLastHoverKey = null;
 
@@ -69,46 +67,14 @@
     private int mLastKeyboardMode = KEYBOARD_IS_HIDDEN;
     private static final int KEYBOARD_IS_HIDDEN = -1;
 
-    public static void init(final Context context) {
-        sInstance.initInternal(context);
-    }
-
-    public static AccessibleKeyboardViewProxy getInstance() {
-        return sInstance;
-    }
-
-    private AccessibleKeyboardViewProxy() {
-        // Not publicly instantiable.
-    }
-
-    private void initInternal(final Context context) {
+    public MainKeyboardAccessibilityDelegate(final MainKeyboardView view) {
+        final Context context = view.getContext();
         mEdgeSlop = context.getResources().getDimensionPixelSize(
                 R.dimen.config_accessibility_edge_slop);
-    }
-
-    /**
-     * Sets the view wrapped by this proxy.
-     *
-     * @param view The view to wrap.
-     */
-    public void setView(final MainKeyboardView view) {
-        if (view == null) {
-            // Ignore null views.
-            return;
-        }
         mView = view;
 
         // Ensure that the view has an accessibility delegate.
         ViewCompat.setAccessibilityDelegate(view, this);
-
-        if (mAccessibilityNodeProvider == null) {
-            return;
-        }
-        mAccessibilityNodeProvider.setView(view);
-
-        // Since this class is constructed lazily, we might not get a subsequent
-        // call to setKeyboard() and therefore need to call it now.
-        setKeyboard(view.getKeyboard());
     }
 
     /**
@@ -156,9 +122,6 @@
      * Called when the keyboard is hidden and accessibility is enabled.
      */
     public void onHideWindow() {
-        if (mView == null) {
-            return;
-        }
         announceKeyboardHidden();
         mLastKeyboardMode = KEYBOARD_IS_HIDDEN;
     }
@@ -264,7 +227,7 @@
     }
 
     /**
-     * Proxy method for View.getAccessibilityNodeProvider(). This method is called in SDK
+     * Delegate method for View.getAccessibilityNodeProvider(). This method is called in SDK
      * version 15 (Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) and higher to obtain the virtual
      * node hierarchy provider.
      *
@@ -272,10 +235,7 @@
      * @return The accessibility node provider for the current keyboard.
      */
     @Override
-    public AccessibilityEntityProvider getAccessibilityNodeProvider(final View host) {
-        if (mView == null) {
-            return null;
-        }
+    public MainKeyboardAccessibilityNodeProvider getAccessibilityNodeProvider(final View host) {
         return getAccessibilityNodeProvider();
     }
 
@@ -288,10 +248,6 @@
      * @return {@code true} if the event is handled
      */
     public boolean dispatchHoverEvent(final MotionEvent event, final KeyDetector keyDetector) {
-        if (mView == null) {
-            return false;
-        }
-
         final int x = (int) event.getX();
         final int y = (int) event.getY();
         final Key previousKey = mLastHoverKey;
@@ -325,14 +281,14 @@
     }
 
     /**
-     * @return A lazily-instantiated node provider for this view proxy.
+     * @return A lazily-instantiated node provider for this view delegate.
      */
-    private AccessibilityEntityProvider getAccessibilityNodeProvider() {
+    private MainKeyboardAccessibilityNodeProvider getAccessibilityNodeProvider() {
         // Instantiate the provide only when requested. Since the system
         // will call this method multiple times it is a good practice to
         // cache the provider instance.
         if (mAccessibilityNodeProvider == null) {
-            mAccessibilityNodeProvider = new AccessibilityEntityProvider(mView);
+            mAccessibilityNodeProvider = new MainKeyboardAccessibilityNodeProvider(mView);
         }
         return mAccessibilityNodeProvider;
     }
@@ -417,7 +373,7 @@
         if (key == null) {
             return false;
         }
-        final AccessibilityEntityProvider provider = getAccessibilityNodeProvider();
+        final MainKeyboardAccessibilityNodeProvider provider = getAccessibilityNodeProvider();
 
         switch (event.getAction()) {
         case MotionEvent.ACTION_HOVER_ENTER:
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java
similarity index 95%
rename from java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java
rename to java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java
index ec1ab35..f69d316 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java
+++ b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java
@@ -47,8 +47,8 @@
  * virtual views, thus conveying their logical structure.
  * </p>
  */
-public final class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat {
-    private static final String TAG = AccessibilityEntityProvider.class.getSimpleName();
+public final class MainKeyboardAccessibilityNodeProvider extends AccessibilityNodeProviderCompat {
+    private static final String TAG = MainKeyboardAccessibilityNodeProvider.class.getSimpleName();
     private static final int UNDEFINED = Integer.MIN_VALUE;
 
     private final KeyCodeDescriptionMapper mKeyCodeDescriptionMapper;
@@ -64,23 +64,14 @@
     private int mAccessibilityFocusedView = UNDEFINED;
 
     /** The current keyboard view. */
-    private KeyboardView mKeyboardView;
+    private final KeyboardView mKeyboardView;
 
     /** The current keyboard. */
     private Keyboard mKeyboard;
 
-    public AccessibilityEntityProvider(final KeyboardView keyboardView) {
+    public MainKeyboardAccessibilityNodeProvider(final KeyboardView keyboardView) {
         mKeyCodeDescriptionMapper = KeyCodeDescriptionMapper.getInstance();
         mAccessibilityUtils = AccessibilityUtils.getInstance();
-        setView(keyboardView);
-    }
-
-    /**
-     * Sets the keyboard view represented by this node provider.
-     *
-     * @param keyboardView The keyboard view to represent.
-     */
-    public void setView(final KeyboardView keyboardView) {
         mKeyboardView = keyboardView;
         updateParentLocation();
 
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 0235fde..b06955b 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -26,7 +26,6 @@
 import android.view.View;
 import android.view.inputmethod.EditorInfo;
 
-import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy;
 import com.android.inputmethod.compat.InputMethodServiceCompatUtils;
 import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException;
 import com.android.inputmethod.keyboard.internal.KeyboardState;
@@ -148,6 +147,7 @@
 
     public void onHideWindow() {
         mIsAutoCorrectionActive = false;
+        mKeyboardView.onHideWindow();
     }
 
     private void setKeyboard(final Keyboard keyboard) {
@@ -353,11 +353,6 @@
         mEmojiPalettesView.setHardwareAcceleratedDrawingEnabled(
                 isHardwareAcceleratedDrawingEnabled);
         mEmojiPalettesView.setKeyboardActionListener(mLatinIME);
-
-        // This always needs to be set since the accessibility state can
-        // potentially change without the input view being re-created.
-        AccessibleKeyboardViewProxy.getInstance().setView(mKeyboardView);
-
         return mCurrentInputView;
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index ecef8cc..e24d4e9 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -39,7 +39,7 @@
 import android.widget.TextView;
 
 import com.android.inputmethod.accessibility.AccessibilityUtils;
-import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy;
+import com.android.inputmethod.accessibility.MainKeyboardAccessibilityDelegate;
 import com.android.inputmethod.annotations.ExternallyReferenced;
 import com.android.inputmethod.keyboard.internal.DrawingHandler;
 import com.android.inputmethod.keyboard.internal.DrawingPreviewPlacerView;
@@ -179,6 +179,8 @@
     private final DrawingHandler mDrawingHandler =
             new DrawingHandler(this);
 
+    private final MainKeyboardAccessibilityDelegate mAccessibilityDelegate;
+
     public MainKeyboardView(final Context context, final AttributeSet attrs) {
         this(context, attrs, R.attr.mainKeyboardViewStyle);
     }
@@ -278,6 +280,8 @@
 
         mLanguageOnSpacebarHorizontalMargin = (int)getResources().getDimension(
                 R.dimen.config_language_on_spacebar_horizontal_margin);
+
+        mAccessibilityDelegate = new MainKeyboardAccessibilityDelegate(this);
     }
 
     @Override
@@ -404,9 +408,7 @@
             ResearchLogger.mainKeyboardView_setKeyboard(keyboard, orientation);
         }
 
-        // This always needs to be set since the accessibility state can
-        // potentially change without the keyboard being set again.
-        AccessibleKeyboardViewProxy.getInstance().setKeyboard(keyboard);
+        mAccessibilityDelegate.setKeyboard(keyboard);
     }
 
     /**
@@ -769,6 +771,10 @@
         mMoreKeysKeyboardCache.clear();
     }
 
+    public void onHideWindow() {
+        mAccessibilityDelegate.onHideWindow();
+    }
+
     /**
      * Receives hover events from the input framework.
      *
@@ -779,8 +785,7 @@
     @Override
     public boolean dispatchHoverEvent(final MotionEvent event) {
         if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
-            return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent(
-                    event, mKeyDetector);
+            return mAccessibilityDelegate.dispatchHoverEvent(event, mKeyDetector);
         }
 
         // Reflection doesn't support calling superclass methods.
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 78867f1..b653a23 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -55,7 +55,6 @@
 import android.view.inputmethod.InputMethodSubtype;
 
 import com.android.inputmethod.accessibility.AccessibilityUtils;
-import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy;
 import com.android.inputmethod.annotations.UsedForTesting;
 import com.android.inputmethod.compat.InputMethodServiceCompatUtils;
 import com.android.inputmethod.dictionarypack.DictionaryPackConstants;
@@ -1002,10 +1001,6 @@
         LatinImeLogger.commit();
         mKeyboardSwitcher.onHideWindow();
 
-        if (AccessibilityUtils.getInstance().isAccessibilityEnabled()) {
-            AccessibleKeyboardViewProxy.getInstance().onHideWindow();
-        }
-
         if (TRACE) Debug.stopMethodTracing();
         if (isShowingOptionDialog()) {
             mOptionsDialog.dismiss();
