mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Deduplicate contact exchange protocol
ContactExchangeTask was originally extracted from the Bluetooth invitation task; this completes the refactoring.
This commit is contained in:
@@ -39,6 +39,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.api.TransportId.MAX_TRANSPORT_ID_LENGTH;
|
||||
@@ -73,6 +75,7 @@ public class ContactExchangeTaskImpl extends Thread
|
||||
private volatile SecretKey masterSecret;
|
||||
private volatile boolean alice;
|
||||
|
||||
@Inject
|
||||
public ContactExchangeTaskImpl(DatabaseComponent db,
|
||||
AuthorFactory authorFactory, BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory, Clock clock,
|
||||
|
||||
@@ -24,7 +24,8 @@ import dagger.Provides;
|
||||
public class ContactModule {
|
||||
|
||||
public static class EagerSingletons {
|
||||
@Inject ContactManager contactManager;
|
||||
@Inject
|
||||
ContactManager contactManager;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -36,16 +37,8 @@ public class ContactModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
ContactExchangeTask provideContactExchangeTask(DatabaseComponent db,
|
||||
AuthorFactory authorFactory, BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory, Clock clock,
|
||||
ConnectionManager connectionManager, ContactManager contactManager,
|
||||
TransportPropertyManager transportPropertyManager,
|
||||
CryptoComponent crypto, StreamReaderFactory streamReaderFactory,
|
||||
StreamWriterFactory streamWriterFactory) {
|
||||
return new ContactExchangeTaskImpl(db, authorFactory, bdfReaderFactory,
|
||||
bdfWriterFactory, clock, connectionManager, contactManager,
|
||||
transportPropertyManager, crypto, streamReaderFactory,
|
||||
streamWriterFactory);
|
||||
ContactExchangeTask provideContactExchangeTask(
|
||||
ContactExchangeTaskImpl contactExchangeTask) {
|
||||
return contactExchangeTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user