Skip to content

feat(android): VIN-driven Tesla enrollment UX (3/3) - #208

Closed
dkneeland wants to merge 1 commit into
feat/tesla-ble-corefrom
feat/tesla-vin-enrollment
Closed

feat(android): VIN-driven Tesla enrollment UX (3/3)#208
dkneeland wants to merge 1 commit into
feat/tesla-ble-corefrom
feat/tesla-vin-enrollment

Conversation

@dkneeland

Copy link
Copy Markdown
Collaborator

Part 3 of 3 of a stacked series that supersedes #201 (closed; work redistributed across this stack). Stacks on Parts 1–2.

What & why

VIN-driven Tesla enrollment UX replacing manual VIN entry and nearby-car discovery:

  • New TeslaEnrollmentController state machine owns discovery, provisioning, timeouts, retries, and VIN-dependent transitions:
    CheckingFirmware → WaitingForVin → FindingVehicle(maskedVin) → Provisioning → ReadyToConnect → Connecting → WaitingForKeyCard → Success / Error(retryable)
    Composables render state and dispatch actions only.
  • Automatic staging: matching advertisement found ⇒ CMD_PROVISION with DashKit VIN + matched address; waits for Staged. The explicit Connect action remains before key enrollment (Charging Manager role + key-card requirement explained in-UI).
  • No manual VIN field, no soft keyboard, no "stage anyway" path, no background nearby-car scans; tile shows simple not-connected state until setup starts. Masked display only (Tesla · VIN ••••1234).
  • Bounded VIN / scan timeouts with actionable errors: unsupported firmware (update DashKit), VIN unavailable (wake vehicle / update firmware), no matching advertisement, provisioning not acknowledged.
  • Basic phone-to-DashKit onboarding is not gated on VIN availability.
  • Strings updated for removed flows; kotlinx-coroutines-test added for controller tests.

Tests

Controller state-machine tests (firmware unsupported, missing VIN never provisions, dispatch-is-not-ack, staged-before-connect, timeouts) and tile tests. Full testDebugUnitTest green at carve time. Final tree verified identical to the pre-split working state.

Follow-ups

On-device validation matrix from the plan doc remains (real DashKit + Tesla: asleep→awake, legacy/modern advertisements, reconnect storms, logcat/persistence audit). Firmware version gating currently feature-detects service presence; version-bump-based gating lands with the firmware release (dashkit-firmware#59).

Stack & merge order

Merge after Parts 1 and 2. Click Update branch after Part 2 merges (base retargets to main) so the diff collapses to just this PR's changes, then squash-merge.

Replace manual VIN entry and nearby-car discovery with a VIN-driven
enrollment flow:

- TeslaEnrollmentController state machine: firmware check, wait for
  VIN, VIN-matched scan, automatic provisioning, explicit Connect
  consent, key-card pairing states, bounded timeouts with actionable
  errors (unsupported firmware, VIN unavailable, vehicle not found)
- TeslaEnrollFlow renders controller state; no soft keyboard, no
  staging confirmation beat
- Home/Settings Tesla tile entry points; reset-pending plumbing;
  masked VIN display only (Tesla - VIN ****1234)
- kotlinx-coroutines-test for controller tests

Requires DashKit firmware with Tesla app-channel + VIN forwarding.
@dkneeland

Copy link
Copy Markdown
Collaborator Author

Re-created as top layer of the re-layered stack: see the successor PR (opened alongside this closure).

@dkneeland dkneeland closed this Aug 25, 2026
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