android 蓝牙 HFP 总结
首先确认配置文件是否开启hfp profile功能。根据设备的角色(hfp client / hfp server)来配置hfp profile. profile 配置文件路径: alps/packages/apps/Bluetooth/res/values/config.xml alps/device/${customer}/${ProjectName}/overlay/packages/apps/Bluetooth/res/values/config.xml e.g. 设备的角色定义为hfp client,需做如下配置: <bool name="profile_supported_hs_hfp">false</bool> <bool name="profile_supported_hfpclient">true</bool> 接下来看一下hfp client 的实现,以accep call为例 //3步获取hfp client service 1)BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter(); 2)mAdapter.getProfileProxy(getApplicationContext(),new MServerListener(), BluetoothProfile.HEADSET