RL: prevent crash when BT is OFF
This commit is contained in:
parent
fd9d676b92
commit
55ddf6ae42
1 changed files with 2 additions and 1 deletions
|
@ -214,6 +214,7 @@ class RileyLinkBLEConfigActivity : NoSplashAppCompatActivity() {
|
|||
private fun stopLeDeviceScan() {
|
||||
if (scanning) {
|
||||
scanning = false
|
||||
if (bluetoothAdapter?.isEnabled == true && bluetoothAdapter?.state == BluetoothAdapter.STATE_ON)
|
||||
bleScanner?.stopScan(bleScanCallback)
|
||||
aapsLogger.debug(LTag.PUMPBTCOMM, "stopLeDeviceScan: Scanning Stop")
|
||||
Toast.makeText(this, R.string.riley_link_ble_config_scan_finished, Toast.LENGTH_SHORT).show()
|
||||
|
|
Loading…
Reference in a new issue