Move wake lock code to dont-kill-me-lib.

This commit is contained in:
akwizgran
2023-03-27 13:56:53 +01:00
parent 01b1741e83
commit 49f10e7e82
28 changed files with 99 additions and 438 deletions

View File

@@ -8,9 +8,27 @@ import org.briarproject.nullsafety.NotNullByDefault;
import java.io.File;
import java.util.concurrent.Executor;
/**
* A Tor wrapper for Unix-like operating systems.
*/
@NotNullByDefault
public class UnixTorWrapper extends JavaTorWrapper {
/**
* @param ioExecutor The wrapper will use this executor to run IO tasks,
* some of which may run for the lifetime of the wrapper, so the executor
* should have an unlimited thread pool.
* @param eventExecutor The wrapper will use this executor to call
* {@link StateObserver#observeState(TorState)}. To ensure that state
* changes are observed in the order they occur, this executor should have
* a single thread (eg the app's main thread).
* @param architecture The processor architecture of the Tor and pluggable
* transport binaries.
* @param torDirectory The directory where the Tor process should keep its
* state.
* @param torSocksPort The port number to use for Tor's SOCKS port.
* @param torControlPort The port number to use for Tor's control port.
*/
public UnixTorWrapper(Executor ioExecutor,
Executor eventExecutor,
String architecture,

View File

@@ -13,9 +13,27 @@ import java.util.concurrent.Executor;
import static java.util.logging.Level.INFO;
/**
* A Tor wrapper for the Windows operating system.
*/
@NotNullByDefault
public class WindowsTorWrapper extends JavaTorWrapper {
/**
* @param ioExecutor The wrapper will use this executor to run IO tasks,
* some of which may run for the lifetime of the wrapper, so the executor
* should have an unlimited thread pool.
* @param eventExecutor The wrapper will use this executor to call
* {@link StateObserver#observeState(TorState)}. To ensure that state
* changes are observed in the order they occur, this executor should have
* a single thread (eg the app's main thread).
* @param architecture The processor architecture of the Tor and pluggable
* transport binaries.
* @param torDirectory The directory where the Tor process should keep its
* state.
* @param torSocksPort The port number to use for Tor's SOCKS port.
* @param torControlPort The port number to use for Tor's control port.
*/
public WindowsTorWrapper(Executor ioExecutor,
Executor eventExecutor,
String architecture,