語言

BluetoothHeadset.GetCodecType(BluetoothDevice) 方法

定義

取得該 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

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於