每当我运行我的应用程序并关闭/打开 Wifi 连接时。该应用程序正在通过 TCP 创建套接字连接(使用 Wifi 连接)。这是我在一段时间后收到的。这甚至没有抛出任何异常来查看!
这些日志可读吗?如果是这样,有人可以指导我完成。
A/nt.ngtech.co.u: runtime.cc:558] Runtime aborting...
runtime.cc:558] Dumping all threads without appropriate locks held: thread list lock mutator lock
runtime.cc:558] All threads:
runtime.cc:558] DALVIK THREADS (59):
runtime.cc:558] "FinalizerDaemon" prio=5 tid=7 Runnable
runtime.cc:558] | group="" sCount=0 dsCount=0 flags=0 obj=0x12ec0340 self=0x777a7fb800
runtime.cc:558] | sysTid=27635 nice=4 cgrp=default sched=0/0 handle=0x7770d594f0
runtime.cc:558] | state=R schedstat=( 83892703 4272710 25 ) utm=6 stm=1 core=7 HZ=100
runtime.cc:558] | stack=0x7770c56000-0x7770c58000 stackSize=1041KB
runtime.cc:558] | held mutexes= "abort lock" "mutator lock"(shared held)
runtime.cc:558] native: #00 …Run Code Online (Sandbox Code Playgroud) 很长一段时间以来,我一直在使用 BluetoothDevice 类中的 removeBond 方法来取消设备配对。但是在大多数小米设备中,这是行不通的。
检查我正在使用的以下代码:
Set<BluetoothDevice> devices = mBluetoothAdapter.getBondedDevices();
for (BluetoothDevice device : devices) {
Log.i("DeletePairedDeviceByNm", "Found Device:" +
device.getName() + ", Looking for:" + BDName + "\n");
if ((device.getName().trim().equals(BDName.trim()))) {
Method m = device.getClass().getMethod("removeBond", (Class[]) null);
Object value=m.invoke(device, (Object[]) null);
if((boolean)value){
numberPairedDevicesDeleted++;
}
}
}
Run Code Online (Sandbox Code Playgroud)
据我所知,这是“取消配对”连接设备的唯一方法。
还有什么可以使用的吗?请向我提供一些有价值的反馈。
提前致谢!
一些经过测试的设备是: