Skip to content

Add step counter monitor to add walking detection - #1295

Merged
davecraig merged 5 commits into
Scottish-Tech-Army:mainfrom
davecraig:main
Nov 14, 2026
Merged

davecraig merged 5 commits into
Scottish-Tech-Army:mainfrom
davecraig:main

Conversation

@davecraig

Copy link
Copy Markdown
Contributor

No description provided.

davecraig and others added 3 commits November 14, 2026 12:23
Record pedometer data in travel recordings and feed it to the geoengine.
StepTracker counts the user as stepping with 4 or more steps in the last
5 s, and that is only ever positive evidence: it ends a stationary spell
straight away, lets OnFootDetector call a walk away from a vehicle once
the speed has stayed at walking pace for 5 s, and makes inMotion() true.
No steps never means standing still, so wheelchair users and phones with
no step hardware behave as before. On the shops-steps recording (a drive
to Tesco and Waitrose) getting out of the car is called 28 s sooner at
Tesco and 14 s sooner at Waitrose.

ACTIVITY_RECOGNITION is a required permission on the onboarding screen on
phones with a step sensor, and existing users are asked once at startup.
Both show the in-app disclosure Google Play requires before the system
prompt. The privacy policy gains a section on step data, and the About
page now starts with links to the privacy policy and the release notes,
which leave the main menu.

Also removes the unused BROADCAST_CLOSE_SYSTEM_DIALOGS permission and the
advertising ID permissions that Firebase Analytics brings in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
started was set true before the availability/authorization checks in
IosStepProvider.start(), so if the first snapshot() happened while
Motion permission was denied or step counting unavailable, it would
never retry even after permission was later granted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
createTextToSpeech/createEarcon allocated a handle synchronously but only
filed it into activePlayers/discreteQueue inside their dispatch_async(audioQueue)
block. CalloutController's coroutine body runs on that same serial queue with
no suspension point before its first isHandleActive check, so that check
always ran before the registration block got its turn and saw the handle as
already finished.

This made awaitHandle return instantly instead of waiting for the sound to
actually finish playing: the home-screen button's purple highlight dropped
well before the speech ended, and a second tap (meant to cancel) saw the
previous job as already non-active and started a fresh callout instead.

Track newly-allocated handles in pendingHandles until their dispatch_async
block runs, and have isHandleActive check it too, so there's no gap where
a real, in-flight handle reports as inactive.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Motion & Fitness system prompt only explained heading/compass use,
not the new step counter, and nothing in onboarding requested it at all -
CMPedometer only got authorized whenever a recording happened to call it
first, deep in normal use. Update NSMotionUsageDescription (and its
synced ios_permission_motion copy) to mention walking too, and give the
onboarding Permissions screen real per-permission rows like Android's
NavigatingScreen: each one is tapped individually to trigger its system
prompt, shows a granted/not-granted status, and Continue stays disabled
until both are granted.

Once a permission is denied, iOS won't show its system prompt again, so
a row in that state now opens Settings on tap instead of doing nothing.

Android is unaffected - it has its own native onboarding flow and never
renders this screen; the new expect/actual functions it picks up are
unreachable stubs needed only to satisfy the KMP compile.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ring

first_launch_permissions_denied is new, and ios_permission_motion changed
to mention telling when you are walking, so every language needed both.
The motion translations keep their existing wording with the walking
clause added. InfoPlist.xcstrings is regenerated from them, so the Motion
& Fitness prompt mentions walking in every language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davecraig
davecraig merged commit 1ba6c22 into Scottish-Tech-Army:main Nov 14, 2026
5 checks passed

This branch was previously deployed

1 inactive deployment
development — f73524bb Deployed Nov 14, 2026 by davecraig via Build and test iOS app #1666
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.

1 participant