fennifith / Status

A no-root status bar replacement for Android.
https://play.google.com/store/apps/details?id=com.james.status
Apache License 2.0
127 stars 29 forks source link

NotificationListenerService issues... #135

Closed fennifith closed 6 years ago

fennifith commented 6 years ago

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.

fennifith commented 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.

fennifith commented 6 years ago

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.

fennifith commented 6 years ago

I believe I have found an appropriate solution by creating two different StatusServices - one "compat" version which relies on the accessibility service for notifications, and one "normal" which extends NotificationListenerService.

fennifith commented 6 years ago

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.