Skip to content

Commit

Permalink
Specify sleep timing method for the websocket
Browse files Browse the repository at this point in the history
Specify sleep timing method for the websocket's keep-alive sender,
based on whether GCM is disabled.

Fixes signalapp#6644
// FREEBIE
  • Loading branch information
Dimitris Papavasiliou committed Jul 8, 2018
1 parent d06b129 commit 5da736e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5da736e

Please sign in to comment.