diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
index 1eee1df..0a700bd 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
@@ -32,7 +32,6 @@
 import android.view.accessibility.AccessibilityManager;
 import android.view.inputmethod.EditorInfo;
 
-import com.android.inputmethod.compat.AudioManagerCompatWrapper;
 import com.android.inputmethod.compat.SettingsSecureCompatUtils;
 import com.android.inputmethod.latin.InputTypeUtils;
 import com.android.inputmethod.latin.R;
@@ -40,14 +39,14 @@
 public final class AccessibilityUtils {
     private static final String TAG = AccessibilityUtils.class.getSimpleName();
     private static final String CLASS = AccessibilityUtils.class.getClass().getName();
-    private static final String PACKAGE = AccessibilityUtils.class.getClass().getPackage()
-            .getName();
+    private static final String PACKAGE =
+            AccessibilityUtils.class.getClass().getPackage().getName();
 
     private static final AccessibilityUtils sInstance = new AccessibilityUtils();
 
     private Context mContext;
     private AccessibilityManager mAccessibilityManager;
-    private AudioManagerCompatWrapper mAudioManager;
+    private AudioManager mAudioManager;
 
     /*
      * Setting this constant to {@code false} will disable all keyboard
@@ -57,8 +56,7 @@
     private static final boolean ENABLE_ACCESSIBILITY = true;
 
     public static void init(InputMethodService inputMethod) {
-        if (!ENABLE_ACCESSIBILITY)
-            return;
+        if (!ENABLE_ACCESSIBILITY) return;
 
         // These only need to be initialized if the kill switch is off.
         sInstance.initInternal(inputMethod);
@@ -76,12 +74,9 @@
 
     private void initInternal(Context context) {
         mContext = context;
-        mAccessibilityManager = (AccessibilityManager) context
-                .getSystemService(Context.ACCESSIBILITY_SERVICE);
-
-        final AudioManager audioManager = (AudioManager) context
-                .getSystemService(Context.AUDIO_SERVICE);
-        mAudioManager = new AudioManagerCompatWrapper(audioManager);
+        mAccessibilityManager =
+                (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
+        mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
     }
 
     /**
@@ -120,20 +115,19 @@
      * @return {@code true} if the device should obscure password characters.
      */
     public boolean shouldObscureInput(EditorInfo editorInfo) {
-        if (editorInfo == null)
-            return false;
+        if (editorInfo == null) return false;
 
         // The user can optionally force speaking passwords.
         if (SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD != null) {
             final boolean speakPassword = Settings.Secure.getInt(mContext.getContentResolver(),
                     SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
-            if (speakPassword)
-                return false;
+            if (speakPassword) return false;
         }
 
         // Always speak if the user is listening through headphones.
-        if (mAudioManager.isWiredHeadsetOn() || mAudioManager.isBluetoothA2dpOn())
+        if (mAudioManager.isWiredHeadsetOn() || mAudioManager.isBluetoothA2dpOn()) {
             return false;
+        }
 
         // Don't speak if the IME is connected to a password field.
         return InputTypeUtils.isPasswordInputType(editorInfo.inputType);
diff --git a/java/src/com/android/inputmethod/compat/AudioManagerCompatWrapper.java b/java/src/com/android/inputmethod/compat/AudioManagerCompatWrapper.java
deleted file mode 100644
index 40eed91..0000000
--- a/java/src/com/android/inputmethod/compat/AudioManagerCompatWrapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.inputmethod.compat;
-
-import android.media.AudioManager;
-
-import java.lang.reflect.Method;
-
-public final class AudioManagerCompatWrapper {
-    private static final Method METHOD_isWiredHeadsetOn = CompatUtils.getMethod(
-            AudioManager.class, "isWiredHeadsetOn");
-    private static final Method METHOD_isBluetoothA2dpOn = CompatUtils.getMethod(
-            AudioManager.class, "isBluetoothA2dpOn");
-
-    private final AudioManager mManager;
-
-    public AudioManagerCompatWrapper(AudioManager manager) {
-        mManager = manager;
-    }
-
-    /**
-     * Checks whether audio routing to the wired headset is on or off.
-     *
-     * @return true if audio is being routed to/from wired headset;
-     *         false if otherwise
-     */
-    public boolean isWiredHeadsetOn() {
-        return (Boolean) CompatUtils.invoke(mManager, false, METHOD_isWiredHeadsetOn);
-    }
-
-    /**
-     * Checks whether A2DP audio routing to the Bluetooth headset is on or off.
-     *
-     * @return true if A2DP audio is being routed to/from Bluetooth headset;
-     *         false if otherwise
-     */
-    public boolean isBluetoothA2dpOn() {
-        return (Boolean) CompatUtils.invoke(mManager, false, METHOD_isBluetoothA2dpOn);
-    }
-}
