Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 android 框架中编写了一个系统服务器/服务。据我所知,它具有系统级权限。但是,当我使用应用程序调用此服务时,我获得了调用该服务的应用程序的权限。谁能解释这种行为?另外我该如何解决这个问题?
在您的服务中尝试从其他服务调用方法时,请尝试将调用代码放入以下代码块中:
long token = Binder.clearCallingIdentity(); //your call Binder.restoreCallingIdentity(token);