From dcdc437efa152efb32d5f78f6588fe9cd84f6691 Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Sun, 6 Sep 2026 22:16:55 +0200 Subject: [PATCH] The brace that closed nothing took the car screens with it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CarStrings' placeholder pattern escaped its opening brace and left the closing one bare. Desktop java.util.regex reads a lone "}" as a literal; Android compiles through ICU, which refuses it. So the companion object threw PatternSyntaxException the first time anything touched it, which is VaultScreen's constructor, which is every car screen there is — the host bound the service, the app died, and the head unit sat black with nothing in the log but a clean bind. i18n.dart, which this is the twin of, escapes both. Do the same. Co-Authored-By: Claude Opus 5 --- .../main/kotlin/com/drivervault/phoneapp/car/CarStrings.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Phone App/android/app/src/main/kotlin/com/drivervault/phoneapp/car/CarStrings.kt b/Phone App/android/app/src/main/kotlin/com/drivervault/phoneapp/car/CarStrings.kt index eab198e..fd97a9f 100644 --- a/Phone App/android/app/src/main/kotlin/com/drivervault/phoneapp/car/CarStrings.kt +++ b/Phone App/android/app/src/main/kotlin/com/drivervault/phoneapp/car/CarStrings.kt @@ -40,7 +40,12 @@ class CarStrings private constructor( companion object { private const val BASE = "en" - private val PLACEHOLDER = Regex("""\{(\w+)}""") + // Both braces escaped, as in i18n.dart's twin of this pattern. + // Android compiles regexes through ICU rather than java.util.regex, + // and ICU refuses a closing brace that opens no quantifier — a lone + // "}" here throws PatternSyntaxException the first time CarStrings + // is touched, which on a head unit is a screen that never draws. + private val PLACEHOLDER = Regex("""\{(\w+)\}""") /** Loads the files for the account's language, falling back to English. */ fun of(context: Context): CarStrings {