Skip to content
Snippets Groups Projects
Commit bba99947 authored by akwizgran's avatar akwizgran
Browse files

Merge branch '314-tor-sleep' into 'master'

Hold a wake lock while Tor is connected to the internet

This is a partial fix for #314. As noted on that ticket, if a Tor connection is lost for any reason other than the device sleeping, the plugin won't try to replace the lost connection. I'm leaving the ticket open until that more general issue is solved.

The Tor plugin uses several variables to keep track of its connectivity status. This patch refactors those variables into an inner class to improve readability and ensure they're accessed atomically. However, it's still possible for the plugin's state to become inconsistent with the state of the Tor process. For example, calls to updateConnectionStatus() may run concurrently on the IO executor, so their calls to enableNetwork() may be interleaved. As usual, locking would solve this problem but create the potential for deadlock, so I won't try to solve it in this patch.

See merge request !168
parents 189efe8d 400a11e3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment