Closed gilbsgilbs closed 3 years ago
Thanks @smichel17 for the fast review.
We already call startForeground, so we're good on that front.
Yup, I double checked that. It's required anyways if we want the service to display something I guess.
It looks like starting with targeting Android 9.0, there's an additional permission we'll need to request, and in Android 10 it'll have to go in the manifest — https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)
That's good catch, but unless I'm missing something, the permission is already requested in the manifest. Red Moon already targets API 29 (Android 10), so it wouldn't work otherwise.
Ha, you're right. I guess I haven't done much in the red moon code base for a while 😅
When launching FilterService from a quick setting tile with Red Moon shut, the service would fail to start on recent Android versions with the following traceback:
This is because recent versions of Android disallow starting a foreground services using
startService
directly. You have to usestartForegroundService
and ensure the started service callsstartForeground
5 seconds at most after the service is started. This behavior change is documented here.Let me know if you think any improvement should be made.