use population density for coarse locations - #423
Open
soupslurpr wants to merge 6 commits into
Open
Conversation
Replace the asynchronous density cache with bounded synchronous queries. Quantize provider inputs, derive output cells locally using only provider-returned levels, and share identical in-flight queries. Do not retain completed answers. Suppress provider faults instead of allowing under-coarsened results. Keep the finalized provider SystemApi signatures unchanged.
Fail closed when population density coarsening is unavailable instead of reverting to a fixed grid. Retain streaming and current-location registrations after suppressed real fixes so transient provider faults recover on a later delivery. Preserve null timeout completion for current-location requests and move the app-op note after coarsening.
Stop before each LocationResult query once the batch-wide budget is spent. Deliver the completed oldest-to-newest prefix, or fail closed when the deadline expires before the first location. Keep direct Location coarsening outside the batch deadline and cover both paths with deterministic clocks.
Bind population density only from NetworkLocation. Require the service to protect its Binder entry point with the platform bind permission. Add a permission-aware config supplier overload while preserving the existing internal call shape for other service watchers.
Restore the geometric halving sequence at levels 9 and 11. Extend the edge test across both corrected entries and their shared neighbor.
Refresh, read, and reset both random offset components under the same monitor. This preserves a consistent pair and establishes visibility for security-motivated resets.
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use population density to select S2 granularity for coarse locations. Replace the asynchronous density cache and fixed-grid fallback with bounded synchronous provider queries. Quantize query coordinates, derive output cells locally using only provider-returned levels, share identical in-flight queries without retaining completed provider answers, and fail closed when coarsening is unavailable.
Pin the provider to NetworkLocation and require its population density service to declare
android.permission.BIND_POPULATION_DENSITY_PROVIDER_SERVICEas its bind permission. Bound batch coarsening work, preserve registrations after suppressed fixes, correct the S2 edge table, and synchronize the two random offset components.Testing:
FrameworksMockingServicesTestsclasses: 136 passedCtsLocationCoarseTestCasesandCtsLocationFineTestCasesclasses: 20 passedakita cur userdebugbuild and flashRelated repository: GrapheneOS/platform_external_population-density.
Related changes: