[Audiosharing] Clean up dup codes

Bug: 305620450
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Test: atest
Change-Id: Ife2bf26d78e522dc51891be633d6635883923de3
This commit is contained in:
Yiyi Shen
2024-07-30 15:34:09 +08:00
parent cadfc0187d
commit 7b2435a01c
37 changed files with 182 additions and 302 deletions

View File

@@ -67,7 +67,7 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat
// 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()
&& AudioSharingUtils.isBroadcasting(mBtManager)
&& BluetoothUtils.isBroadcasting(mBtManager)
&& BluetoothUtils.hasConnectedBroadcastSource(cachedDevice, mBtManager)) {
isFilterMatched = true;
}
@@ -103,11 +103,11 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
int progress = seekBar.getProgress();
int groupId = AudioSharingUtils.getGroupId(cachedDevice);
int groupId = BluetoothUtils.getGroupId(cachedDevice);
if (groupId != BluetoothCsipSetCoordinator.GROUP_ID_INVALID
&& groupId
== AudioSharingUtils.getFallbackActiveGroupId(
mContext)) {
== BluetoothUtils.getPrimaryGroupIdForBroadcast(
mContext.getContentResolver())) {
// Set media stream volume for primary buds, audio manager will
// update all buds volume in the audio sharing.
setAudioManagerStreamVolume(progress);