fix(android): use `WebViewAssetLoader` for loading assets on Android (address regression in 19.0.242)
This PR migrates the Android WebView from loading local files via file:// URLs to using `WebViewAssetLoader`, which serves internal storage files through a magic HTTPS domain (https://appassets.androidplatform.net). This fixes the blank keyboard problem reported in #16096 for Android.
Core pattern of the change:
```
// Before:
"file://" + context.getDir("data", ...)
+ "/" + filename
// After:
"https://appassets.androidplatform.net"
+ "/data/" + filename
```
The `WebViewAssetLoader` in `KMKeyboardWebViewClient` intercepts requests to this domain and serves files from internal storage. Since the domain is a constant, `Context` is no longer needed to construct URLs, simplifying several method signatures.
Also this PR makes `KMKeyboard.getKeyboardRoot()` private, and renames public `Keyboard.getKeyboardPath()` to private `Keyboard.getKeyboardUrl()`.
Part-of: #16096
Replaces: #16132
We use SIL EuroLatin as fallback keyboard. If that is not installed,
previously we output an error which showed up as a toast for the user.
This change now outputs a warning instead of the error for the default
keyboard.
Also changed the KeyboardHarness test app to set a different keyoard as
default.
The default fonts (DejaVueSans.ttf and keymanweb-osk.ttf) are located in
the root directory, not the package directory. This fixes the
KeyboardHarness test app.
Also some improvements with variable and function names to better match
what they do.
chore(android): allow to build FV app in docker container
Building the FirstVoices app is triggered in the top-level `build.sh` if the two environment variables are set. Previously we didn't pass these variables to Docker, so the FV app was never built even when the env variables were set. This change passes the two variables to the container, thus allowing to build the FW app in the docker container.
Building the FirstVoices app is triggered in the top-level `build.sh`
if the two environment variables are set. Previously we didn't pass
these variables to Docker, so the FV app was never built even when the
env variables were set. This change passes the two variables to the
container, thus allowing to build the FW app in the docker container.
Build-bot: skip
Test-bot: skip
maint(linux): show output of API check also in log file
Previously the output of running the API check was only shown on the summary page, but not in the log file of the step. With this change it is now also displayed in the log file.
Related: #16151
On Windows the tests failed because the AppData directory doesn't yet
exist under an allowed app internal storage path. This change creates
the directory first when running tests.
Also fix `assertEquals` in that test file - the parameter ordering is
`expected, actual` but we had it the other way round which gives a
confusing message if the test fails.
Previously the output of running the API check was only shown on the
summary page, but not in the log file of the step. With this change it
is now also displayed in the log file.
Build-bot: skip
Test-bot: skip
This bypasses any need to modify KMW keyboard loading (say, via .fetch), though it does require a number of collateral changes to be made in order for CORS, etc to be satisfied.
Build-bot: skip build:ios
Pretty much just what the title says; it's been silently missing this whole time.
This doesn't fix iOS keyboard's display by itself, but it is a prerequisite for the full solution offered by #16136.
Build-bot: skip build:ios
Test-bot: skip
This change moves to using `WebViewAssetLoader` for loading files from
the device instead of using file:// URLs. This fixes the blank keyboard
problem reported in #16096 for Android.
Also make `KMKeyboard.getKeyboardRoot()` private, and rename public
`Keyboard.getKeyboardPath()` to private `Keyboard.getKeyboardUrl()`.
Part-of: #16096
I uncovered one race, documented in the source. Not trying to resolve
that race at this time (it is not consequential). There is a second
condition which is unclear -- and may have other consequences. So report
a warning to Sentry when this arises, but do not crash out on the user.
Fixes: #11916
Test-bot: skip
* Remove Server's 'config.json' redundant user options handling
* Refactor options.ts in Server and kmc to share common cross-platform
code
* Move option defaults into common code and sync with .pas defaults
* Rename config.ts to standardPaths.ts to better represent the remaining
purpose of the module.
Fixes: #13458