What permissions are needed to programmatically mute a phone call, from a background app?

梦想与她 提交于 2019-12-20 03:07:43

问题


I have an Android app that happens to be running in the background on the user's Android phone, while the user is speaking on a phone call that someone placed to the user. At a certain point, my app would like to silence the audio from the phone call and play its own audio. Moreover, I'd like to do this without disrupting the user's speech.

What permission does my app need to have, to do this? Is there any permission that's available to third-party apps that is sufficient to let my app do this?

It looks like AudioManager.setStreamMute(STREAM_VOICE_CALL, true) will mute the audio output from the voice call. But I can't tell what permission this needs: it's not listed in the Android API documentation, or in the Pscout permission map. Also, I can't tell if there any restrictions on using this API from an app running in the background, on any version of Android.

(If the problem statement wasn't clear: Alice has installed my app on her phone. Bob calls Alice. Alice picks up the call and is talking to Bob. At a certain point, my app wants to completely mute Bob's voice and play its own audio clip instead, so Alice hears the audio clip instead of anything that Bob says. But, I don't want to turn off the microphone on Alice's phone: if Alice is saying anything, that should still be picked up over the call and Bob should still hear it on the phone call.)


回答1:


You can try: android.permission.MODIFY_AUDIO_SETTINGS.



来源:https://stackoverflow.com/questions/21468064/what-permissions-are-needed-to-programmatically-mute-a-phone-call-from-a-backgr

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