I am wondering: when an app is to be killed, does Android wait for the currently running function to return, or does Android stop it before it ends by itself?
Each android app runs on a separate Dalvik VM. and when android kills that app , it destroys that VM instance. and doesn't care for the threads you are using or what are they doing , you can easily test that , by creating a tcp server socket which will block until a client connects and then kill the app, nothing happens, no interrupt exception raise or anything because the VM instance itself get killed.