use 500 ms margin

This commit is contained in:
sonora 2019-05-06 23:21:19 +02:00
parent 230d6ef4d7
commit 690de9e2fa

View file

@ -55,7 +55,7 @@ public class OnNavigationServiceAlarmReceiver extends BroadcastReceiver {
if (Build.VERSION.SDK_INT >= 19) {
NavigationService service = ((OsmandApplication) context.getApplicationContext()).getNavigationService();
// Avoid drift
while ((service.getNextManualWakeup() - SystemClock.elapsedRealtime()) < 0) {
while ((service.getNextManualWakeup() - SystemClock.elapsedRealtime()) < 500) {
service.setNextManualWakeup(service.getNextManualWakeup() + service.getServiceOffInterval());
}
AlarmManager alarmManager = (AlarmManager) service.getSystemService(Context.ALARM_SERVICE);