Android 2.2 deprecates restartPackage but adds another headache
Android 2.2 release notes have just been released. ActivityManager.restartPackage method has been deprecated and the description is:
the previous behavior here is no longer available to applications because it allows them to break other applications by removing their alarms, stopping their services, etc.
Instead 2.2 has given another tool for pesky "task killer" apps by introducing new ActivityManager.killBackgroundProcesses method.
More Info
Can someone explain whether ActivityManager.killBackg开发者_如何学JAVAroundProcesses will kill our scheduled alarms?
If so, deprecating ActivityManager.restartPackage was pointless as "task killer" will now abuse ActivityManager.killBackgroundProcesses.
I have made tests with this new killing method : alarms are not killed. services are restarting.
It also appears from my testing that user-visible activities are not closed when this method is called.
精彩评论