Loading system/gd/rust/linux/stack/src/bluetooth_gatt.rs +13 −2 Original line number Diff line number Diff line Loading @@ -1168,7 +1168,7 @@ pub enum ScanType { impl Default for ScanType { fn default() -> Self { ScanType::Passive ScanType::Active } } Loading Loading @@ -2030,7 +2030,18 @@ impl IBluetoothGatt for BluetoothGatt { let settings = settings.unwrap_or_else(|| ScanSettings { interval: sysprop::get_i32(sysprop::PropertyI32::LeAdvMonScanInterval), window: sysprop::get_i32(sysprop::PropertyI32::LeAdvMonScanWindow), scan_type: ScanType::default(), // TODO(b/290300475): Use the default value (Active) here after the issue is addressed. // TODO(b/262746968): Forward the scanning settings from ARC++ APPs. // Either of the TODOs above could fix this workaround for the below issues: // - b/290300475: Offloaded filtering would be broken on some hardwares if scan mode is // Active. Thus, if |filter| is not none then the scan type should be set // to Passive. // - b/328711786: Android only supports Active scan, i.e., ARC++ APPs always expect // Active scan. However, ARC++ bridge is not able to specify the scan // type through the BluetoothLowEnergyScanSession API. Fortunately ARC++ // bridge is not able to specify the filter either, so when |filter| is // none we always set the scan type to Active. scan_type: if filter.is_none() { ScanType::Active } else { ScanType::Passive }, }); // Multiplexing scanners happens at this layer. The implementations of start_scan Loading Loading
system/gd/rust/linux/stack/src/bluetooth_gatt.rs +13 −2 Original line number Diff line number Diff line Loading @@ -1168,7 +1168,7 @@ pub enum ScanType { impl Default for ScanType { fn default() -> Self { ScanType::Passive ScanType::Active } } Loading Loading @@ -2030,7 +2030,18 @@ impl IBluetoothGatt for BluetoothGatt { let settings = settings.unwrap_or_else(|| ScanSettings { interval: sysprop::get_i32(sysprop::PropertyI32::LeAdvMonScanInterval), window: sysprop::get_i32(sysprop::PropertyI32::LeAdvMonScanWindow), scan_type: ScanType::default(), // TODO(b/290300475): Use the default value (Active) here after the issue is addressed. // TODO(b/262746968): Forward the scanning settings from ARC++ APPs. // Either of the TODOs above could fix this workaround for the below issues: // - b/290300475: Offloaded filtering would be broken on some hardwares if scan mode is // Active. Thus, if |filter| is not none then the scan type should be set // to Passive. // - b/328711786: Android only supports Active scan, i.e., ARC++ APPs always expect // Active scan. However, ARC++ bridge is not able to specify the scan // type through the BluetoothLowEnergyScanSession API. Fortunately ARC++ // bridge is not able to specify the filter either, so when |filter| is // none we always set the scan type to Active. scan_type: if filter.is_none() { ScanType::Active } else { ScanType::Passive }, }); // Multiplexing scanners happens at this layer. The implementations of start_scan Loading