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

In the case of unsuccessful Bluetooth connection, actively disconnect without executing context. unregisterReceiver (receiver); At this point, there may be multiple Bluetooth broadcast registrarReceivers, which may crash on some Huawei phones due to a broadcast limit of approximately 1000. Suggest fixing this issue. #851

Open
stylsw opened this issue Mar 20, 2024 · 2 comments
Labels
awaiting feedback bug Bug that is caused by the library

Comments

@stylsw
Copy link

stylsw commented Mar 20, 2024

After calling establishConnection, it was found that the context. registerReceiver (receiver, new IntentFilter (BluetoothAdapter. ACTION_STATE.CHANGED) in RxBleAdapterState Observable) would be triggered;

In the case of a successful Bluetooth connection, actively disconnecting through dispose will execute context. unregisterReceiver (receiver);

If the Bluetooth connection is not successful at this time, actively disconnect through dispose without executing context. unregisterReceiver (receiver); At this point, there may be multiple Bluetooth broadcast registrarReceivers, which may crash on some Huawei phones due to a broadcast limit of approximately 1000. Suggest fixing this issue

@stylsw stylsw added the bug Bug that is caused by the library label Mar 20, 2024
@dariuszseweryn
Copy link
Owner

Hello,
Thanks for using the library and for the report. Could you provide a step by step reproduction scenario and some logs that support the case so I could act? A memory dump showing leaks could also be useful. Thanks!

@stylsw
Copy link
Author

stylsw commented Mar 22, 2024

Hello, you can use a fake device to execute the establishConnection method, then perform a dispose operation before the connection is unsuccessful, and log before the unregisterReceiver of RxBleAdapterState Observable. You will find that the unregisterReceiver execution has not been triggered. This is a must see scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

2 participants