Show device in Media devices section if has LEA member connected
Test: atest Bug: 396009828 Flag: EXEMPT simple fix Change-Id: Icc6bd1c4fa7cf3c43eec1c4c950fbf778975f803
This commit is contained in:
@@ -272,6 +272,20 @@ public class ConnectedBluetoothDeviceUpdaterTest {
|
||||
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_hasLeaMemberConnected_inCall_removesPreference() {
|
||||
setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_IN_CALL);
|
||||
when(mBluetoothDeviceUpdater
|
||||
.isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false);
|
||||
when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO);
|
||||
|
||||
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_leAudioDeviceConnected_notInCall_removesPreference()
|
||||
{
|
||||
@@ -285,6 +299,22 @@ public class ConnectedBluetoothDeviceUpdaterTest {
|
||||
|
||||
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void
|
||||
onProfileConnectionStateChanged_hasLeaMemberConnected_notInCall_removesPreference() {
|
||||
setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL);
|
||||
when(mBluetoothDeviceUpdater
|
||||
.isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false);
|
||||
when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO);
|
||||
|
||||
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_deviceIsNotInList_inCall_invokesRemovesPreference()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user