From 7a7dc108cf61f78c4b270a207ef360be692b531c Mon Sep 17 00:00:00 2001 From: Dimitris Papavasiliou Date: Tue, 10 Apr 2018 12:22:25 +0300 Subject: [PATCH] Specify sleep timing method for the websocket Specify sleep timing method for the websocket's keep-alive sender, based on whether GCM is disabled. Fixes #6644 // FREEBIE --- .../securesms/dependencies/SignalCommunicationModule.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java index 208e3724901..31064680dfa 100644 --- a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java +++ b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java @@ -45,6 +45,8 @@ import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; import org.whispersystems.signalservice.api.SignalServiceMessageSender; import org.whispersystems.signalservice.api.util.CredentialsProvider; +import org.whispersystems.signalservice.api.util.UptimeSleepTimer; +import org.whispersystems.signalservice.api.util.RealtimeSleepTimer; import org.whispersystems.signalservice.api.websocket.ConnectivityListener; import dagger.Module; @@ -128,7 +130,10 @@ synchronized SignalServiceMessageReceiver provideSignalMessageReceiver() { this.messageReceiver = new SignalServiceMessageReceiver(networkAccess.getConfiguration(context), new DynamicCredentialsProvider(context), BuildConfig.USER_AGENT, - new PipeConnectivityListener()); + new PipeConnectivityListener(), + TextSecurePreferences.isGcmDisabled(context) ? + new RealtimeSleepTimer(context) : + new UptimeSleepTimer()); } return this.messageReceiver;