0

当我尝试启用 BluetoothAdapter 时,出现以下错误。

 08-30 11:53:34.310 1492-1492/com.example.androidthings.gattserver D/GattServerActivity: Bluetooth is currently disabled...enabling 
 08-30 11:53:34.314 1492-1492/com.example.androidthings.gattserver D/GattServerActivity: Bluetooth is currently disabled...enabling 
 08-30 11:53:34.585 1492-1492/com.example.androidthings.gattserver D/vndksupport: Loading /vendor/lib/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace. 
 08-30 11:53:34.787 1492-1505/com.example.androidthings.gattserver D/BluetoothAdapter: onBluetoothServiceUp: android.bluetooth.IBluetooth$Stub$Proxy@c8a1daa
 08-30 11:53:46.854 1492-1506/com.example.androidthings.gattserver D/BluetoothAdapter: onBluetoothServiceDown: android.bluetooth.IBluetooth$Stub$Proxy@c8a1daa

有人可以帮助我理解并修复此错误吗?

4

1 回答 1

1

在 Android Things 中启用蓝牙时,以编程方式执行:

adapter.enable()

REQUEST_ENABLE_INTENT 可能不起作用,因为您的 Raspberry 可能未连接到屏幕并且不会显示权限对话框。请记住,您还需要 BLUETOOTH_ADMIN 权限。

于 2018-08-30T16:30:43.763 回答