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

Commit df72a2ff authored by Yuanru Qian's avatar Yuanru Qian Committed by Android (Google) Code Review
Browse files

Merge "Fix the broken settingslib test" into main

parents 87f02d7b 18fe6ae5
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);
    }

    /**