[Audiosharing] Check profile readiness before adding source

Test: atest
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Bug: 362858921
Change-Id: I9ee6226d1bd16225adf1756678ef7565941d7c60
This commit is contained in:
Yiyi Shen
2024-12-09 12:01:49 +08:00
parent 05783a589d
commit c9c088ae34
2 changed files with 42 additions and 4 deletions

View File

@@ -308,6 +308,9 @@ public class BluetoothDevicePairingDetailBaseTest {
shadowOf(Looper.getMainLooper()).idle();
when(mCachedBluetoothDevice.isConnected()).thenReturn(true);
when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(true);
when(mCachedBluetoothDevice.isConnectedLeAudioBroadcastAssistantDevice()).thenReturn(true);
when(mCachedBluetoothDevice.isConnectedVolumeControlDevice()).thenReturn(true);
mFragment.onProfileConnectionStateChanged(mCachedBluetoothDevice,
BluetoothAdapter.STATE_CONNECTED, BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT);