Target SDK 28 so the WebView accepts CSS hex-alpha colours (fixes #84) - #110
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withtargetSdk = 24the 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).minSdkstays 24.android:usesCleartextTraffic="true"is already declared, so plain-http HA URLs keep working under targetSdk 28.CSS.supports("color", "#0000")flips totrue, plainha-buttons andha-cardborders 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.🤖 Generated with Claude Code