[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

@@ -26,7 +26,6 @@ import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothLeAudioContentMetadata;
import android.bluetooth.BluetoothLeBroadcastMetadata;
import android.bluetooth.BluetoothLeBroadcastReceiveState;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
@@ -277,9 +276,7 @@ public class AudioStreamsHelper {
Log.w(TAG, "getConnectedBluetoothDevices(): LeBroadcastAssistant is null!");
return emptyList();
}
List<BluetoothDevice> connectedDevices =
leBroadcastAssistant.getDevicesMatchingConnectionStates(
new int[] {BluetoothProfile.STATE_CONNECTED});
List<BluetoothDevice> connectedDevices = leBroadcastAssistant.getAllConnectedDevices();
Optional<CachedBluetoothDevice> cachedBluetoothDevice =
inSharingOnly
? getCachedBluetoothDeviceInSharing(manager)