Apologies for dredging up an old thread, but it is a bit of a continuation of this thread.
Occasionally we are seeing :
Setting descriptor. Success = true
writing descriptor: false
There are 3 notifications total in our app and enabling notifications goes something like this (rough log output):
<300ms delay>
setting notification listener 1
Setting descriptor. Success = true
writing descriptor: true
<300ms delay>
setting notification listener 2
Setting descriptor. Success = true
writing descriptor: false
<300ms delay>
setting notification listener 3
Setting descriptor. Success = true
writing descriptor: false
<300ms delay>
Observations:
- It seems that the descriptor set/write response is happening rather quickly after setNotify and there is plenty of delay until the next setNotify.
- Typically, if I try again, it works (writing descriptor: true).
- Every time I've seen this problem, it fails on the 2nd notification and subsequently the third.
- Changing the order of the notifications doesn't make any difference.
- I've only been able to reproduce this on a Galaxy S7 with Android 6. I've never been able to reproduce it on Galaxy S7 running Android 8.
Is there anything we can try to prevent this from happening? Or rather, I read somewhere that I can read the descriptor using javaObject? How would I go about that?
Do you think it would help if I read the descriptor and tried again upon failure?
Thanks in advance!
Terry