twilio / audioswitch

An Android audio management library for real-time communication apps.
Apache License 2.0
160 stars 49 forks source link

Remove BLUETOOTH_CONNECT permission for API superior 23 #135

Closed rcaceiro closed 1 year ago

rcaceiro commented 1 year ago

Description

The bluetooth permissions are currently only used to get information about Bluetooth devices, and aren't actually needed to connect/route audio to the bluetooth device.

The callback AudioManager.registerAudioDeviceCallback since API 23, avoid the need for the BLUETOOTH_CONNECT permission. This is particularly important on API 31 and up, where the BLUETOOTH_CONNECT is a runtime permission (with a rather confusing permission message).

Breakdown

Validation

Additional Notes

https://github.com/twilio/audioswitch/issues/134 https://github.com/twilio/audioswitch/issues/118 https://github.com/twilio/audioswitch/issues/115 https://github.com/twilio/audioswitch/issues/92

Submission Checklist

davidliu commented 1 year ago

The AudioSwitch AndroidManifest.xml currently includes BLUETOOTH_CONNECT, so that should probably be removed.