I am building a service for android 9 and found that in some situations it is closed by the android system
When looking at the logcat it seems to be killed by the lowmemorykiller
I have two questions:
- in android manifest i set an
intent-filter android:priority="1000", should that solve the issue? - what is the suggested stress test to simulate low memory conditions for testing? A source code would be very helpful.
android:priority="999"or less.[HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|RUNNING_CRITICAL|COMPLETE]
(Note that this command is available for devices with API >= 21)
Also I had a lot of situations when I needed "unstoppable" service, so I wrote my library. You can try it here: https://github.com/iardelian/Revive-S