App 2.33.0: set the drive mode from Settings, only in P at a standstill

The owner lifted the read-only rule for the drive mode alone. Settings
has Eco, Normal, Sport, Snow and Custom; the lit button is what the car
reports. A tap reads gear and speed fresh and writes only in P at 0 km/h
(DriveModeWrite, unit-tested; unreadable is a refusal), through a CPM-only
write behind EVHardware's standstill gate, then reads the mode back and
says what the car reports. The wide layout's charging price joined the
battery card so the page still fits. Not tried on the car.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
2026-10-25 20:02:53 +01:00
co-authored by Claude Opus 5.5
parent 703bdfd2a3
commit ce2ebd7f58
15 changed files with 268 additions and 12 deletions
+14
View File
@@ -138,6 +138,20 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does *
confirmed car facts, app structure, UI conventions, build/test/ship, documents. It replaces
upstream's EVABRPUploader text. The test emulator is now in the flake: `nix run .#car-emulator`
(Android 9 AOSP at 1920×720, 160 dpi; the car build installs as the system user — checked).
- 2026-10-25 — App 2.33.0 (branch `styles-retro-future`): **drive mode from Settings**, the first
vehicle setting the app writes. The owner lifted rule 3 for the drive mode only (AGENTS.md).
A card at the top of Settings' second column: Eco, Normal, Sport, Snow, Custom (codes 2, 3, 4,
6, 7 at `0x2140A17C`; the 2.32.0 recording read 2, Eco). The lit button is the mode the car
reports, from every 0.2 s reading. A tap reads gear and speed fresh and writes only in P at
0 km/h (`DriveModeWrite`, pure and unit-tested; unreadable gear or speed is a refusal), through
the new `EVHardware.writeDriveModeProperty`: the CarPropertyManager write behind
`VehicleWriteGate` (0 km/h, supported firmware), without `setDriveMode`'s fallback binder
transaction. Then the mode is read back for up to 3 s, and the status beside the title says
what the car reports ("set", "not applied: the car still reports …", "could not be read
back"). One change at a time, on the settings thread; each attempt goes to logcat. To fit the
page, the wide layout's charging price row moved into the battery card ("Battery and charging
price"). Emulator: the card fits, a tap is refused (no gear or speed there). Whether the car
takes the write at all is untested: the first try on the car decides.
- 2026-10-25 — App 2.32.1 (branch `styles-retro-future`): the cruise control work ends. The ACC
recording of 2.32.0 (ACC set to 101, 90 and 80 km/h, a car ahead) found nothing: see "Signals
the car does not provide". Removed: `CruiseLog` and its section on the Logs tab, and in