Skip to content

TwilightService: use low power location while network provider is enabled - #477

Draft
cameronaaron wants to merge 1 commit into
GrapheneOS:17from
cameronaaron:twilight-low-power-with-network
Draft

cameronaaron wants to merge 1 commit into
GrapheneOS:17from
cameronaaron:twilight-low-power-with-network

Conversation

@cameronaaron

Copy link
Copy Markdown

Closes GrapheneOS/os-issue-tracker#8884

TwilightService registers the default location request, which is BALANCED. With the GNSS usage policy restored in ae077bd, the fused provider enables GPS for any request better than LOW_POWER, so a sunset to sunrise schedule keeps a GNSS session started the whole time it's enabled.

This requests LOW_POWER while the network provider is enabled so it's served by network location only. The network provider is still present when disabled, so LOW_POWER would get no updates at all in that case; it keeps BALANCED then and re-registers on PROVIDERS_CHANGED_ACTION for the network provider.

Also removes the "low power, max 1h, min 10m" comment, which didn't match the request.

…bled

TwilightService registered the default location request, which is balanced
quality, and the GrapheneOS fused provider policy uses GNSS for any request
better than low power. Enabling a sunset to sunrise schedule kept a GNSS
session started for as long as the schedule was on, only to compute
sunrise and sunset times.

Request low power quality while the network provider is enabled so the fused
provider serves it from network location alone. Network location is disabled
by default, and the network provider stays registered while disabled, so a
low power request would then get no updates at all; keep balanced quality in
that case and update the request when the network provider is enabled or
disabled.

Also drop the stale "low power, max 1h, min 10m" comment, which described
neither the old nor the new request.

Fixes: GrapheneOS/os-issue-tracker#8884
@cameronaaron
cameronaaron marked this pull request as draft October 27, 2026 05:54

@Salad6239 Salad6239 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone merge this please? It would fix my issue with battery drain while using sunset/surise feature.

@cameronaaron

Copy link
Copy Markdown
Author

Can someone merge this please? It would fix my issue with battery drain while using sunset/surise feature.

No it's not even ready

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.

TwilightService's request should use LOW_POWER quality

2 participants