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

124 Views Asked by At

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

There are 1 best solutions below

3
On

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.