From 788eddc31e5ef688b98eacfbf5a9cc4172d7cbf4 Mon Sep 17 00:00:00 2001 From: lambdaupb Date: Fri, 23 Oct 2015 18:27:50 +0200 Subject: [PATCH] Reconnect Loop because of skipping backOff logic currentDelay would stay 0 if error occurs in connect() method, resulting in busy-loop on network failures. Fix by always calling scheduleReconnect() which contains backoff logic. --- .../src/main/java/org/microg/gms/gcm/McsService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java index 8c60d15a..c1a3aa69 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java @@ -377,11 +377,9 @@ public class McsService extends Service implements Handler.Callback { sslSocket.close(); } catch (Exception ignored) { } - if (currentDelay == 0) { - sendBroadcast(new Intent("org.microg.gms.gcm.RECONNECT"), "org.microg.gms.STATUS_BROADCAST"); - } else { - scheduleReconnect(this); - } + + scheduleReconnect(this); + alarmManager.cancel(heartbeatIntent); if (wakeLock != null) { wakeLock.release();