I have created an intent service that downloads some files, writes some of them to external storage and some data to my app's local database
It was working fine until I realised that the intent service runs in the same process of my app.
I want the service to do its job even if the app process terminates. I noticed that if I terminate my process, the intent service dies too and does not do the task.
So I read that I can run my intent service in a separate process which I done here
<service
android:name=".services.DownloadContentIntentService"
android:process=":whatever"
android:exported="false" />
Now the task runs in a separate process. It still runs if I terminate my app which is working.
However, I noticed that the intent service does not terminate itself once the task is done.
Even when I call stopSelf(). According to Android Studio, it is still alive.
What is happening?
Thank you for reading.