AsteroidOS / AsteroidOSSync

Android application to synchronize a phone with a watch running asteroid-btsyncd.
GNU General Public License v3.0
101 stars 37 forks source link

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

Closed perillamint closed 1 year ago

perillamint commented 1 year ago

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

perillamint commented 1 year ago

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

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

perillamint commented 1 year ago

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

eLtMosen commented 1 year ago

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.

sevmonster commented 1 year ago

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