Suppose I have a BroadcastReceiver registered in manifest, and my app is not active. So the new process will be spawned and onReceive() method of BroadcastReceiver would be triggered on the main thread of this new process.
Now, I spawn a thread from onReceive() method (I know that it is not recommended and Service should be used to prolong the process lifetime beyound onReceive()).
I'm curious would the spawned thread (let's assume it runs indefinetely) keep the process alive? Thinking of JVM it should, as JVM wouldn't exit until there are active non-daemon threads. And what about ART? ART is not JVM, it is a compiler, and the behaviour of the compiled application may be different, like killing the process and hence all the threads irrespective of whether they still run or not. Does anybody has the insights into this situation?