mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 11:48:24 +00:00
Both reproduce on the first page you open. Neither is visible to the build:
lint, Android Lint, the metadata compiles, the native compile and the whole
test suite are green with both present.
**Any page with a favicon killed the full-screen browser.**
`TaskDescription.Builder.setIcon(Icon)` exists from API **37**; below that the
Builder only takes a drawable resource id. We compile against 37, so it
resolves, and the guard was `SDK_INT >= TIRAMISU` — so Android 13, 14, 15 and
16 all called a method their framework does not have:
NoSuchMethodError: No virtual method setIcon(Landroid/graphics/drawable/Icon;)
at NappletBrowserActivity.updateTaskDescription(...:1186)
at BrowserChromeClient.onReceivedIcon(...:520)
The `runCatching` there wraps `setTaskDescription`, not the building, so it
caught nothing. Gated on 37; everything below keeps the deprecated
constructor, which takes the same three things and carries the bitmap anyway.
Android Lint's NewApi did not flag this, which is worth knowing: compiling
against a preview SDK makes its whole surface look available.
**Opening the pill killed the sandbox.** The chrome is now drawn by shared
composables that read `Res.string`, and those run in `:napplet`:
MissingResourceException: ... Android context is not initialized.
Compose Resources learns its Context from a ContentProvider the library
declares, and a provider is only instantiated in the process that owns it.
Three things do not work here and are worth recording so they are not retried:
a second `<provider>` element (the manifest merger keys them by
`android:name` and merges the two into one), a subclass with its own authority
(`AndroidContextProvider` is `internal` *and* final), and
`PreviewContextConfigurationEffect()`, which the exception text suggests but
which sets the Context from an effect that runs *after* composition — while
`stringRes` starts its async load during it.
What works is the pair: `android:multiprocess="true"` lets each process hold
its own instance, and acquiring the provider once in the sandbox's two
activities is the first access that makes Android create it. After that every
lookup resolves in-process, with no IPC. `multiprocess` alone is not enough —
the instance is lazy, and nothing in `:napplet` ever addresses that authority.
Verified on an SM-T220 (API 34): the full-screen browser loads a page, and the
pill opens with every string, the Tor state and the site-settings summary
rendered.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>