use of org.whispersystems.signalservice.api.util.UptimeSleepTimer in project Signal-Android by WhisperSystems.
the class ApplicationDependencyProvider method provideSignalWebSocket.
@Override
@NonNull
public SignalWebSocket provideSignalWebSocket() {
SleepTimer sleepTimer = SignalStore.account().isFcmEnabled() ? new UptimeSleepTimer() : new AlarmSleepTimer(context);
SignalWebSocketHealthMonitor healthMonitor = new SignalWebSocketHealthMonitor(context, sleepTimer);
SignalWebSocket signalWebSocket = new SignalWebSocket(provideWebSocketFactory(healthMonitor));
healthMonitor.monitor(signalWebSocket);
return signalWebSocket;
}
use of org.whispersystems.signalservice.api.util.UptimeSleepTimer in project Signal-Android by signalapp.
the class ApplicationDependencyProvider method provideSignalWebSocket.
@Override
@NonNull
public SignalWebSocket provideSignalWebSocket() {
SleepTimer sleepTimer = SignalStore.account().isFcmEnabled() ? new UptimeSleepTimer() : new AlarmSleepTimer(context);
SignalWebSocketHealthMonitor healthMonitor = new SignalWebSocketHealthMonitor(context, sleepTimer);
SignalWebSocket signalWebSocket = new SignalWebSocket(provideWebSocketFactory(healthMonitor));
healthMonitor.monitor(signalWebSocket);
return signalWebSocket;
}
use of org.whispersystems.signalservice.api.util.UptimeSleepTimer in project mollyim-android by mollyim.
the class ApplicationDependencyProvider method provideSignalWebSocket.
@Override
@NonNull
public SignalWebSocket provideSignalWebSocket() {
SleepTimer sleepTimer = SignalStore.account().isFcmEnabled() ? new UptimeSleepTimer() : new AlarmSleepTimer(context);
SignalWebSocketHealthMonitor healthMonitor = new SignalWebSocketHealthMonitor(context, sleepTimer);
SignalWebSocket signalWebSocket = new SignalWebSocket(provideWebSocketFactory(healthMonitor));
healthMonitor.monitor(signalWebSocket);
return signalWebSocket;
}
use of org.whispersystems.signalservice.api.util.UptimeSleepTimer in project signal-cli by AsamK.
the class SignalDependencies method getSignalWebSocket.
public SignalWebSocket getSignalWebSocket() {
return getOrCreate(() -> signalWebSocket, () -> {
final var timer = new UptimeSleepTimer();
final var healthMonitor = new SignalWebSocketHealthMonitor(timer);
final var webSocketFactory = new WebSocketFactory() {
@Override
public WebSocketConnection createWebSocket() {
return new WebSocketConnection("normal", serviceEnvironmentConfig.getSignalServiceConfiguration(), Optional.of(credentialsProvider), userAgent, healthMonitor);
}
@Override
public WebSocketConnection createUnidentifiedWebSocket() {
return new WebSocketConnection("unidentified", serviceEnvironmentConfig.getSignalServiceConfiguration(), Optional.empty(), userAgent, healthMonitor);
}
};
signalWebSocket = new SignalWebSocket(webSocketFactory);
healthMonitor.monitor(signalWebSocket);
});
}
Aggregations