From 6eaec63df9a88377eb5ff9a1c1048f3f1f910dd8 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 14 Feb 2021 16:11:55 +0800 Subject: [PATCH] fix another autobug - don't crash if firmware update can't start --- .../main/java/com/geeksville/mesh/ui/SettingsFragment.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt index 919c4a43..874c00af 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt @@ -44,6 +44,7 @@ import com.geeksville.mesh.service.SoftwareUpdateService.Companion.ProgressNotSt import com.geeksville.mesh.service.SoftwareUpdateService.Companion.ProgressSuccess import com.geeksville.util.anonymize import com.geeksville.util.exceptionReporter +import com.geeksville.util.exceptionToSnackbar import com.google.android.gms.location.LocationRequest import com.google.android.gms.location.LocationServices import com.google.android.gms.location.LocationSettingsRequest @@ -504,8 +505,10 @@ class SettingsFragment : ScreenFragment("Settings"), Logging { binding.updateProgressBar.visibility = View.VISIBLE binding.updateProgressBar.progress = 0 // start from scratch - // We rely on our broadcast receiver to show progress as this progresses - service.startFirmwareUpdate() + exceptionToSnackbar(requireView()) { + // We rely on our broadcast receiver to show progress as this progresses + service.startFirmwareUpdate() + } } }