Search code examples
permissionsgoogle-playandroid-tvandroid-12

Is RECORD_AUDIO permission mandatory for speech recognition on contemporary Android TV?


We are making a weather app. The app looks beautiful on large screens. So we target Android TV as well as phone and tablet. Recently, we have noticed that the search feature stopped working, unless RECORD_AUDIO permission declared in the app manifest.

We are testing TV search feature on Chrome Cast with Android 12. App build target is Android 13. Our search fragment is a descendant of SearchSupportFragment.

SearchSupportFragment.setSpeechRecognitionCallback() comment says "@deprecated Launching voice recognition activity is no longer supported. App should declare android.permission.RECORD_AUDIO in AndroidManifest file."

So we declared RECORD_AUDIO permission to keep supporting voice search (location search in a case of weather app).

After this modification we received the following warning from Google Play.

"Your app is requesting permissions which are used by less than 1% of functionally similar apps:" android.permission.RECORD_AUDIO ... requesting unnecessary permissions can affect your app's visibility on the Play Store."

Obviously, RECORD_AUDIO is a strange permission for a weather app. However, it is required to let the users voice-search on Android TV.

Keeping RECORD_AUDIO permission may reduce our app visibility on Google Play. Bad.

Dropping RECORD_AUDIO permission will block the users from voice search. Bad as well.

I wonder how to solve this puzzle?


Solution

  • The recommendation for migrating away from setSpeechRecognitionCallback() is to declare android.permission.RECORD_AUDIO in the manifest and use conventional speech to text for handling voice search.

    As for your concerns about requesting this permission, I would suggest that you only prompt the user for microphone permission the first time they press the microphone button to perform a voice search. Offering this context would make it self-evident what the purpose of the permission is.