mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Don't claim we have bluetooth access until the user grants location
permissions. This fixes an ugly behavior when for when the user does a from scratch install and first runs the app (and the dialog comes up to grant access). Previously we were starting our BLE scan for devices before that dialog has been approved by the user, which Android doesn't return an error for it instead just silently refuses to show devices. If the user switched away from the app and came back, we'd restart our scan and they could see their device. This fixes things so that the user doesn't have to switch away from our app once before the devices appear.
This commit is contained in:
parent
7d76f99731
commit
ca2cae7003
2 changed files with 41 additions and 10 deletions
|
|
@ -518,7 +518,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (!hasCompanionDeviceApi)
|
||||
if (!hasCompanionDeviceApi && model.bluetoothEnabled.value!!)
|
||||
scanModel.startScan()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue