Android catch Bluetooth HFP's Activate Voice Recognition

冷暖自知 提交于 2019-12-22 11:16:02

问题


When Bluetooth hands free device connected to mobile phone, if device sends an AT command AT+BVRA to enable voice recognition, the mobile phone launches the default voice recognition app if it supports.

My android phone (OS : 4.1.2, Model : Samsung Galaxy Core I8262) launching S Voice app for recognition.

I think if my phone has more recognition activities, it may show list to select one, if no default set. I never observed this case.

My question, Is there any way to catch AT+BVRA command received ?

If anybody know about this, please give your valuable suggestions.


回答1:


To receive AT+BVRA on Android, you need to grab the VOICE_COMMAND intent. This is what you need in your AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.VOICE_COMMAND"/>
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

On Samsung phones, the priority for S-Voice is set high (10, if I recall correctly). This means that no application will get this intent. You need to disable S-Voice: (Instructions on how to disable apps) to receive the intent.



来源:https://stackoverflow.com/questions/20115098/android-catch-bluetooth-hfps-activate-voice-recognition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!