本文介绍了系统服务器和应用程序permisions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经写在Android框架系统服务器/服务。据我知道它有系统级权限。但是,当我使用一个应用程序调用这个服务,我得到的应用程序调用该服务的权限。任何人都可以解释这种现象?此外,我怎么能解决这个问题?
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?
推荐答案
当你的服务,你尝试从其他服务调用的方法,尽量把调用的code为以下code座:
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);
这篇关于系统服务器和应用程序permisions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!