Don't reuse the same ConnectionChooser every time.

This is a fix for a backporting mistake.
This commit is contained in:
akwizgran
2018-03-07 16:47:08 +00:00
parent b0aa1517e5
commit 84e040605b

View File

@@ -10,6 +10,7 @@ import org.briarproject.bramble.api.plugin.PluginManager;
import javax.annotation.concurrent.Immutable;
import javax.inject.Inject;
import javax.inject.Provider;
@Immutable
@NotNullByDefault
@@ -19,22 +20,22 @@ class KeyAgreementTaskFactoryImpl implements KeyAgreementTaskFactory {
private final EventBus eventBus;
private final PayloadEncoder payloadEncoder;
private final PluginManager pluginManager;
private final ConnectionChooser connectionChooser;
private final Provider<ConnectionChooser> connectionChooserProvider;
@Inject
KeyAgreementTaskFactoryImpl(CryptoComponent crypto, EventBus eventBus,
PayloadEncoder payloadEncoder, PluginManager pluginManager,
ConnectionChooser connectionChooser) {
Provider<ConnectionChooser> connectionChooserProvider) {
this.crypto = crypto;
this.eventBus = eventBus;
this.payloadEncoder = payloadEncoder;
this.pluginManager = pluginManager;
this.connectionChooser = connectionChooser;
this.connectionChooserProvider = connectionChooserProvider;
}
@Override
public KeyAgreementTask createTask() {
return new KeyAgreementTaskImpl(crypto, eventBus, payloadEncoder,
pluginManager, connectionChooser);
pluginManager, connectionChooserProvider.get());
}
}