Loading src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +1 −3 Original line number Diff line number Diff line Loading @@ -740,9 +740,7 @@ public class BluetoothDeviceManager { } public boolean isInbandRingingEnabled() { // Get the inband ringing enabled status of expected BT device to route call audio instead // of using the address of currently connected device. BluetoothDevice activeDevice = mBluetoothRouteManager.getMostRecentlyReportedActiveDevice(); BluetoothDevice activeDevice = mBluetoothRouteManager.getBluetoothAudioConnectedDevice(); Log.i(this, "isInbandRingingEnabled: activeDevice: " + activeDevice); if (mBluetoothRouteManager.isCachedLeAudioDevice(activeDevice)) { if (mBluetoothLeAudioService == null) { Loading src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +0 −4 Original line number Diff line number Diff line Loading @@ -691,10 +691,6 @@ public class BluetoothRouteManager extends StateMachine { } } public BluetoothDevice getMostRecentlyReportedActiveDevice() { return mMostRecentlyReportedActiveDevice; } public boolean hasBtActiveDevice() { return mLeAudioActiveDeviceCache != null || mHearingAidActiveDeviceCache != null || Loading tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java +8 −3 Original line number Diff line number Diff line Loading @@ -738,15 +738,20 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase { 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)); receiverUnderTest.onReceive(mContext, buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device2, BluetoothDeviceManager.DEVICE_TYPE_HEADSET)); receiverUnderTest.onReceive(mContext, buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device3, BluetoothDeviceManager.DEVICE_TYPE_LE_AUDIO)); leAudioCallbacksTest.getValue().onGroupNodeAdded(device3, 1); when(mBluetoothLeAudio.getConnectedGroupLeadDevice(1)).thenReturn(device3); when(mRouteManager.getBluetoothAudioConnectedDevice()).thenReturn(device3); when(mRouteManager.isCachedLeAudioDevice(eq(device3))).thenReturn(true); when(mBluetoothLeAudio.getConnectedGroupLeadDevice(1)).thenReturn(device3); when(mRouteManager.getMostRecentlyReportedActiveDevice()).thenReturn(device3); assertEquals(1, mBluetoothDeviceManager.getNumConnectedDevices()); assertEquals(3, mBluetoothDeviceManager.getNumConnectedDevices()); assertTrue(mBluetoothDeviceManager.isInbandRingingEnabled()); } Loading Loading
src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +1 −3 Original line number Diff line number Diff line Loading @@ -740,9 +740,7 @@ public class BluetoothDeviceManager { } public boolean isInbandRingingEnabled() { // Get the inband ringing enabled status of expected BT device to route call audio instead // of using the address of currently connected device. BluetoothDevice activeDevice = mBluetoothRouteManager.getMostRecentlyReportedActiveDevice(); BluetoothDevice activeDevice = mBluetoothRouteManager.getBluetoothAudioConnectedDevice(); Log.i(this, "isInbandRingingEnabled: activeDevice: " + activeDevice); if (mBluetoothRouteManager.isCachedLeAudioDevice(activeDevice)) { if (mBluetoothLeAudioService == null) { Loading
src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +0 −4 Original line number Diff line number Diff line Loading @@ -691,10 +691,6 @@ public class BluetoothRouteManager extends StateMachine { } } public BluetoothDevice getMostRecentlyReportedActiveDevice() { return mMostRecentlyReportedActiveDevice; } public boolean hasBtActiveDevice() { return mLeAudioActiveDeviceCache != null || mHearingAidActiveDeviceCache != null || Loading
tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java +8 −3 Original line number Diff line number Diff line Loading @@ -738,15 +738,20 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase { 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)); receiverUnderTest.onReceive(mContext, buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device2, BluetoothDeviceManager.DEVICE_TYPE_HEADSET)); receiverUnderTest.onReceive(mContext, buildConnectionActionIntent(BluetoothHeadset.STATE_CONNECTED, device3, BluetoothDeviceManager.DEVICE_TYPE_LE_AUDIO)); leAudioCallbacksTest.getValue().onGroupNodeAdded(device3, 1); when(mBluetoothLeAudio.getConnectedGroupLeadDevice(1)).thenReturn(device3); when(mRouteManager.getBluetoothAudioConnectedDevice()).thenReturn(device3); when(mRouteManager.isCachedLeAudioDevice(eq(device3))).thenReturn(true); when(mBluetoothLeAudio.getConnectedGroupLeadDevice(1)).thenReturn(device3); when(mRouteManager.getMostRecentlyReportedActiveDevice()).thenReturn(device3); assertEquals(1, mBluetoothDeviceManager.getNumConnectedDevices()); assertEquals(3, mBluetoothDeviceManager.getNumConnectedDevices()); assertTrue(mBluetoothDeviceManager.isInbandRingingEnabled()); } Loading