GrapheneOS network location implementation is now available in the Stable channel after several rounds of fixes and improvements for it.

https://grapheneos.social/@GrapheneOS/114076777599414646

We had to fix an upstream Android system_server crash bug it uncovered along with improving sandboxed Google Play.

Our sandboxed Google Play compatibility layer reimplements the Google Play location service within apps using it based on the OS location service. This is the “Reroute location requests to the OS” toggle. Adding network location support to the OS required us to improve this code.

If you want location detection without satellite reception, you can enable this service Settings > Location > Location services > Network location with a choice between Apple’s service and our proxy to it. We’ll have our own service and then offline support in the near future.

The standard Wi-Fi scanning toggle in the Location services menu can be enabled if you want to allow Wi-Fi scanning by the network location service and other apps with the Location permission when Wi-Fi is otherwise disabled. Otherwise, it only works with Wi-Fi toggled on.

If you previously set up using sandboxed Google Play services for network location, you can switch by doing the reverse of the instructions in https://grapheneos.org/usage#sandboxed-google-play-configuration to re-enable rerouting, disable their network location and revoke the permissions you granted to it for it.

Code is available at https://github.com/GrapheneOS/platform_packages_apps_NetworkLocation if you’re curious about how it works. It has a local implementation of 3D location trilateration with RANSAC. It fills an in-memory LRU cache of up to 10000 Wi-Fi APs with 15 minute expiry. Cell towers and offline support coming soon.