sforkowany z mirror/meshtastic-android
fix an autobug
https://console.firebase.google.com/project/meshutil/crashlytics/app/android:com.geeksville.mesh/issues/5777c66e7f3bb28bd2257c5685d9ec68?time=last-seven-days&sessionEventKey=5F7255AB03A80001161E65680B592F8D_14560993878647131431.2-legacy
rodzic
819185a852
commit
25ccba9ab7
|
@ -6,7 +6,6 @@ import android.app.PendingIntent
|
|||
import android.bluetooth.BluetoothDevice
|
||||
import android.bluetooth.BluetoothDevice.BOND_BONDED
|
||||
import android.bluetooth.BluetoothDevice.BOND_BONDING
|
||||
import android.bluetooth.BluetoothManager
|
||||
import android.bluetooth.le.*
|
||||
import android.companion.AssociationRequest
|
||||
import android.companion.BluetoothDeviceFilter
|
||||
|
@ -658,9 +657,13 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
// The device the user is already paired with is offline currently, still show it
|
||||
// it in the list, but greyed out
|
||||
if (!hasShownOurDevice) {
|
||||
if (scanModel.selectedBluetooth != null && adapter != null && adapter.isEnabled) {
|
||||
// Note: we pull this into a tempvar, because otherwise some other thread can change selectedAddress after our null check
|
||||
// and before use
|
||||
val bleAddr = scanModel.selectedBluetooth
|
||||
|
||||
if (bleAddr != null && adapter != null && adapter.isEnabled) {
|
||||
val bDevice =
|
||||
adapter.getRemoteDevice(scanModel.selectedBluetooth)
|
||||
adapter.getRemoteDevice(bleAddr)
|
||||
if (bDevice.name != null) { // ignore nodes that node have a name, that means we've lost them since they appeared
|
||||
val curDevice = BTScanModel.DeviceListEntry(
|
||||
bDevice.name,
|
||||
|
|
Ładowanie…
Reference in New Issue