use population density for coarse locations - #423
Open
soupslurpr wants to merge 6 commits into
Open
Conversation
This was referenced Aug 6, 2026
Replace AOSP's asynchronous density-result cache with location-specific queries at LocationFudger's synchronous boundary. Keep provider Binder calls asynchronous and bound each wait to 100 ms. Do not retain provider answers.
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.
soupslurpr
force-pushed
the
population-density-provider
branch
from
August 10, 2026 11:20
8542977 to
93f61e5
Compare
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 AOSP's density-result cache and fixed-grid fallback with location-specific queries. Keep AOSP's asynchronous AIDL and callback path, bridging each query with a bounded 100 ms wait at
LocationFudger's existing synchronous delivery boundary. Do not use the default-level path or a static fallback.Quantize query coordinates, trust only provider-returned S2 levels, and derive output cells locally. The proxy does not retain completed provider answers. Suppress a fix when the provider is unavailable, fails, changes binding, or times out. Keep streaming and current-location registrations after suppressed real fixes so transient failures can recover on a later delivery.
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 the completed oldest-to-newest prefix when its deadline is reached, correct the S2 edge table, and synchronize offset reads, updates, resets, and cache invalidation.Testing:
m checkapi FrameworksMockingServicesTests NetworkLocation NetworkLocationTests NetworkLocationPopulationDensityColdStartTestsFrameworksMockingServicesTestsclasses: 129 passedRelated repository: GrapheneOS/platform_external_population-density.
Related changes: