Skip to content
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 when WebView provider unavailable #13101

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Jan 31, 2025

Fixes: #11560
Fixes: KEYMAN-ANDROID-5E9
Fixes: KEYMAN-ANDROID-6MA

Keyman requires system WebView to be installed and enabled.

This updates KMManager to catch when the system WebView is not installed/enabled, and attempt to notify via Toast.

At the moment, the Toast notification doesn't appear when the system keyboard fails to initialize. I suspect there's no IME available to display the message...

User Testing

Setup - Install the PR build of Keyman for Android on an Android device/emulator.
Launch Keyman and enable as the default system keyboard. Then close the app.
Next, go to system Settings --> Apps --> expand and find "Android System WebView --> Disable.
This disables the system WebView which Keyman requires to run.

  • TEST_INAPP_KEYBOARD - Verifies inapp keyboard doesn't crash when WebView disabled
  1. Launch Keyman for Android

  2. Observe the splash screen and verify a Toast notification appears about the WebView failing
    fatal webview not enabled

  3. Verify Keyman automatically closes without errors about crashing

  • TEST_SYSTEM_KEYBOARD - Verifies system keyboard doesn't crash when WebView disabled
  1. Launch the Chrome browser and select a text field
  2. Verify Keyman system keyboard fails to appear.
  3. Verify device doesn't show errors about Keyman crashing.

Fixes: #11560
Fixes: KEYMAN-ANDROID-5E9
Fixes: KEYMAN-ANDROID-6MA

Keyman requires system WebView to be installed and enabled.

This updates KMManager to catch when the system WebView is not installed/enabled, and attempt to notify via Toast.
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Jan 31, 2025
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jan 31, 2025

User Test Results

Test specification and instructions

  • TEST_INAPP_KEYBOARD (OPEN)
  • TEST_SYSTEM_KEYBOARD (OPEN)
Results Template
# Test Results

* **TEST_INAPP_KEYBOARD (OPEN):** notes
* **TEST_SYSTEM_KEYBOARD (OPEN):** notes

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S20 milestone Jan 31, 2025
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed and removed user-test-missing User tests have not yet been defined for the PR labels Jan 31, 2025
@darcywong00
Copy link
Contributor Author

darcywong00 commented Jan 31, 2025

From Slack, @mcdurdin suggests replacing Toast with a label (more persistent)

Hmm, I think the system keyboard should have a button to 'switch to another keyboard app' (if one is available), but the in-app should just show a message that they need to enable webview.
if it is possible to launch the settings activity where the webview setting is, that'd be great

@darcywong00 darcywong00 modified the milestones: A18S20, B18S1 Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

bug(android): lack of handling when WebView provider unavailable
1 participant