BluetoothLeAudio.GetConnectionState(BluetoothDevice) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得針對Build.VERSION_CODES應用程式的設定檔目前連線狀態。R 或以下,這需要 Manifest.permission.BLUETOOTH 權限,可透過簡單的 <uses-permission> manifest 標籤取得。
[Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.ProfileState GetConnectionState(Android.Bluetooth.BluetoothDevice device);
[<Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
abstract member GetConnectionState : Android.Bluetooth.BluetoothDevice -> Android.Bluetooth.ProfileState
override this.GetConnectionState : Android.Bluetooth.BluetoothDevice -> Android.Bluetooth.ProfileState
參數
- device
- BluetoothDevice
傳回
價值屬於以下之一:BluetoothProfile.STATE_DISCONNECTED;BluetoothProfile.STATE_CONNECTING;BluetoothProfile.STATE_CONNECTED;BluetoothProfile.STATE_DISCONNECTING
實作
- 屬性
備註
取得針對Build.VERSION_CODES應用程式的設定檔目前連線狀態。R 或以下,這需要 Manifest.permission.BLUETOOTH 權限,可透過簡單的 <uses-permission> manifest 標籤取得。 針對Build.VERSION_CODES的應用程式。若為 S 或更高,則需取得 Manifest.permission.BLUETOOTH_CONNECT 權限,可透過 android.app.Activity.requestPermissions(String[],int)取得。 需要Manifest.permission.BLUETOOTH_CONNECT
Java 文件 android.bluetooth.BluetoothLeAudio.getConnectionState(android.bluetooth.BluetoothDevice)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。