mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
If the schema of the database is incompatible with the schema expected by the code, the database throws a DbSchemaException. LifecycleManager indicates the error to BriarService, which uses HomeScreenActivity to show a notification and quit the app.
42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package org.briarproject;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
|
import org.briarproject.api.lifecycle.Service;
|
|
import org.briarproject.api.lifecycle.ShutdownManager;
|
|
|
|
import com.google.inject.AbstractModule;
|
|
|
|
public class TestLifecycleModule extends AbstractModule {
|
|
|
|
protected void configure() {
|
|
bind(LifecycleManager.class).toInstance(new LifecycleManager() {
|
|
|
|
public void register(Service s) {}
|
|
|
|
public void registerForShutdown(ExecutorService e) {}
|
|
|
|
public boolean startServices() { return true; }
|
|
|
|
public void stopServices() {}
|
|
|
|
public void waitForDatabase() throws InterruptedException {}
|
|
|
|
public void waitForStartup() throws InterruptedException {}
|
|
|
|
public void waitForShutdown() throws InterruptedException {}
|
|
});
|
|
bind(ShutdownManager.class).toInstance(new ShutdownManager() {
|
|
|
|
public int addShutdownHook(Runnable hook) {
|
|
return 0;
|
|
}
|
|
|
|
public boolean removeShutdownHook(int handle) {
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
}
|