Skip to content
Snippets Groups Projects
Commit 0585f943 authored by Matthew Finkel's avatar Matthew Finkel
Browse files

fixup! Bug 40028: Implement Tor Service controller

Correct indentation and add restartTor() function
parent 0518acac
Branches
No related tags found
1 merge request!26Bug 40041 09
......@@ -256,6 +256,25 @@ class TorController(
onTorStopped()
}
fun restartTor() {
// tor-android-service doesn't dynamically update the torrc file,
// and it doesn't use SETCONF, so we completely restart the service.
// However, don't restart if we aren't started and we weren't
// previously started.
if (!lastKnownStatus.isStarted() && !wasTorBootstrapped) {
return
}
isTorRestarting = true
if (!lastKnownStatus.isStarted() && wasTorBootstrapped) {
// If we aren't started, but we were previously bootstrapped,
// then we handle a "restart" request as a "start" restart
initiateTorBootstrap()
} else {
stopTor()
}
}
private fun sendServiceAction(action: String) {
val torServiceStatus = Intent(context, TorService::class.java)
torServiceStatus.action = action
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment