From bfa33d51bd1009b26c035d87f5a7b65e7c7afc75 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Sun, 18 Oct 2026 19:50:24 +0200 Subject: [PATCH] App 2.16.2: show the car's screen size; display figures documented The MG4's display is given as 1920x720 (this project), 1280x480 (EVProfile's README) and a 1778x720 app window (upstream). 1280x480 is exactly 1920x720 px at 240 dpi expressed in dp, so the figures may describe one panel at different densities, which this platform lets be changed per app. The Logs tab's new SCREEN line shows the panel's pixels and density and the app window in px and dp, to settle it from the car. FIRMWARE.md lists the three figures and what the emulator shows at 240 dpi; mise.toml, README and SPECS.md no longer state 160 dpi as fact for the car. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki --- FIRMWARE.md | 19 +++++++++++++++++-- README.md | 2 +- SPECS.md | 5 +++++ app/build.gradle | 4 ++-- .../java/com/evsuite/abrp/MainActivity.java | 16 ++++++++++++++++ app/src/main/res/layout/pane_log.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ mise.toml | 3 ++- 8 files changed, 47 insertions(+), 6 deletions(-) diff --git a/FIRMWARE.md b/FIRMWARE.md index 5339fca..99bd678 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -11,9 +11,24 @@ development. It must not be treated as a vendor specification. | Android | 9 (Pie) — **API 28** | | Chipset | MediaTek **MT2712** | | Device | `mt2712_saic_eh32` (eh32 = MG4) | -| Display | **1920×720 @ 160 dpi** (the car's sidebar takes part of the width; an app window has been reported at 1778×720) | +| Display | Sources disagree, see below. The Logs tab's **SCREEN** line shows what the car reports. | | Emulator display profile | **1920×720 @ 160 dpi** | +**Display, unconfirmed.** Three figures are in circulation: + +- **1920×720 px**, the figure this project has used (emulator profile, layouts). +- **1280×480**, from [EVProfile's README](https://github.com/malys/EVProfile) ("forced + landscape"). That is exactly 1920×720 px at 240 dpi expressed in dp, the unit layouts use — + so it may be the same panel at a higher density. EVProfile also notes that this platform lets + the density be changed per app. +- An app window of **1778×720**, reported upstream: the car's own sidebar taking part of the + width. + +The app has worked on the car with layouts designed at 1920×720 dp, which fits 160 dpi better +than 240 (checked on the emulator: at 240 dpi the sidebar needs scrolling and the Overview's +cards no longer fit). Since 2.16.2 the Logs tab shows the panel's pixels and density and the +app window in px and dp; a photo of that line settles it. + ## Signing caveat Certificate equality alone does not prove an APK came from this project. The nightly OTA @@ -43,5 +58,5 @@ follow the same path. See `AGENTS.md` for the full per-signal split. ## Emulator fidelity The `mise` emulator tasks use an API 33 automotive AVD for the car service and an API 28 -AVD at **1920×720 @ 160 dpi** for the screen. Neither exposes the SAIC vendor properties, +AVD at **1920×720 @ 160 dpi** for the screen (see "Display, unconfirmed" above). Neither exposes the SAIC vendor properties, so vehicle-specific behaviour still requires on-vehicle validation. diff --git a/README.md b/README.md index ca21320..e222ac5 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ APIs. ## Screenshot -Version 2.8.2 on the head unit's 1920x720 screen, in full screen (Android 9 emulator; no +Version 2.8.2 at the head unit's 1920x720 pixels and 160 dpi, in full screen (Android 9 emulator; no vehicle there, so every value shows as a dash).

diff --git a/SPECS.md b/SPECS.md index 832d46f..e4e28a9 100644 --- a/SPECS.md +++ b/SPECS.md @@ -48,6 +48,7 @@ Current: app 2.14.2, server 2.5.0 (pinned by digest in `k8s/server.yaml`). dashboard queries return data). - [x] Manifests validated offline (kubeconform, with Traefik CRDs). **Applied by Nils only.** - [ ] Check Grafana's host in `k8s/ingress.yaml` (placeholder `car-grafana.k8s.stinnesbeck.com`). +- [ ] Screen size and density on the car: Logs → SCREEN (2.16.2), see FIRMWARE.md. - [ ] Not yet tried on the car: live data straight to ABRP (2.11), Enter on phone (2.12), accent colours and the car-colour probe on the Logs tab (2.14; a photo of its list decides whether the accent can follow the paint automatically), right-aligned values (2.14.1). @@ -109,6 +110,10 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does * INGEST_TOKEN) into git and pushed it. Commit amended and force-pushed; both values regenerated in the now gitignored `k8s/secrets.yaml` (since moved to `k8s/secrets/secrets.yaml`, outside `kubectl apply -f k8s/`). Filled-in secrets live only there from now on. +- 2026-10-18 — App 2.16.2: Logs → SCREEN shows the panel's pixels and density and the app + window in px and dp. The MG4's display figures disagree (1920×720 px used here; EVProfile lists + 1280×480, which is 1920×720 at 240 dpi in dp; upstream reported a 1778×720 window); FIRMWARE.md + lists all three until a photo of that line settles it. - 2026-10-18 — EVProfile's licence checked: MIT, forked from SliDeeN/MG4Control and last merged from it on 2026-08-02, inside MG4Control's MIT period (MIT up to 2.6.5 of 2026-08-05, GPL v3 from 2.6.6 of 2026-09-02). Recorded in `LICENSE.md`. History scanned for secrets before the diff --git a/app/build.gradle b/app/build.gradle index ada442d..c1329a4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { applicationId "com.stinnesbeck.nilsmg4" minSdk 27 targetSdk 36 - versionCode 85 - versionName "2.16.1" + versionCode 86 + versionName "2.16.2" // Nothing about the server ships in the APK: its URL and ingest token are entered in // the app's Server tab (ServerConfig), and the database is only reachable by the server. diff --git a/app/src/main/java/com/evsuite/abrp/MainActivity.java b/app/src/main/java/com/evsuite/abrp/MainActivity.java index 721c725..ff4e99f 100644 --- a/app/src/main/java/com/evsuite/abrp/MainActivity.java +++ b/app/src/main/java/com/evsuite/abrp/MainActivity.java @@ -263,6 +263,7 @@ public class MainActivity extends AppCompatActivity { callLogText = logPane.findViewById(R.id.call_log_text); steeringKeysText = logPane.findViewById(R.id.steering_keys_text); TextView carColorText = logPane.findViewById(R.id.car_color_text); + showScreenInfo(logPane.findViewById(R.id.screen_text)); logPane.findViewById(R.id.car_color_button).setOnClickListener(v -> new Thread(() -> { java.util.List found = CarColorProbe.run(60); String shown = found.isEmpty() ? getString(R.string.car_color_none) @@ -289,6 +290,21 @@ public class MainActivity extends AppCompatActivity { startForegroundService(new Intent(this, AbrpUploadService.class)); } + /** + * What the head unit reports about its screen, for the Logs tab: the panel in pixels and its + * density, and this app's window in pixels and in dp, which is what layouts are chosen by. + * Sources disagree on the MG4's numbers (1920×720, 1280×480, a 1778×720 window). + */ + @SuppressWarnings("deprecation") // getRealMetrics: the WindowMetrics API starts at 30; this is 28 + private void showScreenInfo(TextView view) { + android.util.DisplayMetrics panel = new android.util.DisplayMetrics(); + getWindowManager().getDefaultDisplay().getRealMetrics(panel); + android.util.DisplayMetrics window = getResources().getDisplayMetrics(); + android.content.res.Configuration config = getResources().getConfiguration(); + view.setText(getString(R.string.screen_info, panel.widthPixels, panel.heightPixels, panel.densityDpi, + window.widthPixels, window.heightPixels, config.screenWidthDp, config.screenHeightDp)); + } + private static final String STATE_PAGE = "page"; @Override diff --git a/app/src/main/res/layout/pane_log.xml b/app/src/main/res/layout/pane_log.xml index b6ba2e1..95f2da8 100644 --- a/app/src/main/res/layout/pane_log.xml +++ b/app/src/main/res/layout/pane_log.xml @@ -11,5 +11,7 @@ + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d17bf14..567cc44 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -40,6 +40,8 @@ needs a minute of data Tyre pressure unit Accent colour + SCREEN + Panel %1$d × %2$d px at %3$d dpi\nApp window %4$d × %5$d px = %6$d × %7$d dp CAR COLOUR Lists the head unit\'s settings that mention a colour, paint or car model, to find out whether the car\'s colour can be read. A photo of this list helps. Look for the car colour diff --git a/mise.toml b/mise.toml index fc2daa3..89865a6 100644 --- a/mise.toml +++ b/mise.toml @@ -56,7 +56,8 @@ BUILD_TOOLS = "36.0.0" # car build installs there as the system user.) # # None of this replaces a test on the car. -# Target density: 160 dpi. Screen 12.8" 1920x720. Reference firmware: SWI68-29958-1300R69. +# Target density: 160 dpi. Screen 1920x720 px; the density on the car is not confirmed +# (FIRMWARE.md, "Display, unconfirmed"). Reference firmware: SWI68-29958-1300R69. EMU_CAR_AVD = "evabrp-car" EMU_CAR_IMAGE = "system-images;android-33;android-automotive;x86_64"