System server and application permisions

梦想与她 提交于 2019-12-08 06:45:38

问题


I have written a system server/service in android framework. As far as i know it has the system level permissions. But when i call this service using an app i get the permissions of application calling that service. Could anyone explain this behaviour? Also how could i resolve this?


回答1:


When in your service you try to call method from other service, try to put the code of call into the following code block:

long token = Binder.clearCallingIdentity();
//your call
Binder.restoreCallingIdentity(token);


来源:https://stackoverflow.com/questions/13055477/system-server-and-application-permisions

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