0

I am having a weird issue with one of our tablets, if I try to intercept the pairing request, and check the Pairing Variant to provide the pin, the variant is set to 3: int variant = intent.getIntExtra("android.bluetooth.device.extra.PAIRING_VARIANT",0);

As far as the docs go, it should either be 0 or 2

Used as an int extra field in ACTION_PAIRING_REQUEST intents to indicate pairing method used. Possible values are: PAIRING_VARIANT_PIN, PAIRING_VARIANT_PASSKEY_CONFIRMATION https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_VARIANT

Searching a little further, I found that Android Things also has 3 : https://developer.android.com/reference/com/google/android/things/bluetooth/PairingParams.html#PAIRING_VARIANT_CONSENT

However I should definitely not retrieve that on Android 9, so what goes wrong here ? Providing a pin via setPin also results in a failed pairing, how can I pair this tablet by code ?

Tom
  • 170
  • 10
  • Can you post the devices you are trying to pair? – dazza5000 Feb 14 '20 at 14:06
  • Yes it is a Lenovo Tab m10 HD and a microcontroller with BT – Tom Feb 14 '20 at 21:21
  • You look like you are pretty good at digging through docs - you prob need to dig through the SDK / bluetooth source and find out how that flag is generated. The framework side is here at the following link - I havent been able to find the core/native side https://github.com/aosp-mirror/platform_frameworks_base/blob/e80b45506501815061b079dcb10bf87443bd385d/core/java/android/bluetooth/BluetoothDevice.java#L321 – dazza5000 Feb 14 '20 at 22:11
  • The bluedroid source is here, but android might be using a different stack now https://android.googlesource.com/platform/external/bluetooth/bluedroid/ – dazza5000 Feb 14 '20 at 22:17

0 Answers0