This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android Automatically Unbonding on Reconnection

We seem to be having an issue on several Android devices, where reconnecting sometimes triggers an erroneous GATT_INSUF_AUTHORIZATION. This then causes Android to automatically delete the bond information on the phone, meaning our device needs repairing.

Our application uses the same pairing strategy as the ANCS examples found in SDKs 14 and 15. This is easily reproducible using Android nRF connect along with ble_app_ancs_c_pca10040_s132.hex.

The phones that we can reproduce this on so far:

Huawei P10 Lite (Android 7.0)
Pixel (Android 8.0)
Nexus X5, Nokia 6.1 and Pixel (Android 8.1)

So what's going on here that causes this issue? Is there a potential solution?

Android Log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
nRF Connect, 2018-09-06
ANCS (C2:C9:8C:56:D1:0D)
V 10:33:12.318 Connecting to C2:C9:8C:56:D1:0D...
D 10:33:12.318 gatt = device.connectGatt(autoConnect = true, TRANSPORT_LE, preferred PHY = LE 1M)
D 10:33:12.332 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 10:33:12.332 Connected to C2:C9:8C:56:D1:0D
D 10:33:12.333 wait(1600ms)
V 10:33:13.935 Discovering services...
D 10:33:13.935 gatt.discoverServices()
D 10:33:13.969 [Callback] Services discovered with status: 0
I 10:33:13.969 Services discovered
V 10:33:13.983 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
- Central Address Resolution [R] (0x2AA6)
Generic Attribute (0x1801)
D 10:36:03.929 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 10:36:03.929 Error 8 (0x8): GATT CONN TIMEOUT
I 10:36:03.929 Disconnected
D 10:36:03.985 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX