BluetoothHeadset.GetCodecType(BluetoothDevice) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取给定 HFP 连接的设备的编解码器类型。
[Android.Runtime.Register("getCodecType", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.BluetoothHeadsetCodecType GetCodecType(Android.Bluetooth.BluetoothDevice device);
[<Android.Runtime.Register("getCodecType", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetCodecType : Android.Bluetooth.BluetoothDevice -> Android.Bluetooth.BluetoothHeadsetCodecType
参数
- device
- BluetoothDevice
远程蓝牙设备。 不得为 null。
返回
给定 HFP 连接的设备的编解码器类型。 返回 Unsupported 蓝牙是否关闭、配置文件未连接、设备未连接、编解码器协商未完成或发生错误。
- 特性
注解
获取给定 HFP 连接的设备的编解码器类型。
此方法返回 AG 和 HF 之间协商的编解码器类型,该类型在 HFP SLC 建立后可用,并且编解码器协商过程已完成。 无论 SCO 音频连接当前是否处于活动状态,都可以检索协商编解码器。 对于面向Build.VERSION_CODES的应用。S 或更高版本,这需要Manifest.permission.BLUETOOTH_CONNECT权限,android.app.Activity.requestPermissions(String[],int) 获得的权限。 需要Manifest.permission.BLUETOOTH_CONNECT
Android 参考。android.bluetooth.BluetoothHeadset.getCodecType
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。