Support A-GPS for Qualcomm devices
Qualcomm-based modems such as in the PinePhone (Pro), OnePlus6, SHIFT6mq, Xiaomi POCOPHONE F1, and many other Qualcomm based devices in postmarketOS provide a QMI Location Interface to retrieve GNSS locations and allow injecting A-GPS data. All of this is supported through ModemManager. GeoClue supports GNSS location retrieval from ModemManager but without injecting A-GPS data, the latter is crucial for a fast GNSS fix. Therefore, the idea it to implement GNSS support in gnss-share for ModemManager with A-GPS support, the following parts are needed:
ModemManager interface
- Need to keep track of available modems
- Location interface availability: only available when SIM is inserted, but we need just to check if the interface is available on DBus, ModemManager will expose it when it is available.
NMEA positions
- Enable GPS NMEA mode in ModemManager for the modem: Modem-Location.Setup. Do not enable A-GPS MSB/MSA options as we use XTRA.
- Listen to DBus locationChanged signal from ModemManager (I think GeoClue uses this approach as opposed to polling). However, for security reasons (see docs), we should better use GetLocation and retrieve it every X seconds.
A-GPS
- Check if XTRA (Qualcomm's A-GPS) is supported via ModemManager: Modem-Location.SupportedAssistanceData
- Retrieve available A-GPS data URLs from ModemManager: Modem-Location.AssistanceDataServers
- Pick an url and download the A-GPS data.
- Send the A-GPS data over DBus to ModemManager which will take care of injecting the data: Modem-Location.InjectAssistanceData
Privacy
- Can we allow users to opt-out?
- Can we overwrite the data servers from within the config? So if that one is defined, skip the location servers from ModemManager.
- Can we mirror this A-GPS data so we can strip out individual calls from devices to the data servers? Use this one as default.
Conflicts
The eg25-manager already tries to do this on the PinePhone, but that feature should be disabled during testing by editing its config:
[gnss]
enabled = false # Set this to false
url = "https://xtrapath4.izatcloud.net"
file = "xtra2.bin"
CC: @craftyguy