mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-09 19:10:51 +00:00
新增:自动任务·快捷指令 —— 触发条件:蓝牙设备(状态变化、设备发现、连接断开) #388
This commit is contained in:
parent
a4aade94c5
commit
86d0c35ea9
@ -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_START
|
||||||
import com.idormy.sms.forwarder.utils.ACTION_STOP
|
import com.idormy.sms.forwarder.utils.ACTION_STOP
|
||||||
import com.idormy.sms.forwarder.utils.Log
|
import com.idormy.sms.forwarder.utils.Log
|
||||||
|
import com.idormy.sms.forwarder.utils.task.TaskUtils
|
||||||
|
|
||||||
@Suppress("PrivatePropertyName", "DEPRECATION")
|
@Suppress("PrivatePropertyName", "DEPRECATION")
|
||||||
class BluetoothScanService : Service() {
|
class BluetoothScanService : Service() {
|
||||||
@ -47,6 +48,8 @@ class BluetoothScanService : Service() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (isRunning) return
|
if (isRunning) return
|
||||||
|
// 清空已发现设备
|
||||||
|
TaskUtils.discoveredDevices = mutableMapOf()
|
||||||
bluetoothAdapter?.startDiscovery()
|
bluetoothAdapter?.startDiscovery()
|
||||||
isRunning = true
|
isRunning = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user