I have noticed that sometimes when many apps are running the ActivityManagerService decides to kill a background app.
The decision is made according to that app's adj value (just like in Unix).
This happens in updateOomAdjLocked.
The service uses the KillProcessQuiet method, which, according to my understanding sends a "kill -9" SIG to the process and kills it.
This is fine, but when this happens (usually with the Launcher app), it skips the entire onStop() and onDestroy() methods which should be part of an activity's lifecycle
.My question is how can an application know when this is done to it (is there any way to save data before?)
To which applications can this happen? (the Quiet Kill that is)
Are there any other cases in which the ActivityMangerService kills processes without sending a notification?
Thank you