cleanup and added missing desktop modules

This commit is contained in:
Ernir Erlingsson
2016-03-03 10:49:57 +01:00
parent 1be400eb84
commit 25324697ac
4 changed files with 43 additions and 26 deletions

View File

@@ -1,25 +1,36 @@
package org.briarproject.lifecycle;
import org.briarproject.api.db.DatabaseComponent;
import org.briarproject.api.event.EventBus;
import org.briarproject.api.lifecycle.LifecycleManager;
import org.briarproject.api.lifecycle.ShutdownManager;
import org.briarproject.api.system.Clock;
import org.briarproject.util.OsUtils;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class DesktopLifecycleModule extends LifecycleModule {
/*
// TODO
@Override
protected void configure() {
bind(LifecycleManager.class).to(
LifecycleManagerImpl.class).in(Singleton.class);
@Provides
@Singleton
LifecycleManager provideLifecycleManager(Clock clock, DatabaseComponent db,
EventBus eventBus) {
return new LifecycleManagerImpl(clock, db, eventBus);
}
@Provides
@Singleton
ShutdownManager provideDesktopShutdownManager() {
if (OsUtils.isWindows()) {
bind(ShutdownManager.class).to(
WindowsShutdownManagerImpl.class).in(Singleton.class);
} else {
bind(ShutdownManager.class).to(
ShutdownManagerImpl.class).in(Singleton.class);
return new WindowsShutdownManagerImpl();
}
else {
return new ShutdownManagerImpl();
}
}
*/
}