Closed fennifith closed 6 years ago
A possible solution I've found could be to merge the StatusService (the foreground one) and NotificationListenerService into one so the NLS is explicitly in the foreground. I have also come across a link to this question which confirms my suspicion that a foreground notification could help and provides a few more possible solutions.
Problem: merging the two services will move the minSdkLevel from 16 -> 18. Considering 25 is the last sdk that works, I don't want to restrict compatibility this much, and would like to keep as many users as possible. I will try to find a workaround.
I believe I have found an appropriate solution by creating two different StatusService
s - one "compat" version which relies on the accessibility service for notifications, and one "normal" which extends NotificationListenerService
.
I may have to add some complexity to this approach to prevent the services from ever running at the same time if the user messes with the compatibility switch.
Unsure what's causing this. Occasionally, on an sdk 24 LG Stylo 3, no notifications are received by the service until a reboot. Sdk 24 emulator works perfectly fine. Reboots temporarily fix it. This has been present for a while, but I couldn't get it to happen consistently so I did not make an issue.