@Override public void onReceive(final Context context, final Intent intent) { final BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); // Skip other devices. if (mBluetoothDevice == null || device == null || !device.getAddress().equals(mBluetoothDevice.getAddress())) return; // String values are used as the constants are not available for Android 4.3. final int variant = intent.getIntExtra("android.bluetooth.device.extra.PAIRING_VARIANT"/*BluetoothDevice.EXTRA_PAIRING_VARIANT*/, 0); log(Log.DEBUG, "[Broadcast] Action received: android.bluetooth.device.action.PAIRING_REQUEST"/*BluetoothDevice.ACTION_PAIRING_REQUEST*/ + ", pairing variant: " + pairingVariantToString(variant) + " (" + variant + ")"); onPairingRequestReceived(device, variant); } };