mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
Add RedeemReceiptRequest object and DonationService.
This commit is contained in:
committed by
Greyson Parrelli
parent
891dfc1b68
commit
7f3ba1978d
@@ -48,6 +48,7 @@ import org.whispersystems.signalservice.api.SignalServiceMessageReceiver;
|
||||
import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
||||
import org.whispersystems.signalservice.api.SignalWebSocket;
|
||||
import org.whispersystems.signalservice.api.groupsv2.GroupsV2Operations;
|
||||
import org.whispersystems.signalservice.api.services.DonationsService;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
@@ -104,6 +105,7 @@ public class ApplicationDependencies {
|
||||
private static volatile GiphyMp4Cache giphyMp4Cache;
|
||||
private static volatile SimpleExoPlayerPool exoPlayerPool;
|
||||
private static volatile AudioManagerCompat audioManagerCompat;
|
||||
private static volatile DonationsService donationsService;
|
||||
|
||||
@MainThread
|
||||
public static void init(@NonNull Application application, @NonNull Provider provider) {
|
||||
@@ -590,6 +592,17 @@ public class ApplicationDependencies {
|
||||
return audioManagerCompat;
|
||||
}
|
||||
|
||||
public static @NonNull DonationsService getDonationsService() {
|
||||
if (donationsService == null) {
|
||||
synchronized (LOCK) {
|
||||
if (donationsService == null) {
|
||||
donationsService = provider.provideDonationsService();
|
||||
}
|
||||
}
|
||||
}
|
||||
return donationsService;
|
||||
}
|
||||
|
||||
public interface Provider {
|
||||
@NonNull GroupsV2Operations provideGroupsV2Operations();
|
||||
@NonNull SignalServiceAccountManager provideSignalServiceAccountManager();
|
||||
@@ -625,5 +638,6 @@ public class ApplicationDependencies {
|
||||
@NonNull GiphyMp4Cache provideGiphyMp4Cache();
|
||||
@NonNull SimpleExoPlayerPool provideExoPlayerPool();
|
||||
@NonNull AudioManagerCompat provideAndroidCallAudioManager();
|
||||
@NonNull DonationsService provideDonationsService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
||||
import org.whispersystems.signalservice.api.SignalWebSocket;
|
||||
import org.whispersystems.signalservice.api.groupsv2.ClientZkOperations;
|
||||
import org.whispersystems.signalservice.api.groupsv2.GroupsV2Operations;
|
||||
import org.whispersystems.signalservice.api.services.DonationsService;
|
||||
import org.whispersystems.signalservice.api.util.CredentialsProvider;
|
||||
import org.whispersystems.signalservice.api.util.SleepTimer;
|
||||
import org.whispersystems.signalservice.api.util.UptimeSleepTimer;
|
||||
@@ -301,6 +302,15 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
|
||||
return AudioManagerCompat.create(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull DonationsService provideDonationsService() {
|
||||
return new DonationsService(provideSignalServiceNetworkAccess().getConfiguration(context),
|
||||
new DynamicCredentialsProvider(context),
|
||||
BuildConfig.SIGNAL_AGENT,
|
||||
provideGroupsV2Operations(),
|
||||
FeatureFlags.okHttpAutomaticRetry());
|
||||
}
|
||||
|
||||
private @NonNull WebSocketFactory provideWebSocketFactory(@NonNull SignalWebSocketHealthMonitor healthMonitor) {
|
||||
return new WebSocketFactory() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user