I've created a foreground service that implements LocationListener interface. This service updates the notification that shows the current user location (lat-long). The notification is updated when onLocationChanged is called.
The service has to run when the app is killed or in background. The user has to set the background limitation regarding battery optimization based on the specific device.(I'm doing this by hand on different menus)
The service is created obviously with startForeground and START_STICKY, and there is a Notification channel created for Android O+. After creation the service is bound to the main activity of the app.
In Android O and P, the foreground service works well in both cases (background/app killed) but when I install the app on Android Nougat the location is not updated: the foreground service stays in the notification bar but it seems to be frozen (Neither time nor location are updated).
Are there any particular operations that have to be done when a foreground service is created/started on android M and N ?