Skip to content

feat(android): VIN-driven Tesla enrollment UX (4/4) - #213

Merged
wpmed92 merged 2 commits into
mainfrom
feat/tesla-vin-enrollment
Aug 27, 2026
Merged

feat(android): VIN-driven Tesla enrollment UX (4/4)#213
wpmed92 merged 2 commits into
mainfrom
feat/tesla-vin-enrollment

Conversation

@dkneeland

Copy link
Copy Markdown
Collaborator

Part 4 of 4 (top) of a stacked series that supersedes #201 (closed; work redistributed across this stack). Base is the Tesla BLE core (layer 3).

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

Top of the stack: merging this PR can land the entire series at once; bottom-up partial merges are also supported.

@dkneeland dkneeland closed this Aug 26, 2026
@dkneeland
dkneeland force-pushed the feat/tesla-vin-enrollment branch from 315e018 to d5a6647 Compare August 26, 2026 15:43
@dkneeland dkneeland reopened this Aug 26, 2026
@wpmed92
wpmed92 force-pushed the feat/tesla-vin-enrollment branch from cc75f48 to b916e90 Compare August 27, 2026 07:51
@wpmed92
wpmed92 force-pushed the feat/tesla-vin-enrollment branch from b916e90 to 5a95bdf Compare August 27, 2026 09:08
Base automatically changed from feat/tesla-ble-core to main August 27, 2026 09:38
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.
@wpmed92
wpmed92 force-pushed the feat/tesla-vin-enrollment branch from 5a95bdf to d47d3c1 Compare August 27, 2026 09:38
@wpmed92
wpmed92 merged commit 75b7102 into main Aug 27, 2026
2 checks passed
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.

2 participants