mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Modified the project structure, removed module extension and went instead for a non-complete core dependency graph
This commit is contained in:
@@ -97,4 +97,7 @@ android {
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
compile 'cglib:cglib-nodep:3.1'
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.android;
|
||||
|
||||
import org.briarproject.CoreComponent;
|
||||
import org.briarproject.CoreEagerSingletons;
|
||||
import org.briarproject.CoreModule;
|
||||
import org.briarproject.android.contact.ContactListFragment;
|
||||
import org.briarproject.android.contact.ConversationActivity;
|
||||
import org.briarproject.android.forum.AvailableForumsActivity;
|
||||
@@ -15,33 +16,59 @@ import org.briarproject.android.identity.CreateIdentityActivity;
|
||||
import org.briarproject.android.invitation.AddContactActivity;
|
||||
import org.briarproject.android.panic.PanicPreferencesActivity;
|
||||
import org.briarproject.android.panic.PanicResponderActivity;
|
||||
import org.briarproject.plugins.AndroidPluginsModule;
|
||||
import org.briarproject.system.AndroidSystemModule;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Component;
|
||||
@ApplicationScope
|
||||
|
||||
@Singleton
|
||||
@Component(
|
||||
dependencies = {CoreComponent.class},
|
||||
modules = {AppModule.class, AndroidModule.class})
|
||||
public interface AndroidComponent {
|
||||
modules = {CoreModule.class, AppModule.class, AndroidModule.class,
|
||||
AndroidPluginsModule.class, AndroidSystemModule.class})
|
||||
public interface AndroidComponent extends CoreEagerSingletons {
|
||||
|
||||
void inject(SplashScreenActivity activity);
|
||||
|
||||
void inject(SetupActivity activity);
|
||||
|
||||
void inject(NavDrawerActivity activity);
|
||||
|
||||
void inject(PasswordActivity activity);
|
||||
|
||||
void inject(BriarService activity);
|
||||
|
||||
void inject(PanicResponderActivity activity);
|
||||
|
||||
void inject(PanicPreferencesActivity activity);
|
||||
|
||||
void inject(AddContactActivity activity);
|
||||
|
||||
void inject(ConversationActivity activity);
|
||||
|
||||
void inject(CreateIdentityActivity activity);
|
||||
|
||||
void inject(TestingActivity activity);
|
||||
|
||||
void inject(AvailableForumsActivity activity);
|
||||
|
||||
void inject(WriteForumPostActivity activity);
|
||||
|
||||
void inject(CreateForumActivity activity);
|
||||
|
||||
void inject(ShareForumActivity activity);
|
||||
|
||||
void inject(ReadForumPostActivity activity);
|
||||
|
||||
void inject(ForumActivity activity);
|
||||
|
||||
void inject(ContactListFragment fragment);
|
||||
|
||||
void inject(SettingsFragment fragment);
|
||||
|
||||
void inject(ForumListFragment fragment);
|
||||
|
||||
// Eager singleton load
|
||||
void inject(AndroidModule.EagerSingletons init);
|
||||
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
package org.briarproject.android;
|
||||
|
||||
import org.briarproject.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.android.api.AndroidNotificationManager;
|
||||
import org.briarproject.android.api.ReferenceManager;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||
import org.briarproject.api.ui.UiCallback;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
@@ -18,14 +27,69 @@ public class AndroidModule {
|
||||
AndroidNotificationManager androidNotificationManager;
|
||||
}
|
||||
|
||||
private final UiCallback uiCallback;
|
||||
|
||||
public AndroidModule() {
|
||||
// Use a dummy UI callback
|
||||
uiCallback = new UiCallback() {
|
||||
|
||||
public int showChoice(String[] options, String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean showConfirmationMessage(String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void showMessage(String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
public UiCallback provideUICallback() {
|
||||
return uiCallback;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public DatabaseConfig provideDatabaseConfig(Application app) {
|
||||
final File dir = app.getApplicationContext().getDir("db", Context.MODE_PRIVATE);
|
||||
return new DatabaseConfig() {
|
||||
|
||||
private volatile SecretKey key = null;
|
||||
|
||||
public boolean databaseExists() {
|
||||
return dir.isDirectory() && dir.listFiles().length > 0;
|
||||
}
|
||||
|
||||
public File getDatabaseDirectory() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public void setEncryptionKey(SecretKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public SecretKey getEncryptionKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public long getMaxSize() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ReferenceManager provideReferenceManager() {
|
||||
return new ReferenceManagerImpl();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@Singleton
|
||||
AndroidNotificationManager provideAndroidNotificationManager(
|
||||
LifecycleManager lifecycleManager, EventBus eventBus,
|
||||
AndroidNotificationManagerImpl notificationManager) {
|
||||
|
||||
@@ -12,8 +12,8 @@ import android.support.v4.app.TaskStackBuilder;
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.contact.ConversationActivity;
|
||||
import org.briarproject.android.forum.ForumActivity;
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.android.api.AndroidNotificationManager;
|
||||
import org.briarproject.api.db.DatabaseExecutor;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.event.Event;
|
||||
@@ -65,7 +65,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
private final SettingsManager settingsManager;
|
||||
private final MessagingManager messagingManager;
|
||||
private final ForumManager forumManager;
|
||||
private final PlatformExecutor platformExecutor;
|
||||
private final AndroidExecutor androidExecutor;
|
||||
private final Context appContext;
|
||||
|
||||
// The following must only be accessed on the main UI thread
|
||||
@@ -82,13 +82,13 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
@Inject
|
||||
public AndroidNotificationManagerImpl(@DatabaseExecutor Executor dbExecutor,
|
||||
SettingsManager settingsManager, MessagingManager messagingManager,
|
||||
ForumManager forumManager, PlatformExecutor platformExecutor,
|
||||
ForumManager forumManager, AndroidExecutor androidExecutor,
|
||||
Application app) {
|
||||
this.dbExecutor = dbExecutor;
|
||||
this.settingsManager = settingsManager;
|
||||
this.messagingManager = messagingManager;
|
||||
this.forumManager = forumManager;
|
||||
this.platformExecutor = platformExecutor;
|
||||
this.androidExecutor = androidExecutor;
|
||||
appContext = app.getApplicationContext();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
private void clearNotifications() {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
clearPrivateMessageNotification();
|
||||
clearForumPostNotification();
|
||||
@@ -155,7 +155,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void showPrivateMessageNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
Integer count = contactCounts.get(g);
|
||||
if (count == null) contactCounts.put(g, 1);
|
||||
@@ -168,7 +168,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void clearPrivateMessageNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
Integer count = contactCounts.remove(g);
|
||||
if (count == null) return; // Already cleared
|
||||
@@ -239,7 +239,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void showForumPostNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
Integer count = forumCounts.get(g);
|
||||
if (count == null) forumCounts.put(g, 1);
|
||||
@@ -252,7 +252,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void clearForumPostNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
Integer count = forumCounts.remove(g);
|
||||
if (count == null) return; // Already cleared
|
||||
@@ -311,7 +311,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void blockNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
visibleGroup = g;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
}
|
||||
|
||||
public void unblockNotification(final GroupId g) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
if (g.equals(visibleGroup)) visibleGroup = null;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package org.briarproject.android;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -15,7 +17,7 @@ public class AppModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@Singleton
|
||||
Application providesApplication() {
|
||||
return application;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package org.briarproject.android;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.inject.Scope;
|
||||
|
||||
@Scope
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ApplicationScope {
|
||||
}
|
||||
@@ -6,12 +6,7 @@ import java.util.logging.Logger;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.CoreComponent;
|
||||
import org.briarproject.CoreEagerSingletons;
|
||||
import org.briarproject.DaggerCoreComponent;
|
||||
import org.briarproject.plugins.PluginsModuleExtension;
|
||||
import org.briarproject.system.PlatformModuleExtension;
|
||||
import org.briarproject.system.SystemModuleExtension;
|
||||
import org.briarproject.CoreModule;
|
||||
|
||||
public class BriarApplication extends Application {
|
||||
|
||||
@@ -30,20 +25,14 @@ public class BriarApplication extends Application {
|
||||
CrashHandler newHandler = new CrashHandler(ctx, oldHandler);
|
||||
Thread.setDefaultUncaughtExceptionHandler(newHandler);
|
||||
|
||||
CoreComponent coreComponent = DaggerCoreComponent.builder()
|
||||
.systemModule(new SystemModuleExtension(this))
|
||||
.platformModule(new PlatformModuleExtension(this))
|
||||
.pluginsModule(new PluginsModuleExtension(this))
|
||||
.build();
|
||||
|
||||
applicationComponent = DaggerAndroidComponent.builder()
|
||||
.appModule(new AppModule(this))
|
||||
.coreComponent(coreComponent)
|
||||
.androidModule(new AndroidModule())
|
||||
.build();
|
||||
|
||||
// We need to load the eager singletons directly after making the
|
||||
// dependency graphs
|
||||
CoreEagerSingletons.initEagerSingletons(coreComponent);
|
||||
CoreModule.initEagerSingletons(applicationComponent);
|
||||
AndroidEagerSingletons.initEagerSingletons(applicationComponent);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import android.os.IBinder;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager.StartResult;
|
||||
@@ -48,7 +48,7 @@ public class BriarService extends Service {
|
||||
|
||||
// Fields that are accessed from background threads must be volatile
|
||||
@Inject protected volatile LifecycleManager lifecycleManager;
|
||||
@Inject protected volatile PlatformExecutor platformExecutor;
|
||||
@Inject protected volatile AndroidExecutor androidExecutor;
|
||||
private volatile boolean started = false;
|
||||
|
||||
@Override
|
||||
@@ -106,7 +106,7 @@ public class BriarService extends Service {
|
||||
}
|
||||
|
||||
private void showStartupFailureNotification(final StartResult result) {
|
||||
platformExecutor.execute(new Runnable() {
|
||||
androidExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
NotificationCompat.Builder b =
|
||||
new NotificationCompat.Builder(BriarService.this);
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.os.Bundle;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.widget.AppCompatButton;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -25,7 +24,7 @@ import org.briarproject.android.forum.ForumListFragment;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
import org.briarproject.android.util.CustomAnimations;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.android.api.ReferenceManager;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.event.Event;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.android.api.ReferenceManager;
|
||||
|
||||
class ReferenceManagerImpl implements ReferenceManager {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import android.widget.TextView.OnEditorActionListener;
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.util.AndroidUtils;
|
||||
import org.briarproject.android.util.StrengthMeter;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.android.api.ReferenceManager;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.CryptoExecutor;
|
||||
import org.briarproject.api.crypto.KeyPair;
|
||||
|
||||
@@ -8,11 +8,11 @@ import android.os.StrictMode;
|
||||
import android.os.StrictMode.ThreadPolicy;
|
||||
import android.os.StrictMode.VmPolicy;
|
||||
import android.support.v7.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.util.AndroidUtils;
|
||||
import org.briarproject.android.util.LayoutUtils;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.util.FileUtils;
|
||||
@@ -91,6 +91,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
startActivity(new Intent(this, NavDrawerActivity.class));
|
||||
} else {
|
||||
clearSharedPrefs();
|
||||
AndroidUtils.deleteAppData(this);
|
||||
FileUtils.deleteFileOrDir(
|
||||
dbConfig.getDatabaseDirectory());
|
||||
startActivity(new Intent(this, SetupActivity.class));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.briarproject.api.android;
|
||||
package org.briarproject.android.api;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -7,7 +7,7 @@ import java.util.concurrent.Future;
|
||||
* Enables background threads to make Android API calls that must be made from
|
||||
* a thread with a message queue.
|
||||
*/
|
||||
public interface PlatformExecutor {
|
||||
public interface AndroidExecutor {
|
||||
|
||||
/**
|
||||
* Runs the given task on the main UI thread and returns a Future for
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.briarproject.api.android;
|
||||
package org.briarproject.android.api;
|
||||
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.briarproject.api.android;
|
||||
package org.briarproject.android.api;
|
||||
|
||||
/**
|
||||
* Manages mappings between object references and serialisable handles. This
|
||||
@@ -21,11 +21,10 @@ import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.android.util.BriarRecyclerView;
|
||||
import org.briarproject.api.FormatException;
|
||||
import org.briarproject.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.android.api.AndroidNotificationManager;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.contact.ContactManager;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.CryptoExecutor;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.db.NoSuchContactException;
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.android.util.ElasticHorizontalSpace;
|
||||
import org.briarproject.android.util.HorizontalBorder;
|
||||
import org.briarproject.android.util.ListLoadingProgressBar;
|
||||
import org.briarproject.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.android.api.AndroidNotificationManager;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.db.NoSuchGroupException;
|
||||
import org.briarproject.api.db.NoSuchMessageException;
|
||||
|
||||
@@ -7,7 +7,7 @@ import android.widget.Toast;
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.android.api.ReferenceManager;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.support.v7.preference.PreferenceManager;
|
||||
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.android.util.AndroidUtils;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.util.FileUtils;
|
||||
import org.iilab.IilabEngineeringRSA2048Pin;
|
||||
@@ -111,9 +112,7 @@ public class PanicResponderActivity extends BriarActivity {
|
||||
public void run() {
|
||||
clearSharedPrefs();
|
||||
// TODO somehow delete/shred the database more thoroughly
|
||||
FileUtils
|
||||
.deleteFileOrDir(
|
||||
databaseConfig.getDatabaseDirectory());
|
||||
AndroidUtils.deleteAppData(PanicResponderActivity.this);
|
||||
PanicResponder.deleteAllAppData(PanicResponderActivity.this);
|
||||
|
||||
// nothing left to do after everything is deleted,
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.plugins.BackoffFactory;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginFactory;
|
||||
import org.briarproject.api.plugins.simplex.SimplexPluginConfig;
|
||||
import org.briarproject.api.plugins.simplex.SimplexPluginFactory;
|
||||
import org.briarproject.api.system.LocationUtils;
|
||||
import org.briarproject.plugins.droidtooth.DroidtoothPluginFactory;
|
||||
import org.briarproject.plugins.tcp.AndroidLanTcpPluginFactory;
|
||||
import org.briarproject.plugins.tor.TorPluginFactory;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module
|
||||
public class AndroidPluginsModule {
|
||||
|
||||
@Provides
|
||||
SimplexPluginConfig provideSimplexPluginConfig() {
|
||||
return new SimplexPluginConfig() {
|
||||
public Collection<SimplexPluginFactory> getFactories() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Provides
|
||||
public DuplexPluginConfig provideDuplexPluginConfig(
|
||||
@IoExecutor Executor ioExecutor, AndroidExecutor androidExecutor,
|
||||
SecureRandom random, BackoffFactory backoffFactory, Application app,
|
||||
LocationUtils locationUtils, EventBus eventBus) {
|
||||
Context appContext = app.getApplicationContext();
|
||||
DuplexPluginFactory bluetooth = new DroidtoothPluginFactory(ioExecutor,
|
||||
androidExecutor, appContext, random, backoffFactory);
|
||||
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, appContext,
|
||||
locationUtils, eventBus);
|
||||
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
|
||||
backoffFactory, appContext);
|
||||
final Collection<DuplexPluginFactory> factories =
|
||||
Arrays.asList(bluetooth, tor, lan);
|
||||
return new DuplexPluginConfig() {
|
||||
public Collection<DuplexPluginFactory> getFactories() {
|
||||
return factories;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +1,33 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.plugins.BackoffFactory;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginFactory;
|
||||
import org.briarproject.api.system.LocationUtils;
|
||||
import org.briarproject.plugins.droidtooth.DroidtoothPluginFactory;
|
||||
import org.briarproject.plugins.tcp.AndroidLanTcpPluginFactory;
|
||||
import org.briarproject.plugins.tor.TorPluginFactory;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class PluginsModuleExtension extends PluginsModule {
|
||||
|
||||
private final Application app;
|
||||
// @Inject @Named("AndroidDuplexPluginConfig")
|
||||
// DuplexPluginConfig duplexPluginConfig;
|
||||
|
||||
public PluginsModuleExtension() {
|
||||
|
||||
public PluginsModuleExtension(Application app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// SimplexPluginConfig provideSimplexPluginConfig() {
|
||||
// return new SimplexPluginConfig() {
|
||||
// public Collection<SimplexPluginFactory> getFactories() {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
/*
|
||||
@Override
|
||||
public DuplexPluginConfig provideDuplexPluginConfig(
|
||||
@IoExecutor Executor ioExecutor, PlatformExecutor platformExecutor,
|
||||
@IoExecutor Executor ioExecutor, AndroidExecutor androidExecutor,
|
||||
SecureRandom random, BackoffFactory backoffFactory,
|
||||
LocationUtils locationUtils, EventBus eventBus) {
|
||||
Context appContext = app.getApplicationContext();
|
||||
DuplexPluginFactory bluetooth = new DroidtoothPluginFactory(ioExecutor,
|
||||
platformExecutor, appContext, random, backoffFactory);
|
||||
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, appContext,
|
||||
locationUtils, eventBus);
|
||||
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
|
||||
backoffFactory, appContext);
|
||||
final Collection<DuplexPluginFactory> factories =
|
||||
Arrays.asList(bluetooth, tor, lan);
|
||||
return new DuplexPluginConfig() {
|
||||
public Collection<DuplexPluginFactory> getFactories() {
|
||||
return factories;
|
||||
}
|
||||
};
|
||||
}
|
||||
// return duplexPluginConfig;
|
||||
// @Inject @Named("AndroidDuplexPluginConfig")
|
||||
// DuplexPluginConfig andoridDuplexPlugin;
|
||||
// return andoridDuplexPlugin;
|
||||
// }
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import android.content.IntentFilter;
|
||||
|
||||
import org.briarproject.android.util.AndroidUtils;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.android.AndroidExecutor;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.PseudoRandom;
|
||||
import org.briarproject.api.plugins.Backoff;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.briarproject.plugins.droidtooth;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.android.AndroidExecutor;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.api.plugins.Backoff;
|
||||
import org.briarproject.api.plugins.BackoffFactory;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPlugin;
|
||||
|
||||
@@ -6,15 +6,13 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
class AndroidExecutorImpl implements PlatformExecutor {
|
||||
class AndroidExecutorImpl implements AndroidExecutor {
|
||||
|
||||
private final Handler handler;
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.briarproject.system;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.api.system.LocationUtils;
|
||||
import org.briarproject.api.system.SeedProvider;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module
|
||||
public class AndroidSystemModule {
|
||||
|
||||
@Provides
|
||||
public SeedProvider provideSeedProvider(Application app) {
|
||||
return new AndroidSeedProvider(app);
|
||||
}
|
||||
|
||||
@Provides
|
||||
public LocationUtils provideLocationUtils(Application app) {
|
||||
return new AndroidLocationUtils(app);
|
||||
}
|
||||
|
||||
@Provides
|
||||
public AndroidExecutor providePlatformExecutor(Application app) {
|
||||
return new AndroidExecutorImpl(app);
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package org.briarproject.system;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import org.briarproject.PlatformModule;
|
||||
import org.briarproject.android.ApplicationScope;
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.ui.UiCallback;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class PlatformModuleExtension extends PlatformModule {
|
||||
|
||||
private final UiCallback uiCallback;
|
||||
private final Application app;
|
||||
|
||||
public PlatformModuleExtension(Application app) {
|
||||
this.app = app;
|
||||
// Use a dummy UI callback
|
||||
uiCallback = new UiCallback() {
|
||||
|
||||
public int showChoice(String[] options, String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean showConfirmationMessage(String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void showMessage(String... message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public UiCallback provideUICallback() {
|
||||
return uiCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ApplicationScope
|
||||
public DatabaseConfig provideDatabaseConfig() {
|
||||
final File dir = app.getApplicationContext().getDir("db", Context.MODE_PRIVATE);
|
||||
return new DatabaseConfig() {
|
||||
|
||||
private volatile SecretKey key = null;
|
||||
|
||||
public boolean databaseExists() {
|
||||
return dir.isDirectory() && dir.listFiles().length > 0;
|
||||
}
|
||||
|
||||
public File getDatabaseDirectory() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public void setEncryptionKey(SecretKey key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public SecretKey getEncryptionKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public long getMaxSize() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformExecutor providePlatformExecutor() {
|
||||
return new AndroidExecutorImpl(app);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package org.briarproject.system;
|
||||
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import org.briarproject.api.system.Clock;
|
||||
import org.briarproject.api.system.LocationUtils;
|
||||
import org.briarproject.api.system.SeedProvider;
|
||||
import org.briarproject.api.system.Timer;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
public class SystemModuleExtension extends SystemModule {
|
||||
|
||||
private final Application app;
|
||||
|
||||
public SystemModuleExtension(final Application app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeedProvider provideSeedProvider() {
|
||||
return new AndroidSeedProvider(app);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocationUtils provideLocationUtils() {
|
||||
return new AndroidLocationUtils(app);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.api.contact.ContactManager;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.CryptoExecutor;
|
||||
import org.briarproject.api.crypto.PasswordStrengthEstimator;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.db.DatabaseExecutor;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.forum.ForumManager;
|
||||
import org.briarproject.api.forum.ForumPostFactory;
|
||||
import org.briarproject.api.forum.ForumSharingManager;
|
||||
import org.briarproject.api.identity.AuthorFactory;
|
||||
import org.briarproject.api.identity.IdentityManager;
|
||||
import org.briarproject.api.invitation.InvitationTaskFactory;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||
import org.briarproject.api.messaging.MessagingManager;
|
||||
import org.briarproject.api.messaging.PrivateMessageFactory;
|
||||
import org.briarproject.api.plugins.ConnectionRegistry;
|
||||
import org.briarproject.api.plugins.PluginManager;
|
||||
import org.briarproject.api.properties.TransportPropertyManager;
|
||||
import org.briarproject.api.settings.SettingsManager;
|
||||
import org.briarproject.api.sync.ValidationManager;
|
||||
import org.briarproject.api.transport.KeyManager;
|
||||
import org.briarproject.clients.ClientsModule;
|
||||
import org.briarproject.contact.ContactModule;
|
||||
import org.briarproject.crypto.CryptoModule;
|
||||
import org.briarproject.data.DataModule;
|
||||
import org.briarproject.db.DatabaseModule;
|
||||
import org.briarproject.event.EventModule;
|
||||
import org.briarproject.forum.ForumModule;
|
||||
import org.briarproject.identity.IdentityModule;
|
||||
import org.briarproject.invitation.InvitationModule;
|
||||
import org.briarproject.lifecycle.LifecycleModule;
|
||||
import org.briarproject.messaging.MessagingModule;
|
||||
import org.briarproject.messaging.PrivateMessageValidator;
|
||||
import org.briarproject.plugins.PluginsModule;
|
||||
import org.briarproject.properties.PropertiesModule;
|
||||
import org.briarproject.properties.TransportPropertyValidator;
|
||||
import org.briarproject.reliability.ReliabilityModule;
|
||||
import org.briarproject.settings.SettingsModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
@Singleton
|
||||
@Component(modules = {DatabaseModule.class,
|
||||
CryptoModule.class, LifecycleModule.class, PlatformModule.class,
|
||||
ReliabilityModule.class, MessagingModule.class,
|
||||
InvitationModule.class, ForumModule.class, IdentityModule.class,
|
||||
EventModule.class, DataModule.class, ContactModule.class,
|
||||
PropertiesModule.class, TransportModule.class, SyncModule.class,
|
||||
SettingsModule.class, ClientsModule.class, SystemModule.class,
|
||||
PluginsModule.class})
|
||||
public interface CoreComponent {
|
||||
@IoExecutor
|
||||
Executor ioExecutor();
|
||||
ContactManager contactManager();
|
||||
@CryptoExecutor Executor cryptoExecutor();
|
||||
DatabaseConfig databaseConfig();
|
||||
PasswordStrengthEstimator passwordStrengthEstimator();
|
||||
CryptoComponent cryptoComponent();
|
||||
@DatabaseExecutor Executor dbExecutor();
|
||||
LifecycleManager lifecycleManager();
|
||||
AuthorFactory authFactory();
|
||||
EventBus eventBus();
|
||||
KeyManager keyManager();
|
||||
ValidationManager validationManager();
|
||||
ForumManager forumManager();
|
||||
IdentityManager identityManager();
|
||||
PluginManager pluginManager();
|
||||
SettingsManager settingsManater();
|
||||
InvitationTaskFactory invitationTaskFactory();
|
||||
MessagingManager messagingManager();
|
||||
TransportPropertyManager transportPropertyManager();
|
||||
ConnectionRegistry connectionRegistry();
|
||||
ForumSharingManager forumSharingManager();
|
||||
PrivateMessageFactory privateMessageFactory();
|
||||
ForumPostFactory forumPostFactory();
|
||||
PrivateMessageValidator privateMessageValidator();
|
||||
TransportPropertyValidator transportPropertyValidator();
|
||||
PlatformExecutor platformExecutor();
|
||||
// Eager singletons
|
||||
void inject(ContactModule.EagerSingletons init);
|
||||
void inject(CryptoModule.EagerSingletons init);
|
||||
void inject(DatabaseModule.EagerSingletons init);
|
||||
void inject(ForumModule.EagerSingletons init);
|
||||
void inject(LifecycleModule.EagerSingletons init);
|
||||
void inject(MessagingModule.EagerSingletons init);
|
||||
void inject(PluginsModule.EagerSingletons init);
|
||||
void inject(PropertiesModule.EagerSingletons init);
|
||||
void inject(SyncModule.EagerSingletons init);
|
||||
void inject(TransportModule.EagerSingletons init);
|
||||
}
|
||||
@@ -11,18 +11,16 @@ import org.briarproject.properties.PropertiesModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
|
||||
public class CoreEagerSingletons {
|
||||
public interface CoreEagerSingletons {
|
||||
void inject(ContactModule.EagerSingletons init);
|
||||
void inject(CryptoModule.EagerSingletons init);
|
||||
void inject(DatabaseModule.EagerSingletons init);
|
||||
void inject(ForumModule.EagerSingletons init);
|
||||
void inject(LifecycleModule.EagerSingletons init);
|
||||
void inject(MessagingModule.EagerSingletons init);
|
||||
void inject(PluginsModule.EagerSingletons init);
|
||||
void inject(PropertiesModule.EagerSingletons init);
|
||||
void inject(SyncModule.EagerSingletons init);
|
||||
void inject(TransportModule.EagerSingletons init);
|
||||
|
||||
public static void initEagerSingletons(CoreComponent c) {
|
||||
c.inject(new ContactModule.EagerSingletons());
|
||||
c.inject(new CryptoModule.EagerSingletons());
|
||||
c.inject(new DatabaseModule.EagerSingletons());
|
||||
c.inject(new ForumModule.EagerSingletons());
|
||||
c.inject(new LifecycleModule.EagerSingletons());
|
||||
c.inject(new MessagingModule.EagerSingletons());
|
||||
c.inject(new PluginsModule.EagerSingletons());
|
||||
c.inject(new PropertiesModule.EagerSingletons());
|
||||
c.inject(new SyncModule.EagerSingletons());
|
||||
c.inject(new TransportModule.EagerSingletons());
|
||||
}
|
||||
}
|
||||
|
||||
45
briar-core/src/org/briarproject/CoreModule.java
Normal file
45
briar-core/src/org/briarproject/CoreModule.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.clients.ClientsModule;
|
||||
import org.briarproject.contact.ContactModule;
|
||||
import org.briarproject.crypto.CryptoModule;
|
||||
import org.briarproject.data.DataModule;
|
||||
import org.briarproject.db.DatabaseModule;
|
||||
import org.briarproject.event.EventModule;
|
||||
import org.briarproject.forum.ForumModule;
|
||||
import org.briarproject.identity.IdentityModule;
|
||||
import org.briarproject.invitation.InvitationModule;
|
||||
import org.briarproject.lifecycle.LifecycleModule;
|
||||
import org.briarproject.messaging.MessagingModule;
|
||||
import org.briarproject.plugins.PluginsModule;
|
||||
import org.briarproject.properties.PropertiesModule;
|
||||
import org.briarproject.reliability.ReliabilityModule;
|
||||
import org.briarproject.settings.SettingsModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(includes = {DatabaseModule.class,
|
||||
CryptoModule.class, LifecycleModule.class, ReliabilityModule.class,
|
||||
MessagingModule.class, InvitationModule.class, ForumModule.class,
|
||||
IdentityModule.class, EventModule.class, DataModule.class,
|
||||
ContactModule.class, PropertiesModule.class, TransportModule.class,
|
||||
SyncModule.class, SettingsModule.class, ClientsModule.class,
|
||||
SystemModule.class, PluginsModule.class})
|
||||
public class CoreModule {
|
||||
|
||||
public static void initEagerSingletons(CoreEagerSingletons c) {
|
||||
c.inject(new ContactModule.EagerSingletons());
|
||||
c.inject(new CryptoModule.EagerSingletons());
|
||||
c.inject(new DatabaseModule.EagerSingletons());
|
||||
c.inject(new ForumModule.EagerSingletons());
|
||||
c.inject(new LifecycleModule.EagerSingletons());
|
||||
c.inject(new MessagingModule.EagerSingletons());
|
||||
c.inject(new PluginsModule.EagerSingletons());
|
||||
c.inject(new PropertiesModule.EagerSingletons());
|
||||
c.inject(new SyncModule.EagerSingletons());
|
||||
c.inject(new TransportModule.EagerSingletons());
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.ui.UiCallback;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
/**
|
||||
* This class contains methods that MUST(!) be overridden in platform specific
|
||||
* modules that use the core.
|
||||
*/
|
||||
@Module
|
||||
public class PlatformModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public DatabaseConfig provideDatabaseConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Provides
|
||||
public UiCallback provideUICallback() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
public PlatformExecutor providePlatformExecutor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package org.briarproject.plugins;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.briarproject.api.android.PlatformExecutor;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||
@@ -11,19 +10,13 @@ import org.briarproject.api.plugins.BackoffFactory;
|
||||
import org.briarproject.api.plugins.ConnectionManager;
|
||||
import org.briarproject.api.plugins.ConnectionRegistry;
|
||||
import org.briarproject.api.plugins.PluginManager;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||
import org.briarproject.api.plugins.simplex.SimplexPluginConfig;
|
||||
import org.briarproject.api.plugins.simplex.SimplexPluginFactory;
|
||||
import org.briarproject.api.sync.SyncSessionFactory;
|
||||
import org.briarproject.api.system.LocationUtils;
|
||||
import org.briarproject.api.system.Timer;
|
||||
import org.briarproject.api.transport.KeyManager;
|
||||
import org.briarproject.api.transport.StreamReaderFactory;
|
||||
import org.briarproject.api.transport.StreamWriterFactory;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import dagger.Module;
|
||||
@@ -68,6 +61,7 @@ public class PluginsModule {
|
||||
return new ConnectionRegistryImpl(eventBus);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PluginManager getPluginManager(LifecycleManager lifecycleManager,
|
||||
@@ -75,21 +69,15 @@ public class PluginsModule {
|
||||
lifecycleManager.register(pluginManager);
|
||||
return pluginManager;
|
||||
}
|
||||
|
||||
/*
|
||||
@Provides
|
||||
SimplexPluginConfig provideSimplexPluginConfig() {
|
||||
return new SimplexPluginConfig() {
|
||||
public Collection<SimplexPluginFactory> getFactories() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
};
|
||||
return null;
|
||||
}
|
||||
|
||||
@Provides
|
||||
public DuplexPluginConfig provideDuplexPluginConfig(@IoExecutor Executor ioExecutor,
|
||||
PlatformExecutor platformExecutor, /*Application app,*/
|
||||
SecureRandom random, BackoffFactory backoffFactory,
|
||||
LocationUtils locationUtils, EventBus eventBus) {
|
||||
public DuplexPluginConfig provideDuplexPluginConfig() {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -20,13 +20,4 @@ public class SystemModule {
|
||||
return new SystemTimer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
public SeedProvider provideSeedProvider() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Provides
|
||||
public LocationUtils provideLocationUtils() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user