2014-11-11 19:57:53 -08:00
|
|
|
package org.thoughtcrime.securesms.dependencies;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
2016-03-23 10:34:41 -07:00
|
|
|
import org.thoughtcrime.securesms.crypto.storage.SignalProtocolStoreImpl;
|
2014-11-11 19:57:53 -08:00
|
|
|
import org.thoughtcrime.securesms.jobs.CleanPreKeysJob;
|
2016-03-23 10:34:41 -07:00
|
|
|
import org.whispersystems.libsignal.state.SignedPreKeyStore;
|
2014-11-11 19:57:53 -08:00
|
|
|
|
|
|
|
import dagger.Module;
|
|
|
|
import dagger.Provides;
|
|
|
|
|
|
|
|
@Module (complete = false, injects = {CleanPreKeysJob.class})
|
|
|
|
public class AxolotlStorageModule {
|
|
|
|
|
|
|
|
private final Context context;
|
|
|
|
|
|
|
|
public AxolotlStorageModule(Context context) {
|
|
|
|
this.context = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Provides SignedPreKeyStoreFactory provideSignedPreKeyStoreFactory() {
|
|
|
|
return new SignedPreKeyStoreFactory() {
|
|
|
|
@Override
|
2015-07-06 17:36:49 -07:00
|
|
|
public SignedPreKeyStore create() {
|
2016-03-23 10:34:41 -07:00
|
|
|
return new SignalProtocolStoreImpl(context);
|
2014-11-11 19:57:53 -08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public static interface SignedPreKeyStoreFactory {
|
2015-07-06 17:36:49 -07:00
|
|
|
public SignedPreKeyStore create();
|
2014-11-11 19:57:53 -08:00
|
|
|
}
|
|
|
|
}
|