The root of the problem is the Linux interface mode. Bluetooth devices that support BR / EDR (Classic) and LE by default are in two modes. That is, they can work as a classic or LE device. I don’t have an understanding of the Android API and you didn’t try to develop an Android application that can detect a device with two modes and select a connection as LE using Just Working pairing. But I managed to disable BR / EDR on the interface and confirm that Android detected it during the scan as only a single-mode interface. After that, the Android application easily connected using Just Working pairing.
Here's how I disabled BR / EDR on the interface:
$ sudo hciconfig hci0 down $ sudo ./btmgmt bredr off hci0 Set BR/EDR complete, settings: connectable bondable le $ sudo hciconfig hci0 up $ sudo hciconfig hci0 leadv
You can create the btmgmt application on Linux by downloading and building Bluez. The btmgmt application is built conditionally on the --enable-experimental configuration parameter.
UPDATE: Another approach is not to change the capabilities of an interface, but to simply change the capabilities of a broadcast interface. This is done through advertising flags. Change flags for translation that BR / EDR is not supported. This is bit 2, and it will generate flags in 0x04 format. (See Bluetooth SIG doc CSS v4 Section: Part A, Section 1.3.2)
source share