是否可以在无需用户干预的情况下从 ADB 启动蓝牙?我试过了:
am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
但这需要用户按确定。和:
service call bluetooth 3
不做任何事情。在 init.rc 中启用蓝牙服务也不起作用。
service bluetoothd /system/bin/bluetoothd -n
class main
socket bluetooth stream 660 bluetooth bluetooth
socket dbus_bluetooth stream 660 bluetooth bluetooth
# init.rc does not yet support applying capabilities, so run as root and
# let bluetoothd drop uid to bluetooth with the right linux capabilities
group bluetooth net_bt_admin misc
enabled
我更喜欢亚行的命令。(如果有人想知道我需要它来进行 FCC 测试。)