mm_glib_source: Ignore error when enabling AGPS MSB

AGPS enablement sometimes timeouts on Oneplus 6.

Also improve logging of NMEA initialization errors.
This commit is contained in:
Teemu Ikonen 2023-03-17 22:19:04 +02:00
parent d6e4a71380
commit e6205bd9e5
2 changed files with 5 additions and 1 deletions

View File

@ -261,8 +261,8 @@ class SatelliteApp(Gtk.Application):
dtext = "Please unlock the Modem"
else:
fatal = isinstance(e, gi.repository.GLib.GError)
self.log_msg("Error initializing NMEA source")
etext = str(e)
self.log_msg(f"Error initializing NMEA source: {etext}")
dtext = etext if etext else (
"Could not find or initialize NMEA source")
dialog = Gtk.MessageDialog(

View File

@ -75,6 +75,10 @@ class ModemManagerGLibNmeaSource(NmeaSource):
raise ModemLockedError from e
else:
raise e
except gi.repository.GLib.GError as e:
# Ignore error on AGPS enablement by this hack
if 'agps-msb' not in str(e):
raise e
self.mlocation.set_gps_refresh_rate_sync(self.refresh_rate, None)
self.mlocation.connect('notify::location', self.update_callback)