Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +16 −3 Original line number Original line Diff line number Diff line Loading @@ -2255,17 +2255,30 @@ public class LeAudioService extends ProfileService { + ", mExposedActiveDevice: " + ", mExposedActiveDevice: " + mExposedActiveDevice); + mExposedActiveDevice); LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(currentlyActiveGroupId); if (isBroadcastActive() if (isBroadcastActive() && currentlyActiveGroupId == LE_AUDIO_GROUP_ID_INVALID && currentlyActiveGroupId == LE_AUDIO_GROUP_ID_INVALID && mUnicastGroupIdDeactivatedForBroadcastTransition != LE_AUDIO_GROUP_ID_INVALID && mUnicastGroupIdDeactivatedForBroadcastTransition != LE_AUDIO_GROUP_ID_INVALID) { && groupId != LE_AUDIO_GROUP_ID_INVALID) { // If broadcast is ongoing and need to update unicast fallback active group // If broadcast is ongoing and need to update unicast fallback active group // we need to update the cached group id and skip changing the active device // we need to update the cached group id and skip changing the active device updateFallbackUnicastGroupIdForBroadcast(groupId); updateFallbackUnicastGroupIdForBroadcast(groupId); /* In case of removing fallback unicast group, monitoring input device should be * removed from active devices. */ if (groupDescriptor != null && groupId == LE_AUDIO_GROUP_ID_INVALID) { updateActiveDevices( groupId, groupDescriptor.mDirection, AUDIO_DIRECTION_NONE, false, groupDescriptor.mHasFallbackDeviceWhenGettingInactive, false); } return true; return true; } } LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(currentlyActiveGroupId); if (groupDescriptor != null && groupId == currentlyActiveGroupId) { if (groupDescriptor != null && groupId == currentlyActiveGroupId) { /* Make sure active group is already exposed to audio framework. /* Make sure active group is already exposed to audio framework. * If not, lets wait for it and don't sent additional intent. * If not, lets wait for it and don't sent additional intent. Loading android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -1683,6 +1683,12 @@ public class LeAudioServiceTest { // Verify only update the fallback group and not proceed to change active // Verify only update the fallback group and not proceed to change active assertThat(mService.setActiveDevice(mSingleDevice)).isTrue(); assertThat(mService.setActiveDevice(mSingleDevice)).isTrue(); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition).isEqualTo(groupId); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition).isEqualTo(groupId); // Verify only update the fallback group to INVALID and not proceed to change active assertThat(mService.setActiveDevice(null)).isTrue(); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition) .isEqualTo(BluetoothLeAudio.GROUP_ID_INVALID); verify(mNativeInterface, times(0)).groupSetActive(anyInt()); verify(mNativeInterface, times(0)).groupSetActive(anyInt()); } } Loading Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +16 −3 Original line number Original line Diff line number Diff line Loading @@ -2255,17 +2255,30 @@ public class LeAudioService extends ProfileService { + ", mExposedActiveDevice: " + ", mExposedActiveDevice: " + mExposedActiveDevice); + mExposedActiveDevice); LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(currentlyActiveGroupId); if (isBroadcastActive() if (isBroadcastActive() && currentlyActiveGroupId == LE_AUDIO_GROUP_ID_INVALID && currentlyActiveGroupId == LE_AUDIO_GROUP_ID_INVALID && mUnicastGroupIdDeactivatedForBroadcastTransition != LE_AUDIO_GROUP_ID_INVALID && mUnicastGroupIdDeactivatedForBroadcastTransition != LE_AUDIO_GROUP_ID_INVALID) { && groupId != LE_AUDIO_GROUP_ID_INVALID) { // If broadcast is ongoing and need to update unicast fallback active group // If broadcast is ongoing and need to update unicast fallback active group // we need to update the cached group id and skip changing the active device // we need to update the cached group id and skip changing the active device updateFallbackUnicastGroupIdForBroadcast(groupId); updateFallbackUnicastGroupIdForBroadcast(groupId); /* In case of removing fallback unicast group, monitoring input device should be * removed from active devices. */ if (groupDescriptor != null && groupId == LE_AUDIO_GROUP_ID_INVALID) { updateActiveDevices( groupId, groupDescriptor.mDirection, AUDIO_DIRECTION_NONE, false, groupDescriptor.mHasFallbackDeviceWhenGettingInactive, false); } return true; return true; } } LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(currentlyActiveGroupId); if (groupDescriptor != null && groupId == currentlyActiveGroupId) { if (groupDescriptor != null && groupId == currentlyActiveGroupId) { /* Make sure active group is already exposed to audio framework. /* Make sure active group is already exposed to audio framework. * If not, lets wait for it and don't sent additional intent. * If not, lets wait for it and don't sent additional intent. Loading
android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -1683,6 +1683,12 @@ public class LeAudioServiceTest { // Verify only update the fallback group and not proceed to change active // Verify only update the fallback group and not proceed to change active assertThat(mService.setActiveDevice(mSingleDevice)).isTrue(); assertThat(mService.setActiveDevice(mSingleDevice)).isTrue(); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition).isEqualTo(groupId); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition).isEqualTo(groupId); // Verify only update the fallback group to INVALID and not proceed to change active assertThat(mService.setActiveDevice(null)).isTrue(); assertThat(mService.mUnicastGroupIdDeactivatedForBroadcastTransition) .isEqualTo(BluetoothLeAudio.GROUP_ID_INVALID); verify(mNativeInterface, times(0)).groupSetActive(anyInt()); verify(mNativeInterface, times(0)).groupSetActive(anyInt()); } } Loading