fix(ble): implement scanning for unbonded devices in common connections ui#4779
Merged
jamesarich merged 2 commits intomainfrom Mar 13, 2026
Merged
fix(ble): implement scanning for unbonded devices in common connections ui#4779jamesarich merged 2 commits intomainfrom
jamesarich merged 2 commits intomainfrom
Conversation
…ons UI
This commit enhances the Bluetooth scanning experience by integrating real-time BLE scanning into the `ScannerViewModel` and displaying both bonded and newly discovered (unbonded) devices in the connections UI.
Specific changes include:
- **Core BLE**: Updated `BleScanner` interface to support an optional `serviceUuid` filter.
- **Android Implementation**: Updated `AndroidBleScanner` to utilize the new `serviceUuid` filter using Nordic's `CentralManager`.
- **ViewModel Logic**:
- Integrated `BleScanner` into `ScannerViewModel` and `AndroidScannerViewModel`.
- Added `startBleScan()` and `stopBleScan()` methods to manage scanning lifecycle.
- Combined bonded devices from the repository with scanned devices, filtering out duplicates and sorting by name.
- Added `isBleScanning` state to track the scanning status.
- **UI Components**:
- Updated `BLEDevices` component to trigger scanning on composition and stop on disposal.
- Added a `LinearProgressIndicator` to provide visual feedback during active scans.
- **Testing**: Refactored `BleScannerTest` to use `AndroidBleScanner` and verified the new filtering logic.
Signed-off-by: James Rich <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4779 +/- ##
=========================================
+ Coverage 9.51% 12.19% +2.68%
=========================================
Files 480 531 +51
Lines 16372 17746 +1374
Branches 2401 2650 +249
=========================================
+ Hits 1558 2165 +607
- Misses 14555 15267 +712
- Partials 259 314 +55 ☔ View full report in Codecov by Sentry. |
Signed-off-by: James Rich <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes devices not showing up on BLE list.
This commit enhances the Bluetooth scanning experience by integrating real-time BLE scanning into the
ScannerViewModeland displaying both bonded and newly discovered (unbonded) devices in the connections UI.Specific changes include:
BleScannerinterface to support an optionalserviceUuidfilter.AndroidBleScannerto utilize the newserviceUuidfilter using Nordic'sCentralManager.BleScannerintoScannerViewModelandAndroidScannerViewModel.startBleScan()andstopBleScan()methods to manage scanning lifecycle.isBleScanningstate to track the scanning status.BLEDevicescomponent to trigger scanning on composition and stop on disposal.LinearProgressIndicatorto provide visual feedback during active scans.BleScannerTestto useAndroidBleScannerand verified the new filtering logic.