You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using GrapheneOS on a Google Pixel 8 device. By default, location services are severely limited. Only GPS location data is provided, unless you install Google Play services. More information.
As I understand it, I can take advantage of Google Play geolocation services (but in turn transmit data to Google) if I do the following:
Install sandboxed Google Play
Enable (precise) location permissions and nearby devices permission for the Google Play services app
In the Sandboxed Google Play settings > Location Accuracy, enable “Improve Location Accuracy”
In Settings > Location > Location services, enable ”Wi-Fi scanning“ (on) and “Bluetooth scanning” (on).
GPSLogger also has precise location permissions (all the time)
I did all of that, so I would assume that GPSLogger is now able to obtain a network location.
“Log GPS/GNSS locations” always works, regardless of the aforementioned steps, as expected. “Log passive locations” also seems to work. However, when I try to use “Log network locations”, GPSlogger never records a position. I checked the log, and encountered the following message:
01-25 15:52:38.449 10712 10712 D GpsLoggingService: onLocationChanged:894 - Received location, but it's not from a selected listener. Ignoring.
I am aware that this is probably a somewhat obscure issue, and might be difficult to debug without a GrapheneOS device. I will try to provide as much information as possible, and I realize that this issue is probably not the most urgent.
I have no experience in Android app development, but to me, it looks like GpsLoggingService.isFromSelectedListener discards events that are returned by the system when requesting network locations. I started a debugger and was able to obtain the following information:
When enabling network locations, this is what the resulting Location object loc looks like:
loc.mProvider == "gps", and loc.getProvider() returns gps. Obviously, this is not equal to network, so it is no surprise that isFromSelectedListener will return false. Maybe this is a weirdness of GrapheneOS due to the way location services are implemented? Let me know if it would be appropriate to create an issue with the GrapheneOS project.
I am not sure if I can confidently exclude that this location data was nevertheless determined by GNSS internally by GrapheneOS? Interestingly, mExtras specifies that LISTENER=CELL.
For comparison, this is what a proper GNSS/GPS Location looks like:
I am not sure why xDOP or the number of satellites are missing or zero. They were displayed in the other app (Network Survey) that I used to request the location data.
I am not sure if this is universally applicable, but at least in my case, the GPSlogger settings seem to align with the loc.mExtras.LISTENER value, and not loc.mProvider. Maybe it would be better to check loc.getExtras().getString(BundleConstants.LISTENER) instead?
The text was updated successfully, but these errors were encountered:
That's quite a good bit of troubleshooting and honing in on the problem, it helped me look at my codebase to see where all of this is coming from. It's an old codebase now so I need reminders and hints.
Bad news, that LISTENER field is something being added in this app, it's only there for troubleshooting but not necessarily something to rely on.
I tried to find out if there's something going on with Graphene and network, and I did find this comment:
Yes that is making the difference, the OS does not have a network location provider service integrated into the OS.
Also in so far as having a configurable network location provider the really big problem and reason they are blocked is because they can ALSO be used to lie to apps, even though your use might be "normal".
We aren't going to add support for something like UnifiedNLP into the system, which would undermine the security model, bypassing the signature enforcement model, for location providers. It is simply antithetical to the projects aims.
So assuming that statement is still true, I think the network bit might be a bit of a red herring, in that it's still actually GPS being reported and GrapheneOS is doing some kind of 'fill' to make the app think that there is a network provider. In turn that would mean that the Provider = GPS value that GrapheneOS is giving is actually correct!
I haven't used GrapheneOS in several years and unfortunately no spare device to test with. But probably it's worth trying to verify and make sure that statement is still true?
I am using GrapheneOS on a Google Pixel 8 device. By default, location services are severely limited. Only GPS location data is provided, unless you install Google Play services. More information.
As I understand it, I can take advantage of Google Play geolocation services (but in turn transmit data to Google) if I do the following:
I did all of that, so I would assume that GPSLogger is now able to obtain a network location.
“Log GPS/GNSS locations” always works, regardless of the aforementioned steps, as expected. “Log passive locations” also seems to work. However, when I try to use “Log network locations”, GPSlogger never records a position. I checked the log, and encountered the following message:
I am aware that this is probably a somewhat obscure issue, and might be difficult to debug without a GrapheneOS device. I will try to provide as much information as possible, and I realize that this issue is probably not the most urgent.
I have no experience in Android app development, but to me, it looks like
GpsLoggingService.isFromSelectedListener
discards events that are returned by the system when requesting network locations. I started a debugger and was able to obtain the following information:When enabling network locations, this is what the resulting Location object
loc
looks like:loc.mProvider == "gps"
, andloc.getProvider()
returnsgps
. Obviously, this is not equal tonetwork
, so it is no surprise thatisFromSelectedListener
will returnfalse
. Maybe this is a weirdness of GrapheneOS due to the way location services are implemented? Let me know if it would be appropriate to create an issue with the GrapheneOS project.I am not sure if I can confidently exclude that this location data was nevertheless determined by GNSS internally by GrapheneOS? Interestingly,
mExtras
specifies thatLISTENER=CELL
.For comparison, this is what a proper GNSS/GPS Location looks like:
You can see that xDOP and the number of satellites are available.
For completeness, I also had a look at passive locations. This is what
Location loc
looks like for a passive GNSS location:I am not sure why xDOP or the number of satellites are missing or zero. They were displayed in the other app (Network Survey) that I used to request the location data.
And finally, (I assume), a passive network event:
I am not sure if this is universally applicable, but at least in my case, the GPSlogger settings seem to align with the
loc.mExtras.LISTENER
value, and notloc.mProvider
. Maybe it would be better to checkloc.getExtras().getString(BundleConstants.LISTENER)
instead?The text was updated successfully, but these errors were encountered: