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

Commit fe12ebec authored by Evan Laird's avatar Evan Laird
Browse files

Add bluetoothcontrollerimpl to dumpsys

Bug: 165190595
Test: adb shell dumpsys activity service SystemUI | grep BluetoothController
Change-Id: I4615f9aa9e357f41d5eeca3300ac17148ae4e860
parent 408d3fe3
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -58,6 +59,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
    private static final String TAG = "BluetoothController";
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);

    private final DumpManager mDumpManager;
    private final LocalBluetoothManager mLocalBluetoothManager;
    private final UserManager mUserManager;
    private final int mCurrentUser;
@@ -77,8 +79,13 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
    /**
     */
    @Inject
    public BluetoothControllerImpl(Context context, @Background Looper bgLooper,
            @Main Looper mainLooper, @Nullable LocalBluetoothManager localBluetoothManager) {
    public BluetoothControllerImpl(
            Context context,
            DumpManager dumpManager,
            @Background Looper bgLooper,
            @Main Looper mainLooper,
            @Nullable LocalBluetoothManager localBluetoothManager) {
        mDumpManager = dumpManager;
        mLocalBluetoothManager = localBluetoothManager;
        mBgHandler = new Handler(bgLooper);
        mHandler = new H(mainLooper);
@@ -90,6 +97,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
        }
        mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
        mCurrentUser = ActivityManager.getCurrentUser();
        mDumpManager.registerDumpable(TAG, this);
    }

    @Override
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.dump.DumpManager;

import org.junit.Before;
import org.junit.Test;
@@ -58,6 +59,7 @@ public class BluetoothControllerImplTest extends SysuiTestCase {
    private CachedBluetoothDeviceManager mMockDeviceManager;
    private LocalBluetoothAdapter mMockAdapter;
    private TestableLooper mTestableLooper;
    private DumpManager mMockDumpManager;
    private BluetoothControllerImpl mBluetoothControllerImpl;

    private List<CachedBluetoothDevice> mDevices;
@@ -75,8 +77,10 @@ public class BluetoothControllerImplTest extends SysuiTestCase {
        when(mMockBluetoothManager.getEventManager()).thenReturn(mock(BluetoothEventManager.class));
        when(mMockBluetoothManager.getProfileManager())
                .thenReturn(mock(LocalBluetoothProfileManager.class));
        mMockDumpManager = mock(DumpManager.class);

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