如何确定哪个应用程序阻止麦克风使用? -- microphone 领域 和 7.1-nougat 领域 和 debug 领域 android 相关 的问题

How to determine which application is blocking microphone usage?


简体版||繁體版
1
vote

问题

中文

是否有一种方法来确定当前运行的应用程序正在使用麦克风?我怀疑箭头发射器,但想尝试并确认这一点。 我正在寻找一种方法,它会提供日志/调试信息以添加到一个错误报告

Android版本7.1。 rooted nexus 5x。

我不是在寻找另一个应用程序来提供此功能。我是一个开发人员(虽然不是Java),并且想了解所涉及的进程访问和阻止麦克风。

以下是从首次答案所请求的Dumpsys音频转储:

   adb shell dumpsys audio  MediaFocusControl dump time: 12:43:52 pm  Audio Focus stack entries (last is top of stack):   Notify on duck: true   Stream volumes (device: index) - STREAM_VOICE_CALL:    Muted: false    Min: 1    Max: 7    Current: 1 (earpiece): 5, 40000000 (default): 5    Devices: speaker - STREAM_SYSTEM:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_RING:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_MUSIC:    Muted: false    Min: 0    Max: 15    Current: 4 (headset): 5, 8 (headphone): 5, 40000000 (default): 11    Devices: speaker - STREAM_ALARM:    Muted: false    Min: 0    Max: 7    Current: 40000000 (default): 6    Devices: speaker - STREAM_NOTIFICATION:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_BLUETOOTH_SCO:    Muted: false    Min: 0    Max: 15    Current: 40000000 (default): 7    Devices: speaker - STREAM_SYSTEM_ENFORCED:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_DTMF:    Muted: false    Min: 0    Max: 15    Current: 1 (earpiece): 11, 2 (speaker): 9, 40000000 (default): 11    Devices: speaker - STREAM_TTS:    Muted: false    Min: 0    Max: 15    Current: 4 (headset): 5, 8 (headphone): 5, 40000000 (default): 11    Devices: speaker  - mute affected streams = 0x2e  Ringer mode:  - mode (internal) = NORMAL - mode (external) = NORMAL - ringer mode affected streams = 0x1a6 (STREAM_SYSTEM,STREAM_RING,STREAM_NOTIFICATION,STREAM_SYSTEM_ENFORCED,STREAM_DTMF) - ringer mode muted streams = 0x0 - delegate = ZenModeHelper  Audio routes:   mMainType=0x0   mBluetoothName=null  Other state:   mVolumeController=VolumeController(android.os.BinderProxy@2e64f54,mVisible=false)   mSafeMediaVolumeState=SAFE_MEDIA_VOLUME_INACTIVE   mSafeMediaVolumeIndex=50   mPendingVolumeCommand=null   mMusicActiveMs=1500001   mMcc=234   mCameraSoundForced=false   mHasVibrator=true   mControllerService={mUid=0,mComponent=null}   mVolumePolicy=VolumePolicy[volumeDownToEnterSilent=true,volumeUpToExitSilent=true,doNotDisturbWhenSilent=true,vibrateToSilentDebounce=400]   

我也尝试过:

  adb shell dumpsys activity broadcasts | grep -i microphone   

这不会给出输出。

english

Is there a way to determine which currently running application is using the microphone? I suspect the arrow launcher but would like to try and confirm this. I'm looking for a method which would provide logs / debug info to add to a bug report.

Android version 7.1. Rooted Nexus 5x.

I am not looking for another app to provide this functionality. I am a developer (though not Java) and would like to understand the processes involved in gaining access to and blocking the microphone.

