schedule first idle ping on service creation
This commit is contained in:
parent
bc36f1950f
commit
bc326efd2c
|
@ -767,6 +767,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
||||||
toggleForegroundService();
|
toggleForegroundService();
|
||||||
updateUnreadCountBadge();
|
updateUnreadCountBadge();
|
||||||
toggleScreenEventReceiver();
|
toggleScreenEventReceiver();
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
scheduleNextIdlePing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -858,6 +861,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.M)
|
@TargetApi(Build.VERSION_CODES.M)
|
||||||
private void scheduleNextIdlePing() {
|
private void scheduleNextIdlePing() {
|
||||||
|
Log.d(Config.LOGTAG,"schedule next idle ping");
|
||||||
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||||
Intent intent = new Intent(this, EventReceiver.class);
|
Intent intent = new Intent(this, EventReceiver.class);
|
||||||
intent.setAction(ACTION_IDLE_PING);
|
intent.setAction(ACTION_IDLE_PING);
|
||||||
|
|
Loading…
Reference in a new issue