From 23f2347a4d539473cd1486a40ebaf1e1ed15212b Mon Sep 17 00:00:00 2001 From: Michal Belusiak Date: Wed, 22 Jan 2025 15:03:34 +0000 Subject: Bass: Refactor handling select source requests Collect the variables that depend on syncHandle and modify them together where possible. Add synchronization to ensure they are updated safely. This prevents unexpected behavior from concurrent modifications. Allow the creation of isAddedToSelectSourceRequest since they are modified simultaneously. In the future, this will simplify refactoring to create a single object to store them together. Ignore synced broadcast in onSyncEstablished if there is no pending synchronization. There is no possibility to unsync it as we do not have mPeriodicAdvCallbacksMap for it. Bug: 389722679 Flag: EXEMPT, refactor covered by unit tests Test: atest BassClientServiceTest Change-Id: Iddf2dfdd880b6c9594e6d8e627d9ecabe610cc9e --- framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'framework/java') diff --git a/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java b/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java index 683a5433ac..d8a5b4080e 100644 --- a/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java +++ b/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java @@ -916,7 +916,7 @@ public final class BluetoothLeBroadcastAssistant implements BluetoothProfile, Au @RequiresBluetoothScanPermission @RequiresPermission(allOf = {BLUETOOTH_SCAN, BLUETOOTH_PRIVILEGED}) public boolean isSearchInProgress() { - log("stopSearchingForSources:"); + log("isSearchInProgress:"); final IBluetoothLeBroadcastAssistant service = getService(); final boolean defaultValue = false; if (service == null) { -- cgit v1.2.3-59-g8ed1b