Is there any provision in android to know which user application is using which system service

久未见 提交于 2020-01-06 08:01:31

问题


Is there any provision in android or ndk by to know which user application is using which system service? OR another way by using pid:-

Suppose i have an application which uses microphone, microphone is opened by the system service (named media serv).I can manage to get the pid of above service(media serv).Now i want to know which user application is using the the pid of above service(media serv).


回答1:


If you are the implementer of the system service -- such as via creating your own fork of the Android OS -- there should be ways to do this via the Binder IPC protocol. SDK apps that implement a service that uses the binding pattern can find out who call them, via calls on their Binder object. If an SDK app has the ability to get that information, one imagines that the system service could get the same information from its C/C++ Binder equivalent.

If you not the implementer of the system service, then no, communications between apps and system services are private to those processes.



来源:https://stackoverflow.com/questions/12109401/is-there-any-provision-in-android-to-know-which-user-application-is-using-which

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