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

Skip to content
Commit b64432cf authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Jack He
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
Merged-In: Icd18b95a3c44c082117d035cdf25961938de829d
Change-Id: Icd18b95a3c44c082117d035cdf25961938de829d
(cherry picked from commit 24f45364)
parent 9b9c2bcc
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