Android 2.2 deprecates restartPackage but adds another headache

岁酱吖の 提交于 2019-12-12 14:08:26

问题


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.killBackgroundProcesses will kill our scheduled alarms?

If so, deprecating ActivityManager.restartPackage was pointless as "task killer" will now abuse ActivityManager.killBackgroundProcesses.


回答1:


I have made tests with this new killing method : alarms are not killed. services are restarting.




回答2:


It also appears from my testing that user-visible activities are not closed when this method is called.



来源:https://stackoverflow.com/questions/2877140/android-2-2-deprecates-restartpackage-but-adds-another-headache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!