Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe4129d4 authored by Henri Chataing's avatar Henri Chataing
Browse files

Pandora/Host: Scan for extended advertising reports

LE Audio tests rely on extended advertising
for device discovery; android is not detected with
the current configuration

Bug: 291996279
Test: atest pts-bot
Change-Id: Ie7cf0b5059fc42aae60067905e08ad9b4406ac11
parent 9bf3f751
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -31,8 +31,10 @@ import android.bluetooth.le.AdvertiseData
import android.bluetooth.le.AdvertiseSettings
import android.bluetooth.le.AdvertisingSetParameters
import android.bluetooth.le.ScanCallback
import android.bluetooth.le.ScanFilter
import android.bluetooth.le.ScanRecord
import android.bluetooth.le.ScanResult
import android.bluetooth.le.ScanSettings
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
@@ -468,7 +470,9 @@ class Host(
                        }
                    }
                val bluetoothLeScanner = bluetoothAdapter.bluetoothLeScanner
                bluetoothLeScanner?.startScan(leScanCallback) ?: run { trySendBlocking(null) }
                val leScanFilters: List<ScanFilter> = listOf()
                val leScanSettings = ScanSettings.Builder().setLegacy(false).build()
                bluetoothLeScanner?.startScan(leScanFilters, leScanSettings, leScanCallback) ?: run { trySendBlocking(null) }
                awaitClose { bluetoothLeScanner?.stopScan(leScanCallback) }
            }
            bluetoothDevice = flow.first()