Comment 8 for bug 1248720

Revision history for this message
Yu Ning (yuningdodo) wrote :

The issue can also be reproduced on my 14.04, by adding some prints in the source code I found it's cause by a logic trap:

1. we click the switch in the u-c-c bt panel to turn on the bt
2. in the widget's "notify::active" callback it set the BT state to unblocked
3. the BT "state-changed" callback is triggered with {state: unblocked, powered: off}, in this callback it will update the UI
4. in such a case step 2 is triggered again but this time it set the BT state to blocked.

So after a long repetition the final status is BT is turned off again. Actually I'm wondering if it will run into an endless dead loop under special condition.

Anyway in my side I could fix, or maybe only workaround, the issue with the attached patch, it will temporarily block the widget's "notify::active" callback in the bt killswitch callbacks, so we won't run into step 2 after step 3.