-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): Catch WebView exceptions and prompt user to install WebView #13140
Draft
darcywong00
wants to merge
5
commits into
master
Choose a base branch
from
fix/android/check-webview
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+312
−64
Conversation
This file contains 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
Fixes: #11560 Fixes: KEYMAN-ANDROID-5E9 Fixes: KEYMAN-ANDROID-6MA
Test ResultsI tested this issue with the attached keyman "18.0.186-alpha-test-13140" build(06/02/2025) on Android 14(Samsung A23 Physical device). I'm sharing my observation here.
|
back to draft to rework the system keyboard notification. |
…/android/check-webview # Keyman Conventional Commit suggestions: # # - Link to a Sentry issue with git trailer: # Fixes: _MODULE_-_ID_ # - Give credit to co-authors: # Co-authored-by: _Name_ <_email_> # - Use imperative, present tense ('attach' not 'attaches', 'attached' etc) # - Don't include a period at the end of the title # - Always include a blank line before trailers # - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
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.
Replaces #13101
Fixes: #11560
Fixes: KEYMAN-ANDROID-5E9
Fixes: KEYMAN-ANDROID-6MA
KMManager.KMKeyboard
extendsWebView
. On systems where the system WebView is missing or disabled, this causes the constructor to throw an AndroidRuntimeException.This PR updates the areas where WebViews are used, and catches those missing WebView exceptions. Also, the "Update Chrome" banner is refactored to prompt the user to install/enable WebView or Chrome accordingly.
Since KMManager doesn't initialize, the Keyman app is in degraded functionality (no keyboard displayed)
Screenshots
Install WebView
Note: this was generated with temporary test code to make WebViewUtils.getSystemWebViewStatus report webView not installed
Enable WebView
![API 31 enable webview](https://private-user-images.githubusercontent.com/7358010/410274293-20aa4f49-1534-43dc-a5ab-93d9c06372d2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNzA0NjgsIm5iZiI6MTczOTI3MDE2OCwicGF0aCI6Ii83MzU4MDEwLzQxMDI3NDI5My0yMGFhNGY0OS0xNTM0LTQzZGMtYTVhYi05M2Q5YzA2MzcyZDIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTAzNjA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWU1MWUyMjdkYWJhMzA1ODFjNjRmZTRhNzQ0MDI4ZTk2NjA3NTU0MjY3NDM0NTJmZGM4YzQ4NDM5OTYyN2M0MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.UzAEdYrHLy_bIKN8pXBeuekipnQ2FJ_7oWuHy0qssUA)
WebView installed but has been disabled
Update Chrome
![API 21 update Chrome](https://private-user-images.githubusercontent.com/7358010/410274329-69ab82fb-7c3a-4e6e-bcaa-eb8f78dced04.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNzA0NjgsIm5iZiI6MTczOTI3MDE2OCwicGF0aCI6Ii83MzU4MDEwLzQxMDI3NDMyOS02OWFiODJmYi03YzNhLTRlNmUtYmNhYS1lYjhmNzhkY2VkMDQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTAzNjA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTBhYWRlMzkxZDRlNGMxM2RlZmY4ODE5MjE1NGQ2YzJkNTM4MWJjZDNhYzcxOGY2NGY2YjI4MDMwNTM5Y2FiNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Nmsbn_rOvrIVwNShS51_LSqpGvFsWfno8-fixltDDWY)
same as before
Additional Info on the Changes
KMManager and friends
AndroidRuntimeException
when WebView not installed and enabled. This is now caught inKMManager
MainActivity
checkChromeVersion
to prompt the user to: install WebView, enable WebView, or install ChromeSystemKeyboard
I tried, but the IME picker gets hidden by the front application. So I opted to keep the Toast notification that WebView needs to be installed
User Testing
Setup - For each test, install the PR build of Keyman for Android on an Android device/emulator.
System navigation on a modern Android device/emulator (API 31+) to enable/disable the system WebView: