Skip to content

Device: Start scanning when Bluetooth permission is granted#445

Merged
d4rken merged 1 commit intomainfrom
feat/progressive-permissions
Mar 10, 2026
Merged

Device: Start scanning when Bluetooth permission is granted#445
d4rken merged 1 commit intomainfrom
feat/progressive-permissions

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 10, 2026

What changed

The app no longer blocks all functionality when optional permissions (like notifications or overlay) are missing. As soon as the core Bluetooth scanning permission is granted, the app starts scanning for AirPods and showing devices. Other permission cards remain visible but don't prevent scanning.

Permission cards for scan-critical permissions now appear at the top of the list with a distinct color to help users prioritize what to grant first.

Also fixed the notification permission card incorrectly appearing on Android 12-12L (API 31-32) where it can't actually be granted — the runtime notification permission was introduced in Android 13 (API 33).

Technical Context

  • Added isScanBlocking flag to the Permission enum to classify which permissions are required for BLE scanning vs. optional enhancements (BLUETOOTH, BLUETOOTH_SCAN, ACCESS_FINE_LOCATION are scan-blocking; BLUETOOTH_CONNECT, POST_NOTIFICATIONS, etc. are not)
  • PermissionTool exposes a new missingScanPermissions flow derived from missingPermissions. Monitor service, PodMonitor, and ViewModel gate scanning on this instead of all permissions
  • MonitorControl checked BLUETOOTH_CONNECT instead of BLUETOOTH_SCAN as the scanning gate — fixed
  • BluetoothEventReceiver.hasFeature() and OverviewViewModel.connectedDevices require BLUETOOTH_CONNECT which may not be granted when scanning starts — wrapped in try-catch for graceful degradation
  • BluetoothManager2.connectedDevices already handles SecurityException internally (emits empty list), so PopUpReaction, PlayPause, and AutoConnect degrade gracefully without changes

Allow the app to scan for AirPods when only BLE scan permissions are granted, without waiting for all optional permissions (notifications, overlay, etc.).

Add isScanBlocking flag to Permission enum. Gate monitor service and pod scanning on scan permissions only. Show scan-blocking permission cards with error color and sorted first. Wrap BLUETOOTH_CONNECT-dependent calls in try-catch for graceful degradation. Fix POST_NOTIFICATIONS minApiLevel from S (31) to TIRAMISU (33).
@d4rken d4rken added the enhancement Add a new feature of improve an existing feature label Mar 10, 2026
@d4rken d4rken merged commit 193a103 into main Mar 10, 2026
9 checks passed
@d4rken d4rken deleted the feat/progressive-permissions branch March 10, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Add a new feature of improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant