Want to know which application is using microphone reached a conclusion,plz help

Discussion in 'Android Forum' started by tarun18, Aug 22, 2012.

  1. tarun18
    Offline

    tarun18 New Member

    Joined:
    Aug 22, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I was trying to do the following:-
    I was trying to find which application of my phone is using my phone microphone,i made lot of try and research and found the following:-
    When app want to use microphone, it must use "android.media.MediaRecorder" class,
    then the request will be delivered to /system/bin/mediaserver which is a system service,
    this service will open device and record voice,if you try to find app, it is very hard to do,
    because the request is delivered by Binder, we should monitor "/system/bin/mediaserver",
    if the service is using the "/dev/msm_pcm_in" device, it means it is recording,
    then we could list all running apps and find the app which have "RECORD_AUDIO" permission and also consumes CPU,
    I know it is a dirty way, but it maybe works.


    You could detect if microphone is working, you just need to su as root, then run "lsof | grep msm_pcm_in",

    ABOVE SOLUTION CANNOT BE USED BECAUSE I CANT USE THE ROOT PERMISSION



    then I FOUND

    dumpsys doesn't need root permission,
    although dumpsys can't give any mic information, but it could dump the service information,
    it also could help you find the app is using mic, we can combine two ways into one.

    1. all apps use microphone via "/system/mediaserver", it is a service whose name is "media.player".
    2. dumpsys can get information from specific service.


    Finally, we get the answer, "dumpsys media.player",
    if we are running any recording app,
    you will see a "MediaRecorderClient" which includes pid and more information,
    it means the app is using mic and recording voice ,now I can find the correct app which is using mic.

    BUT I WAS NOT ABLE TO USE DUMPSYS THROUGH C


    THEN I SWITCHED FINALLY TO lsof COMMAND AND RUN THE lsof CODE THROUGH MY NDK CODE AND I FOUND IN THE DUMP OF lsof THAT THERE IS SERVICE NAMED MEDIA SERVER AND FINALLY



    As per Android Multimedia framework the MediaServer is responsible for opening the device and the Java based audio applications connect it as a client. The data transfer happens on the Binder. May because of this there is only one process seen which opens the audio device.


    HOWEVER I REACHED HERE NOW I WANT TO KNOW HOW TO READ FROM THE INFO FROM MEDIA SERVER.

    OR

    ANYOTHER WAY TO DETECT WHICH APPLICATION IS USING MY PHONE MICROPHONE?
  2. DevilDogMP
    Offline

    DevilDogMP Active Member

    Joined:
    Jul 16, 2012
    Messages:
    3,783
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Raleigh, NC
    Sorry I can't help you on that one.

    Sent from my DROID BIONIC
  3. kiers
    Offline

    kiers New Member

    Joined:
    Jan 27, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Did you find a solution?

    Hello
    did you find solution?
    This is very important topic....the NSA of USA is spying also.
Search tags for this page
an app on my phone is using my mic. how do i find out which
,

another application is using the microphone

,

another application might be using the microphone

,
could not record audio another application might be using th
,
couldnt record audio shazam
,

it looks like another application is using the mic

,

mic is already on because it is being used by another applic

,
mic is already on because it is used by another application
,
samsung s4 looks like another application is using mic
,

shazam another application using microphone

,
shazam couldnt record audio
,
which app is using mike