0

I'm developing an app that uses SpeechRecognizer. This requires the RECORD_AUDIO permission and thus I ask for it to the user. So far, so good.

However, I recently learned that SpeechRecognizer relies on the Google app (com.google.android.googlequicksearchbox) and, if this app lacks RECORD_AUDIO permission, the speech recognition does not work at all (see this answer).

In other words, my app requires the RECORD_AUDIO permission granted for itself and also for the googlequicksearchbox app.

How can I ask the user to grant the RECORD_AUDIO permission for googlequicksearchbox? I mean, how to programmatically open the RECORD_AUDIO permission dialog for googlequicksearchbox?

I already know that I can tell the user to browse through the menus (Settings -> Apps -> Google -> Permissions -> Microphone) but I want to avoid this if possible.

Cesar Mauri
  • 495
  • 6
  • 14
  • you can use https://github.com/googlesamples/easypermissions to ask permission before accessing `SpeechRecognizer` – Priyanka Feb 21 '20 at 09:45
  • thanks for the pointer @Priyankagb, but unfortunately this library only seems to deal with the permissions of the same app. – Cesar Mauri Feb 24 '20 at 10:37

0 Answers0