Android 17 Bluetooth Changes: Autonomous Re-pairing and What BLE Apps Must Update

Short answer: in Android 17 the system can re-establish a lost Bluetooth bond after the user consents, so people no longer have to unpair and re-pair in Settings. If your BLE app listens for pairing or missing-key events, you should review that code, because the events now carry new context and fire at different times.

What changed

These changes apply to all apps, whatever targetSdkVersion you use, according to Android’s behavior-changes page.

  • Autonomous re-pairing: when a bond is lost, the system can restore it after user consent.
  • Pairing context: ACTION_PAIRING_REQUEST now includes EXTRA_PAIRING_CONTEXT, which tells a normal pairing request apart from a system-started re-pairing.
  • Key updates are conditional: existing keys are replaced only if re-pairing succeeds and the new connection has at least the previous security level.
  • Timing of ACTION_KEY_MISSING: it is broadcast only if autonomous re-pairing fails.

What this means for your app

  1. Do not assume a missing key means “ask the user to re-pair”. The system may fix it first. Show your own re-pair prompt only after ACTION_KEY_MISSING arrives.
  2. Handle pairing requests you did not start. If you show UI on ACTION_PAIRING_REQUEST, read the new pairing-context extra and avoid treating a system-started re-pairing like a first-time pairing.
  3. Watch the bond state, not just your own calls. Bonding can change without your code asking for it.
val receiver = object : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action == BluetoothDevice.ACTION_BOND_STATE_CHANGED) {
            val state = intent.getIntExtra(
                BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR)
            when (state) {
                BluetoothDevice.BOND_BONDED  -> onBonded()
                BluetoothDevice.BOND_BONDING -> onBonding()
                BluetoothDevice.BOND_NONE    -> onBondLost()
            }
        }
    }
}
context.registerReceiver(receiver,
    IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED))

Check the official page for the exact type and values of EXTRA_PAIRING_CONTEXT before relying on it.

How to test it

Android suggests simulating a lost bond by removing the bond information on the peripheral, or by unpairing the device in Settings, then reconnecting from your app on an Android 17 device or emulator. Check that your app reconnects cleanly and that it does not show a confusing “pair again” screen while the system is restoring the bond.

Related BLE guides

Connection drops after a bond problem often look like GATT errors. See our BLE connection troubleshooting guide and the Bluetooth and IoT hub.

FAQ

Does this apply only to apps targeting Android 17?

Per Android’s page, these Bluetooth changes are in the list that applies to all apps.

Do I need new permissions?

The page does not list new permissions for this change. Keep your existing Bluetooth permissions.

What if re-pairing fails?

Then ACTION_KEY_MISSING is broadcast, and you can guide the user to re-pair.

Source: Android 17 behavior changes: all apps on developer.android.com. Details can change before and after release, so check it for the latest wording.