diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java index 9e2b7c7486312..a3dc77993d304 100644 --- a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java +++ b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java @@ -50,7 +50,6 @@ import com.android.settingslib.bluetooth.LocalBluetoothAdapter; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import com.android.systemui.CoreStartable; -import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.dagger.SysUISingleton; @@ -61,6 +60,7 @@ import java.util.List; import java.util.Set; import javax.inject.Inject; +import javax.inject.Provider; /** */ @SysUISingleton @@ -106,6 +106,8 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo protected volatile Context mContext; + private final Provider mBluetoothManagerProvider; + private boolean mEnabled; private String mKeyboardName; private CachedBluetoothDeviceManager mCachedDeviceManager; @@ -122,8 +124,9 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo private int mState; @Inject - public KeyboardUI(Context context) { + public KeyboardUI(Context context, Provider bluetoothManagerProvider) { super(context); + this.mBluetoothManagerProvider = bluetoothManagerProvider; } @Override @@ -181,7 +184,7 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo return; } - LocalBluetoothManager bluetoothManager = Dependency.get(LocalBluetoothManager.class); + LocalBluetoothManager bluetoothManager = mBluetoothManagerProvider.get(); if (bluetoothManager == null) { if (DEBUG) { Slog.e(TAG, "Failed to retrieve LocalBluetoothManager instance");