Search code examples
androidmicrophoneandroid-audiomanagerandroid-9.0-pie

Access microphone in android 9 while the app is in the background


Android 9 limits the ability for background apps to access user input. If your app is running in the background on a device running Android 9, the system applies the following restrictions to your app:

Your app cannot access the microphone or camera.

Is there any way to access microphone in android 9 while the app is in the background.


Solution

  • One more change was added in Android 9: only apps running in the 
    foreground (or a foreground service) could capture the audio input.
    

    Reference: https://developer.android.com/guide/topics/media/sharing-audio-input#pre-behavior