androidopentoktokboxvonage

Android device shows microphone is actively being used even though session is paused and audio is disabled


  1. Start publishing to a session, notice that Android OS now reports that camera and microphone is being used by the app, which is fine.

image

  1. Call session.onPause() followed by publisher.publishAudio = false.
  2. (Optional) Move application into background by pressing Home button.
  3. Android OS indicates that camera is no longer being used, but microphone is still being used by the application.

image

Although it does not affect usability of the app it is bad in terms of user privacy perspective - the user might think the app is still recording audio while it is in background, which is scary.

Is there other methods I can call to turn off the microphone access totally, just like the camera?


Solution

  • Got a reply from Tokbox support and they provided a tweak that works as expected!

    For your use case, where you don't want to retain the audio access when the app goes into the background, you can try to call AudioDeviceManager.getAudioDevice().stopCapturer() to stop the capturer and it will remove the microphone access. If you do this, please make sure to call AudioDeviceManager.getAudioDevice().startCapturer() when the app comes in the foreground.