aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-28 16:07:16 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-28 16:07:16 +0200
commitbc326efd2cce02bd8a68ac35257efdae4ffe66c0 (patch)
tree6b395ee1f2dfce409ba6cd6afc78d9ec22af5f6c
parentbc36f1950f95bd24ff058a897020da9fdfed70b2 (diff)
schedule first idle ping on service creation
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 8bcb76c6..7eebe069 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -767,6 +767,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
toggleForegroundService();
updateUnreadCountBadge();
toggleScreenEventReceiver();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ scheduleNextIdlePing();
+ }
}
@Override
@@ -858,6 +861,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
@TargetApi(Build.VERSION_CODES.M)
private void scheduleNextIdlePing() {
+ Log.d(Config.LOGTAG,"schedule next idle ping");
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(this, EventReceiver.class);
intent.setAction(ACTION_IDLE_PING);