summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2023-11-29 21:05:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-11-29 21:05:54 +0000
commit11d0950ae4ca61ffd8dc71d94d6c12df79d5d3fe (patch)
tree78f0ac1d5b6bbdbc1f10d00bcf4f3d69e5822059
parent0e8f43a2a01692b6886a7d6b6365610ce55d0e49 (diff)
downloadTelecomm-11d0950ae4ca61ffd8dc71d94d6c12df79d5d3fe.tar.gz
Revert "Fix ringtone play issue via LE devices."
This reverts commit 0e8f43a2a01692b6886a7d6b6365610ce55d0e49. Reason for revert: This is unflagged code; we can re-add with a flag at a later date. Bug: 278835031 Change-Id: I8cf40fbb58a4f3438cdbbbc95f00145974f88cab
-rw-r--r--src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java4
-rw-r--r--src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java4
-rw-r--r--tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java11
3 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
index 297fd7289..b19bf818f 100644
--- a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
+++ b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
@@ -711,9 +711,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) {
diff --git a/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java b/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
index ce07532af..91c03b6b1 100644
--- a/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
+++ b/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
@@ -652,10 +652,6 @@ public class BluetoothRouteManager extends StateMachine {
}
}
- public BluetoothDevice getMostRecentlyReportedActiveDevice() {
- return mMostRecentlyReportedActiveDevice;
- }
-
public boolean hasBtActiveDevice() {
return mLeAudioActiveDeviceCache != null ||
mHearingAidActiveDeviceCache != null ||
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
index ee6f0f203..a12846845 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
@@ -756,14 +756,19 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase {
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());
}