here's the dump from dumpsys audio as requested by first answer:

 adb shell dumpsys audio  MediaFocusControl dump time: 12:43:52 pm  Audio Focus stack entries (last is top of stack):   Notify on duck: true   Stream volumes (device: index) - STREAM_VOICE_CALL:    Muted: false    Min: 1    Max: 7    Current: 1 (earpiece): 5, 40000000 (default): 5    Devices: speaker - STREAM_SYSTEM:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_RING:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_MUSIC:    Muted: false    Min: 0    Max: 15    Current: 4 (headset): 5, 8 (headphone): 5, 40000000 (default): 11    Devices: speaker - STREAM_ALARM:    Muted: false    Min: 0    Max: 7    Current: 40000000 (default): 6    Devices: speaker - STREAM_NOTIFICATION:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_BLUETOOTH_SCO:    Muted: false    Min: 0    Max: 15    Current: 40000000 (default): 7    Devices: speaker - STREAM_SYSTEM_ENFORCED:    Muted: false    Min: 0    Max: 7    Current: 1 (earpiece): 5, 2 (speaker): 4, 40000000 (default): 5    Devices: speaker - STREAM_DTMF:    Muted: false    Min: 0    Max: 15    Current: 1 (earpiece): 11, 2 (speaker): 9, 40000000 (default): 11    Devices: speaker - STREAM_TTS:    Muted: false    Min: 0    Max: 15    Current: 4 (headset): 5, 8 (headphone): 5, 40000000 (default): 11    Devices: speaker  - mute affected streams = 0x2e  Ringer mode:  - mode (internal) = NORMAL - mode (external) = NORMAL - ringer mode affected streams = 0x1a6 (STREAM_SYSTEM,STREAM_RING,STREAM_NOTIFICATION,STREAM_SYSTEM_ENFORCED,STREAM_DTMF) - ringer mode muted streams = 0x0 - delegate = ZenModeHelper  Audio routes:   mMainType=0x0   mBluetoothName=null  Other state:   mVolumeController=VolumeController(android.os.BinderProxy@2e64f54,mVisible=false)   mSafeMediaVolumeState=SAFE_MEDIA_VOLUME_INACTIVE   mSafeMediaVolumeIndex=50   mPendingVolumeCommand=null   mMusicActiveMs=1500001   mMcc=234   mCameraSoundForced=false   mHasVibrator=true   mControllerService={mUid=0,mComponent=null}   mVolumePolicy=VolumePolicy[volumeDownToEnterSilent=true,volumeUpToExitSilent=true,doNotDisturbWhenSilent=true,vibrateToSilentDebounce=400] 

I have also tried:

adb shell dumpsys activity broadcasts | grep -i microphone 

This gives no output.

        

回答列表

1
 
vote

我不确定nougat,但这适用于Android 6.0.1。运行:

  adb shell dumpsys audio    

在输出外观下音频焦点堆栈条目(最后是堆叠)。例如,当我有一个使用麦克风的音频记录器应用程序时,输出为:

 音频焦点堆栈条目(最后是堆栈顶部):   来源:android.OS.BinderProxy@a60844c  -  pack:com.sonsonymobile.androidapp.audiorecorder  -  client:android.media.audiomanager @ a251d71com.sonmobile.androidapp.audiorecord.shared.media.volumeControl @ 72c2756  - 增益:增益 - 标志: - 损失:无 ​​-  UID:10108  -  attr:oundattributes:用法= 1 content = 2 flags = 0x0标签= 

使用麦克风的包是 com.sonsonmobile.androidapp.AudioreCorder

 

I'm unsure about Nougat but this works for Android 6.0.1. Run:

adb shell dumpsys audio  

In the output look under Audio Focus stack entries (last is top of stack). E.g., when I had an audio recorder app using microphone, the output was:

 Audio Focus stack entries (last is top of stack):   source:android.os.BinderProxy@a60844c -- pack: com.sonymobile.androidapp.audiorecorder -- client: android.media.AudioManager@a251d71com.sonymobile.androidapp.audiorecorder.shared.media.VolumeControl@72c2756 -- gain: GAIN -- flags:  -- loss: none -- uid: 10108 -- attr: AudioAttributes: usage=1 content=2 flags=0x0 tags= 

Here the package using the microphone is com.sonymobile.androidapp.audiorecorder.

 
 
1
 
vote

使用 logcatemote 和监视每个应用程序设置为whatsapp,它显示

mediaFocuscontrol: Audiofocus*request*Audiofocus() from Android.media.audiomanager 当麦克风被激活时

mediaFocuscontrol: Audiofocus*abandon*Audiofocus() from Android.media.audiomanager 当麦克风被解除激活

 

Using logcat extreme and monitoring per app set to WhatsApp , it shows

mediaFocuscontrol: Audiofocus*request*Audiofocus() from Android.media.audiomanager when microphone is activated

And

mediaFocuscontrol: Audiofocus*abandon*Audiofocus() from Android.media.audiomanager when microphone is de-activated

 
 
   
   

