diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java index a356a20ad5..78c31f3275 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java @@ -232,7 +232,13 @@ final class KMKeyboard extends WebView { getSettings().setUseWideViewPort(true); getSettings().setLoadWithOverviewMode(true); - if (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) { + + // When `.isTestMode() == true`, the setWebContentsDebuggingEnabled method is not available + // and thus will trigger unit-test failures. + if (!KMManager.isTestMode() && ( + (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 || + KMManager.getTier(null) != KMManager.Tier.STABLE + )) { // Enable debugging of WebView via adb. Not used during unit tests // Refer: https://developer.chrome.com/docs/devtools/remote-debugging/webviews/#configure_webviews_for_debugging setWebContentsDebuggingEnabled(true);