0

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).

chiv
  • 165
  • 1
  • 2
  • 15

1 Answers1

0

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • @CommomsWare sir i am not the implementer actually i try'ed this to know which application of my phone is using my microphone,i also founded another way that is written here http://stackoverflow.com/questions/12104284/how-to-know-which-application-is-using-the-microphone can u tell on any of them? – chiv Aug 24 '12 at 12:55
  • @chiv: I am not aware of any means for an SDK app to find out if another SDK app is or is not presently using the microphone. – CommonsWare Aug 24 '12 at 12:58
  • @CommomsWare sir do u how can we run dumpsys in Android 2.3.3 as i get the permission denial for some permission even after adding permission like android.permission.DUMP – chiv Aug 24 '12 at 13:04