You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f04733f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: recording outlives the screen that started it
The sampler ran between the activity's onStart and onStop, which made the trip
log a function of where the driver was looking. Ten minutes in the media app and
the accumulator — correctly refusing to integrate across a gap it cannot account
for — returned a trip whose distance and energy simply omitted that stretch.
TripRecordingService takes over the sampler, the trip session and the history
file; MainActivity binds to it and renders what it publishes. Sampling runs while
a dashboard is bound or a trip is recording, and the service stops itself when
neither holds, so nothing reads vehicle properties on behalf of nobody. Starting
is an intent, which is what makes it a started service and lets it outlive the
unbind; stopping is a binder call, because the dashboard is by definition on
screen when a trip can be stopped. The history append moves off the main thread,
and the shutdown waits for it rather than racing the trip the driver just ended.
The foreground type is derived from the permission actually held rather than from
the manifest, and it is specialUse: the platform's catalogue has no entry for
recording a car's own telemetry to local storage, dataSync describes sending it
somewhere this app cannot reach, and from Android 15 that type carries a daily
cap a long drive would hit. POST_NOTIFICATIONS stays undeclared — the target head
unit is API 28, where it does not exist, and a permission never requested on a
screen the driver reaches is a permission the app does not have.
Verified on the API 28 1920x720 emulator: the service exists while the dashboard
is visible, is gone within seconds of leaving it with no trip running, and
survives an activity restart without a second sampler. The recording-survives-
background path still needs a car: the emulator publishes no speed, so the
parked-gated control that starts a trip cannot be reached there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
android:value="Records the vehicle's own energy telemetry to app-private storage for the duration of a trip the driver started. No data leaves the car." />
0 commit comments