我想通过单击按钮来停止蓝牙发现过程。我使用btAdapter.cancelDiscovery()
,但我的应用程序仍在扫描设备。我已经BLUETOOTH_ADMIN
在清单中放了许可。我在这里想念什么吗?
编辑:来自 Logcat 的帖子
DEBUG/TAG(2901): stop Discovery
ERROR/BluetoothEventLoop.cpp(98): event_filter: Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/2664/hci0
ERROR/BluetoothService.cpp(98): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
INFO/DTUN_CLNT(2664): Client calling DTUN_METHOD_DM_START_DISCOVERY (id 2)
INFO/(2649): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 4354
INFO/(2649): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_START_DISCOVERY (id 2), len 0