Use LocalBluetoothLeBroadcastSourceState.

Test: atest
Bug: 308368124
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: Ic49a6782b63c91e95dd16898b5443585068e45f0
This commit is contained in:
chelseahao
2025-01-09 17:20:50 +08:00
committed by Chelsea Hao
parent f48f0573e1
commit 47fcd60315
14 changed files with 263 additions and 287 deletions

View File

@@ -46,6 +46,7 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadow.api.Shadow;
import java.util.ArrayList;
import java.util.List;
@RunWith(RobolectricTestRunner.class)
@@ -143,9 +144,12 @@ public class BluetoothDetailsAudioSharingControllerTest extends BluetoothDetails
@Test
@EnableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING)
public void connected_hasConnectedBroadcastSource_showTwoPreference() {
public void connected_hasBroadcastSource_showTwoPreference() {
when(mCachedDevice.isConnectedLeAudioDevice()).thenReturn(true);
when(mCachedDevice.isActiveDevice(BluetoothProfile.LE_AUDIO)).thenReturn(false);
List<Long> bisSyncState = new ArrayList<>();
bisSyncState.add(1L);
when(mBroadcastReceiveState.getBisSyncState()).thenReturn(bisSyncState);
when(mLocalManager
.getProfileManager()
.getLeAudioBroadcastAssistantProfile()