Skip to content

fix(bluetooth): Check for permissions before accessing bonded devices#3720

Merged
jamesarich merged 1 commit into
mainfrom
fix/perms
Nov 17, 2025
Merged

fix(bluetooth): Check for permissions before accessing bonded devices#3720
jamesarich merged 1 commit into
mainfrom
fix/perms

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

resolves #3719

This addresses a potential crash by ensuring Bluetooth permissions are checked before attempting to access bonded peripherals.

Specifically, getBondedAppPeripherals now verifies hasBluetoothPermission() before retrieving the list of bonded devices.

Additionally, a toast notification has been added to inform the user when necessary permissions are missing for a Bluetooth scan.

resolves #3719

This addresses a potential crash by ensuring Bluetooth permissions are checked before attempting to access bonded peripherals.

Specifically, `getBondedAppPeripherals` now verifies `hasBluetoothPermission()` before retrieving the list of bonded devices.

Additionally, a toast notification has been added to inform the user when necessary permissions are missing for a Bluetooth scan.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich enabled auto-merge November 17, 2025 12:29
@github-actions github-actions Bot added the bugfix PR tag label Nov 17, 2025
@codecov

codecov Bot commented Nov 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.56%. Comparing base (d6f39fd) to head (c18f260).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ville/mesh/ui/connections/components/BLEDevices.kt 0.00% 6 Missing ⚠️
...e/mesh/repository/bluetooth/BluetoothRepository.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3720      +/-   ##
========================================
- Coverage   0.56%   0.56%   -0.01%     
========================================
  Files        380     380              
  Lines      21647   21649       +2     
  Branches    2654    2653       -1     
========================================
  Hits         122     122              
- Misses     21504   21506       +2     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Nov 17, 2025
Merged via the queue into main with commit 12ccb34 Nov 17, 2025
6 checks passed
@jamesarich jamesarich deleted the fix/perms branch November 17, 2025 12:41
mdecourcy pushed a commit to mdecourcy/Meshtastic-Android that referenced this pull request Nov 19, 2025
…meshtastic#3720)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Nordic BLE library does not ask for permissions from user before instantly killing the application, so permissions can never be granted

1 participant