Skip to content

Target SDK 28 so the WebView accepts CSS hex-alpha colours (fixes #84) - #110

Merged
RapierXbox merged 2 commits into
RapierXbox:mainfrom
WiesiDeluxe:fix/targetsdk-28
Sep 22, 2026
Merged

RapierXbox merged 2 commits into
RapierXbox:mainfrom
WiesiDeluxe:fix/targetsdk-28

Conversation

@WiesiDeluxe

Copy link
Copy Markdown

Fixes #84.

Chromium's WebView only turns on CSS hex-alpha colours (#rgba / #rrggbbaa) for apps that target Android P or newer (android_webview/.../AwContents.java: if (mAppTargetSdkVersion >= P) mSettings.setCssHexAlphaColorEnabled(true)). Home Assistant's frontend (2026.7+) minifies every colour with alpha to that form (transparent → #0000, the default card border → #e1e1e11f), so with targetSdk = 24 the WebView drops those declarations: solid card outlines and solid discs behind icons – on every Wall Display, regardless of the installed WebView version. Details and the A/B measurement (X2 with targetSdk 28 vs. XL with 24, same HA 2026.9.3) are in #84 (comment).

  • minSdk stays 24.
  • android:usesCleartextTraffic="true" is already declared, so plain-http HA URLs keep working under targetSdk 28.
  • Tested as a re-packaged 3.26230.0834 on a Wall Display X2 (Android 8.1): CSS.supports("color", "#0000") flips to true, plain ha-buttons and ha-card borders render like on desktop; no behavioural regressions seen so far (kiosk app, always foreground). Happy to test a signed build on the XL (Android 11) too.

Note: this branch is stacked on #105's commit (disable XNNPACK/NNAPI). main currently doesn't compile – 3d13d7f uses Build.VERSION.SDK_INT in WakeWordDetector.java without importing android.os.Build (error: package Build does not exist) – and the #105 change removes that code. Merge the #105 PR first and this one reduces to the single-line targetSdk change.

🤖 Generated with Claude Code

WiesiDeluxe and others added 2 commits September 22, 2026 12:42
…rXbox#105)

Any TFLite inference on live audio crashed the app on the 32-bit Wall
Displays (X2/PEGASUS on Android 8.1 and Gen1/STARGATE on Android 7):
SIGSEGV at libtensorflowlite_jni.so+0x1f9b68, XNNPACK's
qs8_gemm_minmax 4x8 aarch32 NEON kernel, called with a garbage input
pointer (0x14). TFLite enables the XNNPACK delegate by default, so the
NNAPI-only change did not reach that code path.

With XNNPACK off the segfault is gone, but on the X2 (API 27) the NNAPI
runtime then leaks a memory mapping per execution
(/proc/<pid>/maps grows ~7000 entries per 20 s) until it hits
vm.max_map_count and pthread_create fails:
"thread constructor failed: Try again" in
android::nn::StepExecutor::startComputeOnCpu.

The wake word and VAD models are 52 KB / 34 KB; the built-in int8 CPU
kernels handle them with ~40 % of one core on a quad A7, so neither
delegate is needed. Verified on both 32-bit devices (wake word detected
and answered end to end, stable for hours) and on the arm64 XL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…x#84)

Chromium's WebView only enables CSSHexAlphaColor for apps targeting
Android P or newer (android_webview AwContents.java). Home Assistant's
frontend (2026.7+) minifies every colour with alpha to 4/8-digit hex
(`transparent` -> `#0000`, card border -> `#e1e1e11f`), so with
targetSdk 24 those declarations are dropped: solid card outlines and
solid discs behind icons on every Wall Display, regardless of the
installed WebView version.

minSdk stays 24. usesCleartextTraffic="true" is already declared, so
plain-http HA URLs keep working with targetSdk 28.

Verified on a Wall Display X2 (Android 8.1, WebView 128): with
targetSdk 28 CSS.supports("color", "#0000") is true and plain buttons /
card borders render as on desktop; the XL (Android 11, WebView 131,
targetSdk 24) renders them solid.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@RapierXbox
RapierXbox merged commit 49b2c1e into RapierXbox:main Sep 22, 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.

home assistant core 2026.7 bad rendering

2 participants