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

Commit d37a18bc authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5335558 from 695beedd to pi-qpr3-b-release

Change-Id: I51f184f9ad7ab6ffae007b22363e3e0d3ed3ffa8
parents 259fd1e0 695beedd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -136,6 +136,11 @@ public class BluetoothDeviceManager {

    void onDeviceConnected(BluetoothDevice device) {
        synchronized (mLock) {
            if (mBluetoothHeadsetService == null) {
                Log.w(this, "Headset service null when receiving device added broadcast");
                return;
            }

            if (!mConnectedDevicesByAddress.containsKey(device.getAddress())) {
                mConnectedDevicesByAddress.put(device.getAddress(), device);
                mBluetoothRouteManager.onDeviceAdded(device.getAddress());
+11 −0
Original line number Diff line number Diff line
@@ -98,6 +98,17 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase {
        assertNull(mBluetoothDeviceManager.getMostRecentlyConnectedDevice(null));
    }

    @SmallTest
    @Test
    public void testAddDeviceFailsWhenServicesAreNull() {
        mBluetoothDeviceManager.setHeadsetServiceForTesting(null);

        receiverUnderTest.onReceive(mContext,
                buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1));

        assertEquals(0, mBluetoothDeviceManager.getNumConnectedDevices());
    }
    
    @SmallTest
    @Test
    public void testMultiDeviceConnectAndDisconnect() {