问题
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