相关问题

0  当触摸不起作用时,如何在Xperia Miro上启用USB调试?  ( How can i enable usb debugging on xperia miro when touch is not working ) 
我有一个xperia miro。我正在尝试用OTG电缆连接鼠标,但它无法检测到。 触摸完全没有工作。 如何解决这个问题? ...

1  如何在Android上访问Opera Mobile的浏览器控制台?  ( How can i access the browser console on opera mobile on android ) 
如何在 Opera Mobile上访问浏览器控制台Android ? 浏览器控制台=类似于Chrome上的开发人员控制台窗口的东西,按下键盘快捷键Ctrl Shift J ...

0  使用远程调试安装恶意软件  ( Malware installed with remote debugging ) 
有人可以在没有注意到的情况下安装apks,使用远程调试吗? (例如,通过TCP / IP,或在同一WiFi网络上)。我发现文章在快速谷歌后指的是,但我不确定他们是否不仅仅是危言耸听者。 编辑:本文似乎讨论了类似的东西 - "android" s外部设备攻击:演示和安全性 建议" - 魏等人。 我在考虑启用调试模式...

6  如何防止Galaxy S4从连接为“连接为安装程序”而不是“连接为媒体设备”?  ( How to prevent galaxy s4 from connecting as connected as installer instead of ) 
我有我的verizon wireless samsung galaxy s4的开发人员选项,启用了USB调试开启。每当我将它连接到我的机器时,它会在通知窗口中显示"连接为安装程序" 。但是,大约三十秒后,它会切换到"连接为媒体设备" ,如果没有我做任何事情。无论我连接到哪个操作系统(在OSX和Windows中安装了适...

0  在Nexus 5x上调试WiFi连接  ( Debugging wifi connection on nexus 5x ) 
从Nexus 5升级到Nexus 5x后,我无法连接到我公司的WiFi。我提供的凭据是正确的,有时我会设法连接,但这持续几秒到几分钟。 WiFi屏幕显示带有"已保存" 的WiFi,然后通过"连接" ,"验证" 并返回"已保存" 。 如何调试此操作并查看正在发生的事情?有没有我可以调查的日志?到目前为止,所有其他W...

0  如何制作任何应用程序调试  ( How to make any app debuggable ) 
我正在研究一些项目,我需要在Android Android市场上调试现有应用程序。我知道修改了androidmanifest.xml我们可以这样做,但是我需要有源代码。所以有没有任何短暂的方法来实现这项任务。在Developer选项中可以"选择Debug应用程序" 选项帮助? ...

1  调试BootLoop?  ( Debug a bootloop ) 
所以我试图将gsm rom港口移植到cdma,它是在bootloop中。我想知道如何弄清楚如何看待究竟是什么是错误并导致它,所以我可以解决它。 请注意,当谈到这样的事情时,我是一个新手,但我知道我的方式围绕软件和硬件。我只是这样做是一种学习体验,以进一步了解我在Android操作系统中贡献工作,我可能会在将来开始做。...

2  Nexus 5上没有调试图标与Android 6.0.1棉花糖  ( No debug icon on nexus 5 with android 6 0 1 marshmallow ) 
当我插上USB电缆时,调试图标不会显示出来。 adb设备没有看到它。 开发人员模式已启用。 开发人员选项已启用。 保持唤醒使能。 USB调试启用。 我已经是开发人员模式。昨天它在插入SIM卡并重新启动后出现,但今天早上没有任何东西。 我正在使用debian 8并调试其他设备从未出现过问题。 我甚至尝试重新启...

-2  在Android设备中测试是否会降低它的生命? [复制]  ( Does testing in android device will reduce its life ) 
这个问题已经在这里有答案: 不断充电损坏我的Android手机? (6个答案) ...

3  我的nexus 4上的adb问题(未经授权的电话)  ( Problem with adb on my nexus 4 unauthorized phone ) 
在CMD中运行adb设备时,它表示我的手机未经授权。似乎它与RSA指纹提示有关。我不记得曾经得到这样的提示。是的,我在PTP模式下运行,并启用调试。我尝试过多个小时的互联网尝试: 启用/禁用调试模式反复 卸载并重新安装我的手机或adb 的驱动程序 adb-killserver 和 adb-startserver...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有