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

Commit 9c157cc7 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk Committed by Cherrypicker Worker
Browse files

Add missing connection call for LeAudio service

This adds missing connection call for LeAudio service which triggers
creating LeAudio device descriptor.

Tag: #feature
Bug: 266029936
Test: atest --no-bazel-mode LeAudioServiceTest#testCreateStateMachineStackEvents
Change-Id: I71560c9124c78bbba9f752efbafc8f4a7fd26faa
(cherry picked from commit 18cb2425)
Merged-In: I71560c9124c78bbba9f752efbafc8f4a7fd26faa
parent 5b689ffa
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -662,9 +662,15 @@ public class LeAudioServiceTest {
        mService.bondStateChanged(mLeftDevice, BluetoothDevice.BOND_NONE);
        assertThat(mService.getDevices().contains(mLeftDevice)).isFalse();

        // Remove bond will remove also device descriptor. Device has to be connected again
        assertWithMessage("Connect failed").that(mService.connect(mLeftDevice)).isTrue();
        verifyConnectionStateIntent(LeAudioStateMachine.sConnectTimeoutMs * 2,
                mLeftDevice, BluetoothProfile.STATE_CONNECTING,
                BluetoothProfile.STATE_DISCONNECTED);

        // stack event: CONNECTION_STATE_CONNECTED - state machine should be created
        generateConnectionMessageFromNative(mLeftDevice, BluetoothProfile.STATE_CONNECTED,
                BluetoothProfile.STATE_DISCONNECTED);
                BluetoothProfile.STATE_CONNECTING);
        assertThat(BluetoothProfile.STATE_CONNECTED)
                .isEqualTo(mService.getConnectionState(mLeftDevice));
        assertThat(mService.getDevices().contains(mLeftDevice)).isTrue();