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

Properly split GATT write to fit in Android 13 BLE stack limit #195

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

perillamint
Copy link
Contributor

Android 13 switched Bluetooth stack to Gabledorsche. The stack is known to crash when trying to send large payload.

related SO article: https://stackoverflow.com/questions/73772158/bluetoothgattcharacteristic-write-crashes-with-android-13

This fixes issue #192

Android 13 switched Bluetooth stack to Gabledorsche. The stack is known to
crash when trying to send large payload.

related SO article: https://stackoverflow.com/questions/73772158/bluetoothgattcharacteristic-write-crashes-with-android-13
@perillamint
Copy link
Contributor Author

Adding some note here: This is a known bug in new Android Bluetooth stack.

See: https://issuetracker.google.com/issues/247860924

@perillamint
Copy link
Contributor Author

perillamint commented Mar 27, 2023

Note that this patch is tested on Android 13 (CalyxOS on Pixel 6), but not on 12 and lower.

@eLtMosen
Copy link
Member

First of all, thank you very much for looking into this issue. Very much appreciated!

Note that this patch is tested on Android 13 (CalyxOS on Pixel 6), but not on 12 and lower.

While i am not competent to review the code (and compile with your changes), i could test for regressions on Lineage 20 and several older Android versions if you could post an APK.

Copy link
Member

@MagneFire MagneFire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for figuring this out!

Also tested on an Android 12 device since your source specifically only enables this split() on Android 13+ devices.

@MagneFire MagneFire merged commit 6eaf374 into AsteroidOS:master Mar 27, 2023
@sevmonster
Copy link

Tested on GrapheneOS and fixes the issue, thank you :)

@perillamint perillamint deleted the fix/192-split-gattwrite branch March 29, 2023 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants