Skip to content

Guard Android registered location providers and transfer service refusals atomically #2205

Closed

Description

@giswqs

Two current Android location lifecycle gaps remain after the background-service work:

  1. MainActivity.onProviderDisabled checks every enabled GPS/network provider, although startLocating only registers GPS with precise permission. With approximate-only permission, disabling the requested network provider while unrequested GPS remains enabled returns early. No positions or stopped notice follow.
  2. takeEvents reads the volatile static refusal then clears it in a separate operation. A service refusal arriving between those operations can be erased without its failed event.

Track the providers actually registered, and stop/report when none of that set remains enabled. Transfer refusal reasons atomically (or under one common lock). Add tests for approximate-only/provider removal and a refusal arriving while the prior refusal is drained; validate on Android with both permission modes.

Source verified on ce40749: apps/rustgis-mobile/java/org/rustgis/mobile/MainActivity.java:315-327,464-468.

Release-sweep source discussions:

Duplicate search: all-state location provider refusal found no dedicated issue; #1902 is the broad mobile tracker. These need Android lifecycle regression coverage, beyond a wording-only sweep fix.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions