Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 24f45364 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

gatt: Fix incorrect write to the descriptor.

This patch fixes regression after
https://android-review.googlesource.com/q/topic:gatt-racecondition-fix

In case of GATT Write error to descriptor or characteristic,
the value which was tried to be written is zeroed in the
onWriteDescriptor/Characteristic callback.
This cause an issue in following use case:

1) Application writes descriptor on unencrypted link to characteristic
which requires authentication
2) Remote device response with an error insufficient authenthication
3) Android repeats write descriptor with new authenthication
requrements with the descriptor value taken from the onWriteDescriptor
callbac - the one which was zeroed. This result in try to write
invalid value to the descriptor

This patch make sure that value in the callback is always the one which
was tried to write, no matter of status.

Bug: 235756799
Test: atest BluetoothInstrumentationTests
Tag: #stability
Change-Id: Icd18b95a3c44c082117d035cdf25961938de829d
parent e3b3b845
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment