traccar-client-android
traccar-client-android copied to clipboard
Remove sticky notification in hidden mode
Sticky notification (#46) is not removed/disabled in hidden mode.
What Android version are you using?
I'm using LineageOS 14.1-20170329 android version 7.1.1
What version of Traccar Client are you using?
Traccar Client 4.1 (hidden mode).
Just tested it on 7.1.1 and indeed the notification is there. I don't think it's possible to do anything about it. Sticky notification is required for foreground services. If we don't make service foreground, system would kill it after some time.
What you can do is block notifications from Traccar Client app. Slide the notification and block it.
As you said foreground services MUST have a notification. https://developer.android.com/guide/components/services.html#Foreground
A solution may be to start the service in background and schedule a runner to check if it's running and re-run when needed (only for hidden mode albeit).
How do you "schedule a runner"?
With AlarmManager. https://developer.android.com/training/best-background.html https://developer.android.com/training/scheduling/alarms.html
Is it OK if I implement it and request a "pull request"?
It's already implemented. The problem that it won't stop doze mode on recent versions of Android.