Merge "Show device in Media devices section if has LEA member connected" into main

This commit is contained in:
Yiyi Shen
2025-02-14 02:03:04 -08:00
committed by Android (Google) Code Review
8 changed files with 234 additions and 14 deletions

View File

@@ -79,7 +79,8 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater
// If device is LE Audio, it is compatible with HFP and A2DP.
// It would show in Available Devices group if the audio sharing flag is disabled or
// the device is not in the audio sharing session.
if (cachedDevice.isConnectedLeAudioDevice()) {
if (cachedDevice.isConnectedLeAudioDevice()
|| cachedDevice.hasConnectedLeAudioMemberDevice()) {
if (BluetoothUtils.isAudioSharingUIAvailable(mContext)
&& BluetoothUtils.hasConnectedBroadcastSource(
cachedDevice, mLocalBtManager)) {

View File

@@ -77,7 +77,12 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
// If device is Hearing Aid or LE Audio, it is compatible with HFP and A2DP.
// It would not show in Connected Devices group.
if (cachedDevice.isConnectedAshaHearingAidDevice()
|| cachedDevice.isConnectedLeAudioDevice()) {
|| cachedDevice.isConnectedLeAudioDevice()
|| cachedDevice.hasConnectedLeAudioMemberDevice()) {
if (DBG) {
Log.d(TAG, "isFilterMatched() device : " + cachedDevice.getName()
+ ", isFilterMatched : false, ha or lea device");
}
return false;
}
// According to the current audio profile type,

View File

@@ -56,7 +56,8 @@ public class AudioSharingBluetoothDeviceUpdater extends BluetoothDeviceUpdater
// If device is LE audio device and has a broadcast source,
// it would show in audio sharing devices group.
if (BluetoothUtils.isAudioSharingUIAvailable(mContext)
&& cachedDevice.isConnectedLeAudioDevice()
&& (cachedDevice.isConnectedLeAudioDevice()
|| cachedDevice.hasConnectedLeAudioMemberDevice())
&& BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mLocalBtManager)) {
isFilterMatched = true;
}

View File

@@ -62,7 +62,8 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat
if (isDeviceConnected(cachedDevice) && isDeviceInCachedDevicesList(cachedDevice)) {
// If device is LE audio device and in a sharing session on current sharing device,
// it would show in volume control group.
if (cachedDevice.isConnectedLeAudioDevice()
if ((cachedDevice.isConnectedLeAudioDevice()
|| cachedDevice.hasConnectedLeAudioMemberDevice())
&& BluetoothUtils.isBroadcasting(mBtManager)
&& BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mBtManager)) {
isFilterMatched = true;