问题
Hello everyone i am new to android ndk and want to find two things:
- Can we detect whether the microphone is on or not?
- Can we detect which application is using the microphone?
It would be good if anyone knows any idea how to do above through C or through android sdk.
回答1:
1.
AudioManager am = Context.getSystemService(Context.AUDIO_SERVICE)
am.isMicrophoneMute()
But I don't know how to do it using NDK (and no one seems to know).
AudioManager documentation
2.
No you can't. And that is a security decision. As @AndiJay said, malicious programs could then be used.
来源:https://stackoverflow.com/questions/11886824/can-we-detect-which-android-application-is-using-the-microphone