Android requires additional permissions declared in the manifest for an app to run a BLE scan since API 23 (6.0 / Marshmallow) and perform a Bluetooth Low Energy connection since API 31 (Android 12). These permissions currently assume scanning is only used when the App is in the foreground, and that the App wants to derive the user's location from Bluetooth Low Energy signal (on API >= 23). Below are a number of additions you can make to your AndroidManifext.xml for your specific use case.

Location permission for Bluetooth Low Energy Scanning

Bridgefy uses the uses-permission-sdk-23 tag to require location only on APIs >= 23, you can request the required permissions by adding the following to your AndroidManifest.xml:

<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"
    android:maxSdkVersion="30"
    tools:node="replace" />
    o
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION"
    android:maxSdkVersion="32"
    tools:node="replace" />

Scan in the background and support APIs 29 & 32

You should add the following to your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
android:maxSdkVersion="32" />

If you want to access the user's location in the background on APIs > 30, remove the android:maxSdkVersion attribute.

Location from BLE scanning in API >= 31

API 31 (Android 12) introduced new Bluetooth permissions. Bridgefy uses the android:usesPermissionFlags="neverForLocation" attribute on the BLUETOOTH_SCAN permission, which indicates scanning will not be used to derive the user's location, so location permissions are not required. If you need to locate the user with BLE scanning, use this instead, but keep in mind that you will still need ACCESS_FINE_LOCATION:

<uses-permission android:name="android.permission.BLUETOOTH_SCAN" tools:node="replace" />

Connect peripherals

You add the BLUETOOTH_CONNECT permission that Bridgefy requests in APIs >= 31:

<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

Summary of available permissions

Required permissions

A summary of available runtime permissions used for BLE:

from API to API (inclusive) Acceptable runtime permissions
18 22 (No runtime permissions needed)
23 28 One of below: