SmartBeaconing: do not crash on background start without GPS permission

pull/304/head
Georg Lukas 2021-06-08 16:53:42 +02:00
rodzic 5844a59c75
commit 9a58e4781b
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -22,8 +22,8 @@ class SmartBeaconing(service : AprsService, prefs : PrefsWrapper) extends Locati
0, 0, this)
started = true
} catch {
case e : IllegalArgumentException =>
// this device does not have GPS. Oops.
case e @ (_: IllegalArgumentException | _: SecurityException) =>
// we lack GPS or GPS permissions
service.postAbort(service.getString(R.string.service_sm_no_gps)
+ "\n" + e.getMessage())
}