The brace that closed nothing took the car screens with it
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
6393543bf5
commit
dcdc437efa
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user