BluetoothDevice#getName() return null on Android 14
While trying to connect with below steps, Getting null value for BluetoothDevice#getName()
- Scan Bluetooth device
- Cancel pairing request
- Retry the pairing
- BluetoothDevice#getName() returns null in retry
Note: Issue specific to Android 14. Working fine till Android 13.
The GATT Server will broadcast its Services by sending advertising packets. Since the Device Name is optional in AdvertiseData, you may need to include a control like the following in your code. Refer to 1 and 2 By Andrew Lunsford