diff --git a/app/src/main/java/com/idormy/sms/forwarder/service/BluetoothScanService.kt b/app/src/main/java/com/idormy/sms/forwarder/service/BluetoothScanService.kt index b21eff0f..e327cb6c 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/service/BluetoothScanService.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/service/BluetoothScanService.kt @@ -11,6 +11,7 @@ import com.idormy.sms.forwarder.utils.ACTION_RESTART import com.idormy.sms.forwarder.utils.ACTION_START import com.idormy.sms.forwarder.utils.ACTION_STOP import com.idormy.sms.forwarder.utils.Log +import com.idormy.sms.forwarder.utils.task.TaskUtils @Suppress("PrivatePropertyName", "DEPRECATION") class BluetoothScanService : Service() { @@ -47,6 +48,8 @@ class BluetoothScanService : Service() { return } if (isRunning) return + // 清空已发现设备 + TaskUtils.discoveredDevices = mutableMapOf() bluetoothAdapter?.startDiscovery() isRunning = true }