Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8111bccc authored by Jason Monk's avatar Jason Monk
Browse files

Remove Dependency.get usages from BluetoothControllerImpl

Test: atest SystemUITests
Change-Id: I5dd95d8ae7e319c74b6d96109d87f45d38c7e084
parent cfa61ff2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.policy;

import static com.android.systemui.Dependency.BG_LOOPER_NAME;

import android.annotation.Nullable;
import android.app.ActivityManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
@@ -34,7 +35,6 @@ import com.android.settingslib.bluetooth.BluetoothCallback;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.systemui.Dependency;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -73,8 +73,9 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
    /**
     */
    @Inject
    public BluetoothControllerImpl(Context context, @Named(BG_LOOPER_NAME) Looper bgLooper) {
        mLocalBluetoothManager = Dependency.get(LocalBluetoothManager.class);
    public BluetoothControllerImpl(Context context, @Named(BG_LOOPER_NAME) Looper bgLooper,
            @Nullable LocalBluetoothManager localBluetoothManager) {
        mLocalBluetoothManager = localBluetoothManager;
        mBgHandler = new Handler(bgLooper);
        if (mLocalBluetoothManager != null) {
            mLocalBluetoothManager.getEventManager().registerCallback(this);
+2 −1
Original line number Diff line number Diff line
@@ -74,7 +74,8 @@ public class BluetoothControllerImplTest extends SysuiTestCase {
                .thenReturn(mock(LocalBluetoothProfileManager.class));

        mBluetoothControllerImpl = new BluetoothControllerImpl(mContext,
                mTestableLooper.getLooper());
                mTestableLooper.getLooper(),
                mMockBluetoothManager);
    }

    @Test