I have an application which connects to a BLE device from various Android devices. The following are working fine: All Samsung phones, OnePlus, LG v40, Redmi Note 8. But Redmi9 and Lenovo TB-8505F do not get connected.
Scanning works and I see my device advertising. But when I call: BluetoothDevice's connectGatt() method I never receive the onConnectionStateChange() callback I usually get. I've tried various connectGatt() parameters but none of them work.
As far as my BLE device is concerned, it is connected just fine. But the Android's OS never sends the callback. Another strange thing is: If I shut down the BLE device, then onConnectionStateChange() gets called with the infamous 133 status.
The following permissions are specified in my manifest file:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />