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

Commit e2a23a07 authored by Myles Watson's avatar Myles Watson
Browse files

AdapterServiceTest: Wait for ScanMode Broadcast

Bug:120291423
Test: runtest bluetooth -c com.android.bluetooth.btservice.AdapterServiceTest

Change-Id: I84060cba845dc60f43cf187786ae039d7ca6ed75
parent c2939130
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -213,6 +213,8 @@ public class AdapterServiceTest {
        verifyStateChange(BluetoothAdapter.STATE_TURNING_ON, BluetoothAdapter.STATE_ON,
                invocationNumber + 1, CONTEXT_SWITCH_MS);

        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(2 * invocationNumber + 2))
                .sendBroadcast(any(), eq(android.Manifest.permission.BLUETOOTH));
        final int scanMode = mAdapterService.getScanMode();
        Assert.assertTrue(scanMode == BluetoothAdapter.SCAN_MODE_CONNECTABLE
                || scanMode == BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE);