Background service is not persistent (and will not work on Android O)
Under memory pressure, Android starts shutting down everything that's not in foreground. Since WaveUp uses a background service, it is affected. I've been using it with no issues since 1.2-2 (thank you very much, btw), but recently it's started to cause lock-ups that I suspect (but have not confirmed) to be the consequence of this (phone can not be woken either by WaveUp or power button).
I spent some time looking into this issue with a view to submitting a pull request before I saw issue #96 (closed)
Before Oreo, the correct thing to do would've been to return START_STICKY from WaveUpService.OnStartCommand. In Oreo, as you correctly noted in #96 (closed) and your revert, a foreground service with a permanent notification will be the only solution. Ideally, there would be two implementations:
- The current one, corrected to handle service restarts with START_STICKY
- An Oreo-compatible one, with a permanent notification (for those on Oreo and those who, like me, need the service to absolutely, positively be running regardless of OOM handling)
I'm willing to assist if absolutely necessary, but I'm not a Java or Android guy and, provided you have the time, it might be best that someone with a clue handles it.
If you're unwilling to force users to have a permanent notification, the idiom I've seen used is a separate checkbox/toggle (that could be placed under 'Enable Service') that allows them to turn the permanent notification on and off. An additional benefit of having a permanent notification would be that you could implement an enable/disable toggle right on the notification, allowing users to temporarily switch off waveup when they're doing something that conflicts with it.