Modern Apps git

← MAOS.git

maos: point GNSS SUPL/PSDS at MAOS servers

Commit
6b3c2204462cfb7c1285383f5f4bd929cfda9f50
Author
Vayun Mathur <[email protected]>
When
2026-11-16 17:53 UTC (19 days ago)
Parents
17e60a7
Repoint the GrapheneOS-mode GNSS servers in frameworks/base (GnssConfiguration) from GrapheneOS to MAOS, applied as a build-time patch like the other GrapheneOS-source customizations (new patches/frameworks_base_gnss_servers.patch, wired into apply_maos_patches in build-maos.sh after frameworks_base.patch). GnssConfiguration.java is pristine GrapheneOS in the tree and frameworks_base.patch does not touch it, so a separate patch follows the networkstack_* precedent. A hardcoded Java host cannot be overridden by RRO.

SUPL (SUPL_SERVER_GRAPHENEOS_PROXY case): supl.grapheneos.org -> supl.maproj.org, port unchanged at 7275. Owner action: a TLS-terminating SUPL proxy must run on supl.maproj.org:7275 before MAOS-mode SUPL works.

PSDS (PSDS_SERVER_GRAPHENEOS case): https://<type>.psds.grapheneos.org<path> -> https://static.maproj.org/psds/<type><path>, i.e. the R2 bucket 'static' served at static.maproj.org with objects laid out psds/<type><original path> (psdsType is broadcom/samsung/mediatek per the adevtool GosOverlay config_gnssPsdsType). A mirror pipeline populating that layout is being built in parallel. Until it exists, MAOS-mode PSDS downloads 404.

STANDARD and DISABLED modes for both SUPL and PSDS are untouched, as are the Settings strings (settings.patch already labels these modes 'MAOS servers'; the SUPL_SERVER_GRAPHENEOS_PROXY / PSDS_SERVER_GRAPHENEOS case names are kept). Log lines now say MAOS proxy/server.

Docs: IMPLEMENTATION_README.md/README.md do not enumerate GNSS service hosts (only ota.maproj.org), so no doc update, matching the captive-portal/private-DNS commits.

No other supl/psds grapheneos.org references exist in the tree (git grep over frameworks/base plus rg over device/vendor/hardware/frameworks/packages/system found only these two lines). config_gnssParameters is empty by default and no gps.conf is present in the synced device trees (Pixel vendor config arrives via adevtool); vendor PSDS URLs stay in place and are only rewritten at runtime in MAOS mode, which is exactly this override.

Verified without a full OS build: git apply --check against the pristine file passes and --reverse --check passes after applying (the idempotency probe apply_maos_patches uses). javac (jdk21, android-37.1 android.jar) on patched vs pristine gives the identical 31-error profile, all missing internal packages/symbols (android.ext.settings, com.android.internal.*, libcore.io) with zero syntax errors, since no built services intermediates exist in out/ for a real targeted compile.

Diff

build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 4f1b721..a0fc881 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -271,6 +271,7 @@ apply_maos_patches() {     }     for spec in "build/make:platform_build.patch" "vendor/adevtool:adevtool.patch" \                 "frameworks/base:frameworks_base.patch" \+                "frameworks/base:frameworks_base_gnss_servers.patch" \                 "frameworks/opt/telephony:frameworks_opt_telephony.patch" \                 "packages/modules/Permission:permission_roles.patch" \                 "frameworks/libs/systemui:frameworks_libs_systemui.patch" \
patches/frameworks_base_gnss_servers.patch
diff --git a/patches/frameworks_base_gnss_servers.patch b/patches/frameworks_base_gnss_servers.patchnew file mode 100644index 0000000..1e1710a--- /dev/null+++ b/patches/frameworks_base_gnss_servers.patch@@ -0,0 +1,40 @@+diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java+index b8cd56bf0466..416d2f2e15dc 100644+--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java++++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java+@@ -535,8 +535,10 @@ public class GnssConfiguration {+                 props.remove(CONFIG_SUPL_PORT);+                 break;+             case GnssSettings.SUPL_SERVER_GRAPHENEOS_PROXY:+-                Slog.d(TAG, "SUPL: using the GrapheneOS proxy");+-                props.setProperty(CONFIG_SUPL_HOST, "supl.grapheneos.org");++                // MAOS: self-hosted SUPL proxy. A TLS-terminating proxy will run on++                // supl.maproj.org:7275 (same port as the GrapheneOS proxy it replaces).++                Slog.d(TAG, "SUPL: using the MAOS proxy");++                props.setProperty(CONFIG_SUPL_HOST, "supl.maproj.org");+                 props.setProperty(CONFIG_SUPL_PORT, "7275");+                 break;+         }+@@ -558,8 +560,11 @@ public class GnssConfiguration {+ +         switch (psdsMode) {+             case GnssSettings.PSDS_SERVER_GRAPHENEOS:+-                final String hostname = psdsType + ".psds.grapheneos.org";+-                Slog.d(TAG, "PSDS: using GrapheneOS server " + hostname);++                // MAOS: self-hosted PSDS mirror on the static R2 bucket, laid out as++                // psds/<type><original path> (e.g. psds/broadcom/...), replacing the++                // <type>.psds.grapheneos.org host. STANDARD/DISABLED modes are untouched.++                final String baseUrl = "https://static.maproj.org/psds/" + psdsType;++                Slog.d(TAG, "PSDS: using MAOS server " + baseUrl);+ +                 for (String propName : getPsdsPropNames()) {+                     String origValue = props.getProperty(propName);+@@ -578,7 +583,7 @@ public class GnssConfiguration {+ +                     final URL url;+                     try {+-                        url = new URL("https", hostname, origUrl.getFile());++                        url = new URL(baseUrl + origUrl.getFile());+                     } catch (MalformedURLException e) {+                         throw new IllegalStateException(e);+                     }