Skip to content

fix(location): Use LocationManager instead of FusedLocationProviderClient#20

Open
bgweaver wants to merge 1 commit into
MaxwellDPS:mainfrom
bgweaver:main
Open

fix(location): Use LocationManager instead of FusedLocationProviderClient#20
bgweaver wants to merge 1 commit into
MaxwellDPS:mainfrom
bgweaver:main

Conversation

@bgweaver

@bgweaver bgweaver commented Jun 6, 2026

Copy link
Copy Markdown

Problem

On GrapheneOS (and other ROMs without Google Play Services), the Location
subsystem always shows Error(code=-1, message=No location available). This
is because FusedLocationProviderClient requires Play Services, which returns
null silently when unavailable.

All other subsystems (BLE, WiFi, Cellular, Satellite, GNSS) work correctly —
only the location stamping on detections was broken.

Fix

Replace FusedLocationProviderClient with Android's native LocationManager,
which works on any AOSP-based ROM without Play Services dependency.

Falls back through GPS → FUSED → NETWORK providers, and requests a single
update if no last known location is cached.

Tested on

  • Google Pixel 8
  • GrapheneOS (Android 16, API 36)
  • No Sandboxed Play Services installed

Before: Location → Error(code=-1)
After: Location → Active, detections stamped with coordinates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant