It is technically not possible. When you set StartAtBoot the compiler adds an intent filter to the manifest file. What you can do is save the setting in a file and then when the service starts just call StopService if it isn't needed.
Another option is to have a "shell" service one layer higher. Always start that at boot. Read your variable in the shell service. If it is start at boot, start the other "real" service. If not, just stop the shell service.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.