Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03888dea authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

LeAudio: Use new isInbandRingtoneEnabled API am: 219bc5b5

parents 897a5210 219bc5b5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -650,7 +650,12 @@ public class BluetoothDeviceManager {
        BluetoothDevice activeDevice = mBluetoothRouteManager.getBluetoothAudioConnectedDevice();
        Log.i(this, "isInbandRingingEnabled: activeDevice: " + activeDevice);
        if (mBluetoothRouteManager.isCachedLeAudioDevice(activeDevice)) {
            return true;
            if (mBluetoothLeAudioService == null) {
                Log.i(this, "isInbandRingingEnabled: no leaudio service available.");
                return false;
            }
            int groupId = mBluetoothLeAudioService.getGroupId(activeDevice);
            return mBluetoothLeAudioService.isInbandRingtoneEnabled(groupId);
        } else {
            if (mBluetoothHeadset == null) {
                Log.i(this, "isInbandRingingEnabled: no headset service available.");
+2 −0
Original line number Diff line number Diff line
@@ -522,6 +522,8 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase {
    @Test
    public void testInBandRingingEnabledForLeDevice() {
        when(mBluetoothHeadset.isInbandRingingEnabled()).thenReturn(false);
        when(mBluetoothLeAudio.isInbandRingtoneEnabled(1)).thenReturn(true);
        when(mBluetoothLeAudio.getGroupId(eq(device3))).thenReturn(1);
        receiverUnderTest.onReceive(mContext,
                buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device1,
                        BluetoothDeviceManager.DEVICE_TYPE_HEADSET));