Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxBleDevice#getName with no BLUETOOTH_CONNECT permission #799

Open
dariuszseweryn opened this issue Jun 30, 2022 · 0 comments
Open

RxBleDevice#getName with no BLUETOOTH_CONNECT permission #799

dariuszseweryn opened this issue Jun 30, 2022 · 0 comments

Comments

@dariuszseweryn
Copy link
Owner

Is your feature request related to a problem? Please describe.
Calling RxBleDevice#getName with no BLUETOOTH_CONNECT permission causes a SecurityException.

Describe the solution you'd like
In case BLUETOOTH_CONNECT permission is not granted RxBleDevice#getName would log a warning and return null. Add a javadoc comment that BLUETOOTH_CONNECT is needed on API >=31 for this function to return result.

Describe alternatives you've considered
Add a javadoc comment that BLUETOOTH_CONNECT is needed on API >=31 to call this function.

Additional context

java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10481, packageName = com.polidea.rxandroidble.sample, attributionTag = null, token = android.os.BinderProxy@5955a3e, next = null }: AdapterService getRemoteName

Related to #798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant