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

Commit 18fe6ae5 authored by Yuanru Qian's avatar Yuanru Qian
Browse files

Fix the broken settingslib test

Test: locally tested
Bug: N/A
Flag: EXEMPT test only
Change-Id: Ic0cc6b0746fa127b5c414b0a4329152936234a12
parent 9ebb6cb8
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -436,16 +436,18 @@ public class BluetoothEventManagerTest {
    }

    @Test
    public void dispatchAclConnectionStateChanged_findDeviceReturnNull_shouldNotDispatchCallback() {
    public void dispatchAclConnectionStateChanged_aclBeforeDeviceCreation_shouldDispatchCallback() {
        when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(null);
        when(mCachedDeviceManager.addDevice(mBluetoothDevice)).thenReturn(mCachedBluetoothDevice);
        mBluetoothEventManager.registerCallback(mBluetoothCallback);
        mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED);
        mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice);

        mContext.sendBroadcast(mIntent);

        verify(mBluetoothCallback, never()).onAclConnectionStateChanged(mCachedBluetoothDevice,
                BluetoothAdapter.STATE_CONNECTED);
        verify(mBluetoothCallback)
                .onAclConnectionStateChanged(
                        mCachedBluetoothDevice, BluetoothAdapter.STATE_CONNECTED);
    }

    /**