Is Android system supposed to restart an application when it's upgraded while it's running?
When we upgrade our application (by opening the .apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect until we "force close" the application from application manager. However it is likely that the application is in some weird state and may not respond to some intents it should. So I want to know whether the application would be restarted if we fix that particular broken state or whether we need to handle the upgrade ourselves.
Note, that I know (or at least have some ideas) how to detect the upgrade programmatically. What I want to know is whether I am supposed to or whether there is some other mechanism that should do it if the application is in a sane state.
Is Android system supposed to restart an application when it's upgraded while it's running?
I dont know what should be the expected behaviour. But I know that it does not restart the app. So I have a BroadcastReceiver
waiting for the ACTION_PACKAGE_REPLACED
intent and then handle the app restart accordingly.