Android BluetoothDevice.getAlias now insisting it needs API 30 (R)

Viewed 71

Some existing Bluetooth code has started reporting the getAlias() call on a BluetoothDevice now requires API level 30. This is a bit strange, as its all been working previously, and still works happily on pre API level 30 devices.

From what I can glean, getAlias was previously an unsupported call, and it was only officially supported in API level 30. Even though it appears the signature hasn't changed from the pre level 30 implementation, I'm guessing the change to official status from API level 30 is what is triggering lint to raise the warnings. I've annotated the calling function with @SuppressLint("NewApi"), which removes the spurious warning.

Is this expected behaviour when an existing function is officially supported? Is there anything else I should be doing other than simply suppressing the lint warning?

Thanks and regards - Andrew

0 Answers
Related