Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -2832,7 +2832,12 @@ public class LeAudioService extends ProfileService { + " ringtone supported: " + " ringtone supported: " + ringtoneContextAvailable); + ringtoneContextAvailable); boolean isRingtoneEnabled = (groupDescriptor.isActive() && ringtoneContextAvailable); /* Enable ringtone for active Unciast group or in broadcast handover mode */ boolean isRingtoneEnabled = ((groupDescriptor.isActive() || isPrimaryGroup(groupId) || isBroadcastReadyToBeReActivated()) && ringtoneContextAvailable); Log.d( Log.d( TAG, TAG, Loading android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioBroadcastServiceTest.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.ServiceFactory; import com.android.bluetooth.btservice.ServiceFactory; import com.android.bluetooth.btservice.storage.DatabaseManager; import com.android.bluetooth.btservice.storage.DatabaseManager; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.tbs.TbsService; import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Assert; Loading Loading @@ -88,6 +89,7 @@ public class LeAudioBroadcastServiceTest { @Mock private LeAudioNativeInterface mLeAudioNativeInterface; @Mock private LeAudioNativeInterface mLeAudioNativeInterface; @Mock private LeAudioTmapGattServer mTmapGattServer; @Mock private LeAudioTmapGattServer mTmapGattServer; @Mock private BassClientService mBassClientService; @Mock private BassClientService mBassClientService; @Mock private TbsService mTbsService; @Spy private LeAudioObjectsFactory mObjectsFactory = LeAudioObjectsFactory.getInstance(); @Spy private LeAudioObjectsFactory mObjectsFactory = LeAudioObjectsFactory.getInstance(); @Spy private ServiceFactory mServiceFactory = new ServiceFactory(); @Spy private ServiceFactory mServiceFactory = new ServiceFactory(); Loading Loading @@ -215,6 +217,7 @@ public class LeAudioBroadcastServiceTest { mService.mAudioManager = mAudioManager; mService.mAudioManager = mAudioManager; mService.mServiceFactory = mServiceFactory; mService.mServiceFactory = mServiceFactory; mService.mTbsService = mTbsService; when(mServiceFactory.getBassClientService()).thenReturn(mBassClientService); when(mServiceFactory.getBassClientService()).thenReturn(mBassClientService); // Set up the State Changed receiver // Set up the State Changed receiver IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter(); Loading Loading @@ -725,7 +728,7 @@ public class LeAudioBroadcastServiceTest { int direction = 3; int direction = 3; int snkAudioLocation = 3; int snkAudioLocation = 3; int srcAudioLocation = 4; int srcAudioLocation = 4; int availableContexts = 5; int availableContexts = 5 + BluetoothLeAudio.CONTEXT_TYPE_RINGTONE; /* Initialize native */ /* Initialize native */ LeAudioStackEvent stackEvent = LeAudioStackEvent stackEvent = Loading Loading @@ -896,6 +899,8 @@ public class LeAudioBroadcastServiceTest { create_event.valueInt2 = LeAudioStackEvent.GROUP_STATUS_ACTIVE; create_event.valueInt2 = LeAudioStackEvent.GROUP_STATUS_ACTIVE; mService.messageFromNative(create_event); mService.messageFromNative(create_event); verify(mTbsService, times(1)).setInbandRingtoneSupport(eq(mDevice)); /* Verify Unicast input and output devices changed from null to mDevice */ /* Verify Unicast input and output devices changed from null to mDevice */ verify(mAudioManager, times(2)) verify(mAudioManager, times(2)) .handleBluetoothActiveDeviceChanged( .handleBluetoothActiveDeviceChanged( Loading Loading @@ -971,6 +976,8 @@ public class LeAudioBroadcastServiceTest { create_event.valueInt1 = broadcastId; create_event.valueInt1 = broadcastId; create_event.valueInt2 = LeAudioStackEvent.BROADCAST_STATE_STREAMING; create_event.valueInt2 = LeAudioStackEvent.BROADCAST_STATE_STREAMING; mService.messageFromNative(create_event); mService.messageFromNative(create_event); verify(mTbsService, times(0)).clearInbandRingtoneSupport(eq(mDevice)); } } @Test @Test Loading Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -2832,7 +2832,12 @@ public class LeAudioService extends ProfileService { + " ringtone supported: " + " ringtone supported: " + ringtoneContextAvailable); + ringtoneContextAvailable); boolean isRingtoneEnabled = (groupDescriptor.isActive() && ringtoneContextAvailable); /* Enable ringtone for active Unciast group or in broadcast handover mode */ boolean isRingtoneEnabled = ((groupDescriptor.isActive() || isPrimaryGroup(groupId) || isBroadcastReadyToBeReActivated()) && ringtoneContextAvailable); Log.d( Log.d( TAG, TAG, Loading
android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioBroadcastServiceTest.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.ServiceFactory; import com.android.bluetooth.btservice.ServiceFactory; import com.android.bluetooth.btservice.storage.DatabaseManager; import com.android.bluetooth.btservice.storage.DatabaseManager; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.tbs.TbsService; import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Assert; Loading Loading @@ -88,6 +89,7 @@ public class LeAudioBroadcastServiceTest { @Mock private LeAudioNativeInterface mLeAudioNativeInterface; @Mock private LeAudioNativeInterface mLeAudioNativeInterface; @Mock private LeAudioTmapGattServer mTmapGattServer; @Mock private LeAudioTmapGattServer mTmapGattServer; @Mock private BassClientService mBassClientService; @Mock private BassClientService mBassClientService; @Mock private TbsService mTbsService; @Spy private LeAudioObjectsFactory mObjectsFactory = LeAudioObjectsFactory.getInstance(); @Spy private LeAudioObjectsFactory mObjectsFactory = LeAudioObjectsFactory.getInstance(); @Spy private ServiceFactory mServiceFactory = new ServiceFactory(); @Spy private ServiceFactory mServiceFactory = new ServiceFactory(); Loading Loading @@ -215,6 +217,7 @@ public class LeAudioBroadcastServiceTest { mService.mAudioManager = mAudioManager; mService.mAudioManager = mAudioManager; mService.mServiceFactory = mServiceFactory; mService.mServiceFactory = mServiceFactory; mService.mTbsService = mTbsService; when(mServiceFactory.getBassClientService()).thenReturn(mBassClientService); when(mServiceFactory.getBassClientService()).thenReturn(mBassClientService); // Set up the State Changed receiver // Set up the State Changed receiver IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter(); Loading Loading @@ -725,7 +728,7 @@ public class LeAudioBroadcastServiceTest { int direction = 3; int direction = 3; int snkAudioLocation = 3; int snkAudioLocation = 3; int srcAudioLocation = 4; int srcAudioLocation = 4; int availableContexts = 5; int availableContexts = 5 + BluetoothLeAudio.CONTEXT_TYPE_RINGTONE; /* Initialize native */ /* Initialize native */ LeAudioStackEvent stackEvent = LeAudioStackEvent stackEvent = Loading Loading @@ -896,6 +899,8 @@ public class LeAudioBroadcastServiceTest { create_event.valueInt2 = LeAudioStackEvent.GROUP_STATUS_ACTIVE; create_event.valueInt2 = LeAudioStackEvent.GROUP_STATUS_ACTIVE; mService.messageFromNative(create_event); mService.messageFromNative(create_event); verify(mTbsService, times(1)).setInbandRingtoneSupport(eq(mDevice)); /* Verify Unicast input and output devices changed from null to mDevice */ /* Verify Unicast input and output devices changed from null to mDevice */ verify(mAudioManager, times(2)) verify(mAudioManager, times(2)) .handleBluetoothActiveDeviceChanged( .handleBluetoothActiveDeviceChanged( Loading Loading @@ -971,6 +976,8 @@ public class LeAudioBroadcastServiceTest { create_event.valueInt1 = broadcastId; create_event.valueInt1 = broadcastId; create_event.valueInt2 = LeAudioStackEvent.BROADCAST_STATE_STREAMING; create_event.valueInt2 = LeAudioStackEvent.BROADCAST_STATE_STREAMING; mService.messageFromNative(create_event); mService.messageFromNative(create_event); verify(mTbsService, times(0)).clearInbandRingtoneSupport(eq(mDevice)); } } @Test @Test Loading