Loading src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater // If device is LE Audio, it is compatible with HFP and A2DP. // It would show in Available Devices group if the audio sharing flag is disabled or // the device is not in the audio sharing session. if (cachedDevice.isConnectedLeAudioDevice()) { if (cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) { if (BluetoothUtils.isAudioSharingUIAvailable(mContext) && BluetoothUtils.hasConnectedBroadcastSource( cachedDevice, mLocalBtManager)) { Loading src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { // If device is Hearing Aid or LE Audio, it is compatible with HFP and A2DP. // It would not show in Connected Devices group. if (cachedDevice.isConnectedAshaHearingAidDevice() || cachedDevice.isConnectedLeAudioDevice()) { || cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) { if (DBG) { Log.d(TAG, "isFilterMatched() device : " + cachedDevice.getName() + ", isFilterMatched : false, ha or lea device"); } return false; } // According to the current audio profile type, Loading src/com/android/settings/connecteddevice/audiosharing/AudioSharingBluetoothDeviceUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,8 @@ public class AudioSharingBluetoothDeviceUpdater extends BluetoothDeviceUpdater // If device is LE audio device and has a broadcast source, // it would show in audio sharing devices group. if (BluetoothUtils.isAudioSharingUIAvailable(mContext) && cachedDevice.isConnectedLeAudioDevice() && (cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) && BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mLocalBtManager)) { isFilterMatched = true; } Loading src/com/android/settings/connecteddevice/audiosharing/AudioSharingDeviceVolumeControlUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,8 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat if (isDeviceConnected(cachedDevice) && isDeviceInCachedDevicesList(cachedDevice)) { // If device is LE audio device and in a sharing session on current sharing device, // it would show in volume control group. if (cachedDevice.isConnectedLeAudioDevice() if ((cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) && BluetoothUtils.isBroadcasting(mBtManager) && BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mBtManager)) { isFilterMatched = true; Loading tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +41 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,28 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_hasLeaMemberConnected_notInCallFlagOff_addPref() { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater.isDeviceConnected(any(CachedBluetoothDevice.class))) .thenReturn(true); when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false); when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true); when(mAssistant.getAllSources(any())).thenReturn(ImmutableList.of(mBroadcastReceiveState)); List<Long> bisSyncState = new ArrayList<>(); bisSyncState.add(1L); when(mBroadcastReceiveState.getBisSyncState()).thenReturn(bisSyncState); mBluetoothDeviceUpdater.onProfileConnectionStateChanged( mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO); verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_leaConnected_notInCallNotInSharing_addPref() { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); Loading @@ -299,6 +321,25 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_hasLeaMemberConnected_notInCallNotInSharing_addPref() { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater.isDeviceConnected(any(CachedBluetoothDevice.class))) .thenReturn(true); when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false); when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true); when(mAssistant.getAllSources(any())).thenReturn(ImmutableList.of()); mBluetoothDeviceUpdater.onProfileConnectionStateChanged( mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO); verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_leaConnected_inCallSharingFlagOff_addPref() { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); Loading Loading
src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater // If device is LE Audio, it is compatible with HFP and A2DP. // It would show in Available Devices group if the audio sharing flag is disabled or // the device is not in the audio sharing session. if (cachedDevice.isConnectedLeAudioDevice()) { if (cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) { if (BluetoothUtils.isAudioSharingUIAvailable(mContext) && BluetoothUtils.hasConnectedBroadcastSource( cachedDevice, mLocalBtManager)) { Loading
src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { // If device is Hearing Aid or LE Audio, it is compatible with HFP and A2DP. // It would not show in Connected Devices group. if (cachedDevice.isConnectedAshaHearingAidDevice() || cachedDevice.isConnectedLeAudioDevice()) { || cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) { if (DBG) { Log.d(TAG, "isFilterMatched() device : " + cachedDevice.getName() + ", isFilterMatched : false, ha or lea device"); } return false; } // According to the current audio profile type, Loading
src/com/android/settings/connecteddevice/audiosharing/AudioSharingBluetoothDeviceUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,8 @@ public class AudioSharingBluetoothDeviceUpdater extends BluetoothDeviceUpdater // If device is LE audio device and has a broadcast source, // it would show in audio sharing devices group. if (BluetoothUtils.isAudioSharingUIAvailable(mContext) && cachedDevice.isConnectedLeAudioDevice() && (cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) && BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mLocalBtManager)) { isFilterMatched = true; } Loading
src/com/android/settings/connecteddevice/audiosharing/AudioSharingDeviceVolumeControlUpdater.java +2 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,8 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat if (isDeviceConnected(cachedDevice) && isDeviceInCachedDevicesList(cachedDevice)) { // If device is LE audio device and in a sharing session on current sharing device, // it would show in volume control group. if (cachedDevice.isConnectedLeAudioDevice() if ((cachedDevice.isConnectedLeAudioDevice() || cachedDevice.hasConnectedLeAudioMemberDevice()) && BluetoothUtils.isBroadcasting(mBtManager) && BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mBtManager)) { isFilterMatched = true; Loading
tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +41 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,28 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_hasLeaMemberConnected_notInCallFlagOff_addPref() { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater.isDeviceConnected(any(CachedBluetoothDevice.class))) .thenReturn(true); when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false); when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true); when(mAssistant.getAllSources(any())).thenReturn(ImmutableList.of(mBroadcastReceiveState)); List<Long> bisSyncState = new ArrayList<>(); bisSyncState.add(1L); when(mBroadcastReceiveState.getBisSyncState()).thenReturn(bisSyncState); mBluetoothDeviceUpdater.onProfileConnectionStateChanged( mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO); verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_leaConnected_notInCallNotInSharing_addPref() { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); Loading @@ -299,6 +321,25 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_hasLeaMemberConnected_notInCallNotInSharing_addPref() { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater.isDeviceConnected(any(CachedBluetoothDevice.class))) .thenReturn(true); when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(false); when(mCachedBluetoothDevice.hasConnectedLeAudioMemberDevice()).thenReturn(true); when(mAssistant.getAllSources(any())).thenReturn(ImmutableList.of()); mBluetoothDeviceUpdater.onProfileConnectionStateChanged( mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.LE_AUDIO); verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice); } @Test public void onProfileConnectionStateChanged_leaConnected_inCallSharingFlagOff_addPref() { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_LE_AUDIO_SHARING); Loading