A couple of years ago I gave up developing Android apps because Samsung stopped persisting foreground services. This move by the leading Android platform killed all of my apps.
I'm familiar with dontkillmyapp.com but using all of those suggested interventions don't do the job.
Any time the phone user uses the "close all" option my foreground service gets killed immediately along with all the running apps. This is a common operation that I often use when poorly written stubborn apps won't quit. This happens regardless of any battery settings.
This posting is sort of a last check to see if anyone has come up with a solution to this problem.
I still don't understand why Samsung would do such a thing unless they are trying to push Android off their phones in favor of some new operating system they may be working on.