34

I received a pop up in which Android Studio requests permission to access my microphone.

For as far as I know, there are no voice command features in Android Studio.

I found this rather odd and I hope someone knows why my IDE wants to acces my microphone.

Caspar Geerlings
  • 1,021
  • 2
  • 10
  • 21
  • yeah, for me as well. Strange isn't it – user2234 Oct 24 '18 at 02:04
  • Perhaps google voice assistant functionalities? – Caspar Geerlings Oct 24 '18 at 11:53
  • Good question. Just saw this, too and wondered! – Tobias Reich Aug 13 '19 at 07:45
  • 2
    To add to this, it appears even when I deny access it still does do so. I use micro-snitch to alert me whenever an app is using the microphone and/or webcam and can confirm that Android studio does get access even if you explicitly deny it and is always in a listening state when an emulator is running. – altShiftDev Nov 19 '19 at 19:15
  • 1
    Is it possible that you may have installed a plugin that is requesting access to the mircophone? For example, idear is one such plugin that lets you control the IDE with your voice: https://github.com/OpenASR/idear – breandan Nov 19 '19 at 19:36
  • 1
    @breandan no, I don't actually use the IDE itself and have 0 plugins for it. The only thing I'm using is the emulator for development through cordova and flutter. I've noticed this for more than a year now so it can't be just me. Should be rather easy for someone else to reproduce, MicroSnitch has a free trial, download and see for yourself: https://www.obdev.at/products/microsnitch/index.html – altShiftDev Nov 19 '19 at 19:44
  • Developer of Micro Snitch chiming in here: Micro Snitch uses notifications sent by macOS to determine when an audio device becomes active or inactive. This seems to be independent of whether a process actually receives audio samples, though. In other words, the audio device may very well be active, but that doesn’t mean Android Studio receives any audio data. – Marco Masser Nov 20 '19 at 15:49

1 Answers1

31

It's the Android emulator. The emulated phone has a microphone, so the emulator uses your computer's microphone to emulate it.

Feel free to deny access to your microphone; the emulator will work fine—except for its microphone, of course.

EDIT: monocasa on HN explained in more detail:

It just enables the microphone at emulated device instantiation time. Easier than enabling/and disabling it at runtime.

https://android.googlesource.com/platform/external/qemu/+/a7c579bdcbe2543472535718d3b637cb864f6f36/hw/android/goldfish/audio.c#288

Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175
  • 2
    That's likely correct, but how does it gain access to the microphone even when explicitly being denied access through the OSX permission prompt? – altShiftDev Nov 19 '19 at 22:31
  • 1
    It doesn't. The emulator prompts the user for microphone access; if you grant it access, then it has microphone access, but if you deny access, the emulator muddles along without microphone access. – Dan Fabulich Nov 20 '19 at 01:07
  • 1
    So you're saying Micro Snitch is incorrectly flagging the use of the microphone? – altShiftDev Nov 20 '19 at 15:18
  • I created a support ticket with the company and asked that they please respond to this ticket for a more authoritative response. – altShiftDev Nov 20 '19 at 15:26
  • 1
    I'm not familiar with Micro Snitch, but my hunch is that it's wrong. If it's possible on macOS to write software that can listen to the microphone even when denied access, then it should be possible to file that as a security bug to Apple. Apple has a sizable bug bounty for security issues; they will pay you literally thousands of dollars for finding and reporting an issue like this. Give it a shot, if you feel lucky! But my hunch is that Micro Snitch is in error. – Dan Fabulich Nov 20 '19 at 21:22
  • the devs responded to my ticket, you're correct. I've updated your answer with their response. – altShiftDev Nov 21 '19 at 20:29
  • I think there’s some confusion about how macOS works here. A device becoming active causes notifications to be sent by macOS and that is what Micro Snitch shows. A process activating a device does not necessarily mean that it receives any audio samples, though. In the case at hand here, Android Studio activates the microphone (which Micro Snitch shows), but if it will receive any audio samples depends on the user’s answer to the permissions dialog. – Marco Masser Nov 22 '19 at 08:47
  • You can verify my above claim using QuickTime Player by following these steps while Micro Snitch is running: 1. Run this command in Terminal to clear any permissions for QuickTime Player: `tccutil reset All com.apple.QuickTimePlayerX`. 2. Launch QuickTime Player and select File > New Audio Recording. 3. In the permission dialog shown by macOS, click “Don’t Allow”. 4. Micro Snitch will report that the audio device just became active, even though QuickTime Player cannot record due to missing permissions. – Marco Masser Nov 22 '19 at 08:47
  • I know that it is an old thread, but I bumped into it. I also have MicroSnitch in my system, which throws a ton of notifications when I boot the emulator, also my webcam blinks for a few seconds rapidly. Anyhow, once I start the emulator the microphone isn't working properly; thus I cannot use it in fibre etc. What I do after I start the emulator is to force quit the `coreaudiod` process, it automatically restarts and then everything works fine again. I also have disabled Android Studio from accessing mic from inside mac privacy settings. – panosru Jun 15 '20 at 09:00
  • Audio input could be disabled via .android/avd/Pixel_4_API_31.avd/config.ini edit. Just set hw.audioInput = no – x90 Sep 02 '23 at 13:08