Skip to content
Snippets Groups Projects
Unverified Commit 25324697 authored by Ernir Erlingsson's avatar Ernir Erlingsson
Browse files

cleanup and added missing desktop modules

parent 1be400eb
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,6 @@ import javax.inject.Singleton;
import dagger.Component;
/**
* Created by Ernir Erlingsson (ernir@ymirmobile.com) on 3.3.2016.
*/
@Singleton
@Component(modules = {TestDatabaseModule.class, TestSystemModule.class,
LifecycleModule.class, ContactModule.class, CryptoModule.class,
......
package org.briarproject.android;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
......@@ -16,7 +14,6 @@ import android.widget.LinearLayout;
import org.briarproject.R;
import org.briarproject.android.util.LayoutUtils;
import org.briarproject.api.db.DatabaseConfig;
import org.briarproject.api.ui.UiCallback;
import org.briarproject.util.FileUtils;
import java.util.logging.Logger;
......
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();
}
}
*/
}
......@@ -5,15 +5,27 @@ import org.briarproject.api.system.SeedProvider;
import org.briarproject.api.system.Timer;
import org.briarproject.util.OsUtils;
import dagger.Module;
import dagger.Provides;
@Module
public class DesktopSystemModule {
/*
// TODO
protected void configure() {
bind(Clock.class).to(SystemClock.class);
bind(Timer.class).to(SystemTimer.class);
if (OsUtils.isLinux())
bind(SeedProvider.class).to(LinuxSeedProvider.class);
@Provides
Clock provideClock() {
return new SystemClock();
}
@Provides
Timer provideTimer() {
return new SystemTimer();
}
@Provides
SeedProvider provideSeedProvider() {
if (OsUtils.isLinux()) {
return new LinuxSeedProvider();
}
return null;
}
*/
}
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