ground-android
ground-android copied to clipboard
Only trigger permission dialog for capture location when user arrives on the task.
trafficstars
Fixes #2388
Prevents the location permission dialog from being shown too early (see issue for explanation), by only triggering early when the user has already given permission, and otherwise waiting to trigger the dialog until the user has arrived at the capture location task.
- [x] Adds a new flow property,
enableLocationLockFlow, that keeps track of three states:
- whether the location lock has already been enabled
- whether the location lock needs to be enabled
- whether to actually enable the location lock
- [x] If permission was already given, the existing behavior of starting the location lock early is preserved.
- [x] If permission was not given, then the request to turn on location lock is deferred to when the task is resumed or the user hits "Capture" if they declined the permission.
- [x] Created survey with a text task before a capture location task. Verified that turning off permission does not trigger the permission early, and triggers when the user arrives on the task.
- [x] Verified that already having the permission replicates the existing behavior.
- [x] Verified in offline mode as well.
No permission dialog:
Shown when clicking Next:
If declined, and also clicking "Capture" after declining the first time:
PTAL @gino-m @shobhitagarwal1612 !