Control broadcast assistant profile connection with le toggle
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsProfilesControllerTest Test: manual test with le toggle and check bass profile is enabled/disabled Bug: 300227308 Change-Id: If61b1edadb24b53661bb74173c243826f31956ae
This commit is contained in:
@@ -350,6 +350,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
}
|
||||
|
||||
LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile();
|
||||
LocalBluetoothProfile broadcastAssistant =
|
||||
mProfileManager.getLeAudioBroadcastAssistantProfile();
|
||||
|
||||
for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
|
||||
Log.d(TAG,
|
||||
@@ -359,6 +361,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
if (asha != null) {
|
||||
asha.setEnabled(leAudioDevice.getDevice(), true);
|
||||
}
|
||||
if (broadcastAssistant != null) {
|
||||
Log.d(TAG,
|
||||
"device:" + leAudioDevice.getDevice().getAnonymizedAddress()
|
||||
+ " disable LE broadcast assistant profile");
|
||||
broadcastAssistant.setEnabled(leAudioDevice.getDevice(), false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) {
|
||||
@@ -385,6 +393,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
disableProfileBeforeUserEnablesLeAudio(mProfileManager.getHeadsetProfile());
|
||||
}
|
||||
LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile();
|
||||
LocalBluetoothProfile broadcastAssistant =
|
||||
mProfileManager.getLeAudioBroadcastAssistantProfile();
|
||||
|
||||
for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
|
||||
Log.d(TAG,
|
||||
@@ -394,6 +404,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
if (asha != null) {
|
||||
asha.setEnabled(leAudioDevice.getDevice(), false);
|
||||
}
|
||||
if (broadcastAssistant != null) {
|
||||
Log.d(TAG,
|
||||
"device:" + leAudioDevice.getDevice().getAnonymizedAddress()
|
||||
+ " enable LE broadcast assistant profile");
|
||||
broadcastAssistant.setEnabled(leAudioDevice.getDevice(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user