Whatsapp service restarts after force stop when push notification received

让人想犯罪 __ 提交于 2019-12-11 09:58:13

问题


We are trying to understand the behavior of whatsapp service in Samsung S5 and above models. In these models whatsapp application is embedded to the ROM of the device, which you cannot uninstall it. Even I force stop the application, whatsapp service becomes running and displays the message when a push notification received.

I have tried it in Nexus 5 device on which whatsapp is not on ROM. In this case after force stop, whatsapp cannot receive push notification and service is still not running.

I am suspicious that Samsung has provided another privilege to whatsapp application. By the way we are registering to broadcastreceiver from Android manifest file.

Thanks in advance,


回答1:


Apps that are installed under /system/app or /system/priv-app folders (most of the ROM bundled apps are in those folders and they cannot be uninstalled) can still receive push notifications even if they are force stopped by user.

So, it's not likely that Samsung gives some privilege to Whatsapp, but they've just bundled it with the ROM and put the apk into one of system app folders.




回答2:


Android has made changes or restricted from Android 3.0 installed app has to be opened atleast once to start service or receive broadcast. , for 3rd party or installed application if the services are killed , the application should be opened at least once . So in case of Nexus 5 whats app is a 3rd party app , where as in Samsung it is a system app so it has permission to start service with out launching the application.



来源:https://stackoverflow.com/questions/32395912/whatsapp-service-restarts-after-force-stop-when-push-notification-received

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