diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-12-05 02:23:23 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-12-05 02:23:23 +0800 |
commit | 3bb84d53b53eba6bea0cb6bf8e0eb9983acf5707 (patch) | |
tree | e36f3ff3381be897e5ccfdec71925584488e8604 | |
parent | abdfb7ff0b381bf5dad304e20b000e02ef567459 (diff) |
Revert "Backporting of ADM and LE-A related changes"tachibana-mr1
This commit was introduced in QSSI 11900 merge and should be reverted
for depending on proprietary classes.
This reverts commit ce25bea4af28c097d5c44132e495344a54ca9e76.
Change-Id: Ic3e505872dbc2ad0334a53d27270546cfd50936b
3 files changed, 9 insertions, 40 deletions
diff --git a/src/com/android/bluetooth/btservice/ActiveDeviceManager.java b/src/com/android/bluetooth/btservice/ActiveDeviceManager.java index d4a90064a..166b386e0 100644 --- a/src/com/android/bluetooth/btservice/ActiveDeviceManager.java +++ b/src/com/android/bluetooth/btservice/ActiveDeviceManager.java @@ -252,18 +252,8 @@ public class ActiveDeviceManager { "handleMessage(MESSAGE_LE_AUDIO_ACTION_CONNECTION_STATE_CHANGED):" + " device " + device + " connected"); } - if (mLeAudioActiveDevice != null) { - LeAudioService leAudioService = mFactory.getLeAudioService(); - int groupId = leAudioService.getGroupId(mLeAudioActiveDevice); - if (leAudioService.getGroupId(device) == groupId) { - Log.d(TAG, "Lead device is already active"); - } else { - setLeAudioActiveDevice(device); - break; - } - } else { - setLeAudioActiveDevice(device); - } + + setLeAudioActiveDevice(device); break; } @@ -277,7 +267,6 @@ public class ActiveDeviceManager { int mMediaProfile = getCurrentActiveProfile(ApmConstIntf.AudioFeatures.MEDIA_AUDIO); if (mMediaProfile == ApmConstIntf.AudioProfiles.A2DP) { - mLeAudioActiveDevice = null; if (DBG) { Log.d(TAG, "cuurent active profile is A2DP" + "Not setting active device null for LEAUDIO"); @@ -299,8 +288,7 @@ public class ActiveDeviceManager { List<BluetoothDevice> leAudioConnectedDevice = leAudioService.getConnectedDevices(); for (BluetoothDevice peerDevice : leAudioConnectedDevice) { - if (!Objects.equals(peerDevice, device) && - leAudioService.getGroupId(peerDevice) == groupId) { + if (leAudioService.getGroupId(peerDevice) == groupId) { peerLeAudioDevice = peerDevice; break; } @@ -341,11 +329,9 @@ public class ActiveDeviceManager { Log.w(TAG, "Set leAudio active device to null"); setLeAudioActiveDevice(null); } else if(isMediaActive || isBroadcastActive) { - mLeAudioActiveDevice = null; activeDeviceManager.setActiveDevice(null, ApmConstIntf.AudioFeatures.MEDIA_AUDIO); } else if(isCallActive) { - mLeAudioActiveDevice = null; activeDeviceManager.setActiveDevice(null, ApmConstIntf.AudioFeatures.CALL_AUDIO); } @@ -1004,7 +990,7 @@ public class ActiveDeviceManager { if (leAudioService == null) { return false; } - if (!leAudioService.setActiveDeviceBlocking(device)) { + if (!leAudioService.setActiveDevice(device)) { return false; } mLeAudioActiveDevice = device; diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 9a5e9b066..38afb0b59 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -4822,7 +4822,7 @@ public class AdapterService extends Service { if (setA2dp && mA2dpService != null) { if(isQtiLeAudioEnabled || isAospLeaEnabled) { - activeDeviceManager.setActiveDevice(device, + activeDeviceManager.setActiveDeviceBlocking(device, ApmConstIntf.AudioFeatures.MEDIA_AUDIO, true); } else { Log.i(TAG, "setActiveDevice: Setting active A2dp device " + device); diff --git a/src/com/android/bluetooth/le_audio/LeAudioService.java b/src/com/android/bluetooth/le_audio/LeAudioService.java index 45ffb9b99..ed1acb317 100644 --- a/src/com/android/bluetooth/le_audio/LeAudioService.java +++ b/src/com/android/bluetooth/le_audio/LeAudioService.java @@ -1257,29 +1257,12 @@ public class LeAudioService extends ProfileService { mActiveAudioInDevice = activeDeviceManager.getActiveAbsoluteDevice(ApmConstIntf.AudioFeatures.CALL_AUDIO); */ - int ActiveAudioMediaProfile = - activeDeviceManager.getActiveProfile(ApmConstIntf.AudioFeatures.MEDIA_AUDIO); - int ActiveAudioCallProfile = - activeDeviceManager.getActiveProfile(ApmConstIntf.AudioFeatures.CALL_AUDIO); - if ((ActiveAudioMediaProfile == ApmConst.AudioProfiles.BROADCAST_LE) && - (ActiveAudioCallProfile == ApmConst.AudioProfiles.TMAP_CALL || - ActiveAudioCallProfile == ApmConst.AudioProfiles.BAP_CALL)) { - mActiveAudioOutDevice = mActiveAudioInDevice; - } activeDevices.add(0, mActiveAudioOutDevice); - int activeGid = getGroupId(mActiveAudioOutDevice); - if (activeGid < INVALID_SET_ID) { - for (BluetoothDevice dev : getGroupDevices(activeGid)) { - if (!dev.equals(mActiveAudioOutDevice)) { - activeDevices.add(1, dev); - } - } - } else { - activeDevices.add(1, mActiveAudioInDevice); - } - Log.d(TAG, "getActiveDevices: LeAudio devices: Dev_1[" + activeDevices.get(0) + - "] - Dev_2[" + activeDevices.get(1) + "]"); + activeDevices.add(1, mActiveAudioInDevice); + + Log.d(TAG, "getActiveDevices: LeAudio devices: Out[" + activeDevices.get(0) + + "] - In[" + activeDevices.get(1) + "]"); return activeDevices; } |