Skip to content

feat(bluetooth): Request location permission for BLE scan pre S#3724

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

feat(bluetooth): Request location permission for BLE scan pre S#3724
jamesarich merged 1 commit into
mainfrom
fix/perms2

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

On Android versions prior to SDK 31 (Android S), ACCESS_FINE_LOCATION permission is required to perform a Bluetooth LE scan. This commit adds a conditional check for the device's SDK version.

  • If the SDK version is S (31) or higher, it requests BLUETOOTH_SCAN and BLUETOOTH_CONNECT.
  • If the SDK version is lower, it requests ACCESS_FINE_LOCATION.

This ensures the app has the necessary permissions to scan for BLE devices across different Android versions.

…droid versions

On Android versions prior to SDK 31 (Android S), `ACCESS_FINE_LOCATION` permission is required to perform a Bluetooth LE scan. This commit adds a conditional check for the device's SDK version.

- If the SDK version is S (31) or higher, it requests `BLUETOOTH_SCAN` and `BLUETOOTH_CONNECT`.
- If the SDK version is lower, it requests `ACCESS_FINE_LOCATION`.

This ensures the app has the necessary permissions to scan for BLE devices across different Android versions.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@github-actions github-actions Bot added the bugfix PR tag label Nov 17, 2025
@jamesarich jamesarich merged commit 05222c1 into main Nov 17, 2025
4 checks passed
@jamesarich jamesarich deleted the fix/perms2 branch November 17, 2025 21:46
@codecov

codecov Bot commented Nov 17, 2025

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...ville/mesh/ui/connections/components/BLEDevices.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3724      +/-   ##
========================================
- Coverage   0.56%   0.56%   -0.01%     
========================================
  Files        381     381              
  Lines      21695   21697       +2     
  Branches    2677    2678       +1     
========================================
  Hits         122     122              
- Misses     21552   21554       +2     
  Partials      21      21              

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

mdecourcy pushed a commit to mdecourcy/Meshtastic-Android that referenced this pull request Nov 19, 2025
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.

1 participant