Fix calls on Huawei devices: skip addWebMessageListener on Chromium < 119#6640
Conversation
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
|
I have read the CLA Document and I hereby sign the CLA |
jmartinesp
left a comment
There was a problem hiding this comment.
Thanks, the feature still works well in a device not affected by the issue. It would be nice to double check with some other affected user if this fixes their problems, but I guess the EC PR needs to be merged and integrated first.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6640 +/- ##
===========================================
+ Coverage 81.18% 81.24% +0.05%
===========================================
Files 2626 2626
Lines 73165 76940 +3775
Branches 9487 9493 +6
===========================================
+ Hits 59400 62509 +3109
- Misses 10281 10948 +667
+ Partials 3484 3483 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Can confirm that applying this fix as well as element-hq/element-call#3905 fix problems with calling on Huawei devices (tested at least on two different phones). Thanks a lot! |
Какую версию сейчас можно использовать? |
Until these two fixes are merged into the main branch you can clone repositories and compile them manually: firstly, patch element-call and publish it to the local maven repository under some version like I can share my built APKs with you, but use them at your own risk: I am just a stranger from the Internet, and you don't have to trust my APKs as they can contain backdoors and etc (I'm not a bad guy, I just tell you to be cautious). Ideally, you can use these APKs on some non-production matrix server with two demo accounts just to test that this fix works and then compile Element X by yourself or wait until this fix will be merged and released. |
jmartinesp
left a comment
There was a problem hiding this comment.
Approving this since I could confirm the 'normal' scenario works as expected and some affected users have confirmed this fixes the issue for them when applied with another fix in the Element Call side.
* Try generating landscape screenshots again * Update screenshots * Use `WindowSizeClass` instead of just checking portrait/landscape orientation * Use `Devices.PHONE` directly in the landscape preview * test: stabilize reply event ID test for voice message composer * Update dependency io.element.android:element-call-embedded to v0.19.1 * Update dependency androidx.annotation:annotation-jvm to v1.10.0 * Update dependency org.matrix.rustcomponents:sdk-android to v26.04.15 (element-hq#6595) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update nschloe/action-cached-lfs-checkout action to v1.2.5 (element-hq#6600) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update live location shares when reaching timeout (before actual stop event) * Use "Shared live location" in formatter * Fix formatting * Fix loading initial items of non-live timelines (element-hq#6598) This was done automatically by the SDK in the past by returning a `Reset` timeline update, but this behaviour changed and now we have to do it. * cleaning: Remove join button from call notify timelineItemView * Setting version for the release 26.04.3 * Adding fastlane file for version 26.04.3 * Update screenshots * Changelog for version 26.04.3 * Update actions/github-script action to v9 * Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.11.0 (element-hq#6605) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.google.firebase:firebase-bom to v34.12.0 (element-hq#6604) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Settings UI update. - Reorder items - Minor UI update - Improve the previews of the Composable - Merge manage account and manage devices - Add missing tests * Update screenshots * review: pass the RtcNotificationContent in the view to avoid casting * Natural media viewer swiping order (element-hq#6431) * fixup: missing param * Replace `rustls-platform-verifier-android.aar` with single class (element-hq#6610) * Replace the `rustls-platform-verifier-android.aar` with the actual source code * Exclude the platform-verifier code from linters * Add manual update instructions * Exclude from Kover too * Live location : ensure it's not sorted randomly * Update screenshots * Fix test after new property in LiveLocationShare * Update peter-evans/create-pull-request action to v8.1.1 * audio: Let EC decide alone what communication device to use * enforce selecting the EC preferred device * fix: proximity sensor was wrongly disabled * Merge pull request element-hq#6614 from element-hq/renovate/actions-upload-artifact-7.x Update actions/upload-artifact action to v7.0.1 * Update plugin dependencycheck to v12.2.1 (element-hq#6621) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Restore comment on StaticMapView * Fix crash when going back to threads list (element-hq#6620) * Fix crash when going back to threads list * Cleanup FetchPushForegroundService (element-hq#6577) * Rename `PushHandlingWakeLock` to `FetchPushForegroundServiceManager`. Move the start/stop logic from `FetchPushForegroundService.Companion` to it. * Add more tests using Robolectric. * Remove `FeatureFlags.SyncNotificationsWithWorkManager` and associated code: this should have been removed in one of the previous refactors, since we don't have the 2 ways to sync notifications anymore, everything uses the `WorkManager` --------- Co-authored-by: Benoit Marty <benoit@matrix.org> * Sync Strings (element-hq#6626) * Sync Strings from Localazy * Use the previous plurals as plain strings * Add extra case for 1 vs multiple users * Update screenshots --------- Co-authored-by: Jorge Martín <jorgem@element.io> * Update dependencyAnalysis to v3.7.0 (element-hq#6616) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix test compilation * review: Make call intent not optional in content * Introduce `simplePluralStringResource` methods, as Composable and in `StringProvider`. * Update screenshots * Update deactivate account wording. Closes element-hq#6608 * Update screenshots * Updates to new features and some refactoring. (element-hq#6591) * Updates to new features and some refactoring. * Update CONTRIBUTING.md * Typo fixes. * Some final touches. * Update the table of contents in `CONTRIBUTING.md` --------- Co-authored-by: bxdxnn <267911624+bxdxnn@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Use new `action_delete` and `action_delete_account` * Fix media viewer bottom sheets not being scrollable (element-hq#6631) Both the info and confirm deletion bottom sheets were not scrollable, which made them useless on devices with low resolution or landscape orientation in most devices * devx: fix build sdk script options for macos * `MediaViewerEvents` -> `MediaViewerEvent` * Update dependency org.matrix.rustcomponents:sdk-android to v26.04.21 (element-hq#6635) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add flag for automatic back pagination feature * MediaViewer: add Share action as a main action. * MediaViewer: add Save action as a main action. * Setting version for the release 26.04.4 * Adding fastlane file for version 26.04.4 * Add flag for automatic back pagination feature (element-hq#6637) * MediaDetailsBottomSheet: update wording and dividers. * Setting version for the release 26.04.4 * Adding fastlane file for version 26.04.4 * Changelog for version 26.04.4 * Update dependency io.nlopez.compose.rules:detekt to v0.5.7 * Move "Open with" action to bottom sheet * `MediaGalleryEvents` -> `MediaGalleryEvent` * Improve and add test * Remove some dividers. * Add more preview for MediaDetailsBottomSheetPreview * Update screenshots * Rename sub classes of MediaBottomSheetState and improve preview of MediaDeleteConfirmationBottomSheet * Improve rendering when sender does not have a display name. * Update screenshots * Remove distributed tracing of the 'timeline loading' flow (element-hq#6644) * Remove distributed tracing of the 'timeline loading' flow. This is causing crashes in the app when a debug SDK build is used * Discourage using the APIs related with distributed tracing, explaining the problem * Update zizmorcore/zizmor-action action to v0.5.3 (element-hq#6630) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency io.sentry:sentry-android to v8.38.0 (element-hq#6597) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update camera to v1.6.0 (element-hq#6514) * fix(deps): update camera to v1.6.0 * Add dependency to com.google.guava:guava to fix compilation issue. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benoit Marty <benoit@matrix.org> * MediaDetailsBottomSheet: iterate on design. Closes element-hq#6645 * MediaDetailsBottomSheet: Add missing preview case. * Update screenshots * Set max lines for 'in reply to' view conditionally (element-hq#6612) * Set max lines for 'in reply to' view conditionally. When there is enough screen space, use 2 lines as before. If the screen space is limited, use a single one. * Reduce vertical padding for reply-to view in compose * Add screenshot test with single line in reply to view * Update screenshots --------- Co-authored-by: ElementBot <android@element.io> * Promote "history sharing on invite" out of developer options (element-hq#6647) * Enable history sharing by default, unconditionally * Remove feature-flag dep from history viz icons in room header * Remove feature-flag dep from warning on inviting new people * Remove feature-flag dep from warning on starting chat with new people * Remove `enableKeyShareOnInvite` feature flag * Update screenshots * Remove redundant `FakeFeatureFlagService()` invocation, per review comment --------- Co-authored-by: ElementBot <android@element.io> * PR:Fix mention pill cut off (element-hq#6622) * Fix mention pill cut off * trigger CI after screenshots * trigger CI after screenshots * Update dependency io.sentry:sentry-android to v8.39.1 (element-hq#6648) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Replace " - " by " • " as it renders better. * Update screenshots * MediaDetailsBottomSheet: update wording. * Update screenshots * a11y: add heading to the title. * Ensure preview has a date * Update screenshots * Merge pull request element-hq#6658 from element-hq/sync-localazy Sync Strings * Update dependency org.jsoup:jsoup to v1.22.2 * RoomListDeclineInviteMenu: limit room name Improve preview. Closes element-hq#6659 * Ensure that all the ModalBottomSheet can scroll. * Update screenshots * Rename Preview. * Preview the whole bottom sheet. * Remove obsolete comment. * Update screenshots * Element Call: remove support for SPA call links. Closes element-hq#6578 * `CallScreenEvents` -> `CallScreenEvent` * `PictureInPictureEvents` -> `PictureInPictureEvent` * Use test extension on presenters. * Update dependency io.element.android:element-call-embedded to v0.19.2 (element-hq#6662) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Strip formatting from media captions in room summary * Update dependencyAnalysis to v3.9.0 (element-hq#6657) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * [Link new device] Implement code confirmation screen. * Update error mappings for Link new device * Update screenshots * Fix record screenshots action permissions (element-hq#6679) * Update dependency org.matrix.rustcomponents:sdk-android to v26.04.27 (element-hq#6666) * Update dependency org.matrix.rustcomponents:sdk-android to v26.04.27 * Fix breaking API changes: - OIDC components are now prefixed `OAuth`. - `Room.startLiveLocationShare` now returns the event id of the beacon state event if it succeeds. - `RoomInfo` now contains an `activeServiceMembersCount` property. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Improve detection of completion for Link new device flow The SDK emits a Done progress once complete, but our listener might have been deallocated before receiving the done. * Delint * Fix quality issues and formatting * [Link new device] Add missing screen for the error case `OtherDeviceAlreadySignedIn` Closes element-hq#6678 * Increase title and subtitle vertical padding on FlowStepPage. * Rename `OIDC` components and variables to `OAuth` (element-hq#6686) * Rename `OIDC` components and variables to `OAuth`. This matches the new behavior in the SDK. * Update screenshots * Remove legacy `mx-reply` from `toPlainText` formatted event contents (element-hq#6683) * Fix tests Co-Authored-By: Benoit Marty <3940906+bmarty@users.noreply.github.com> * Change native back button behavior in EC view (close settings in EC with os native back) (element-hq#6642) * Change native back button behavior in EC view: - inject escape into webview instead of going back. - the webview will call back when no other modal is open. * call down and up in the webview + make sure that we fall back to close pip in case the webview did not handle the esc action. --------- Co-authored-by: Jorge Martín <jorgem@element.io> * Update dependency io.sentry:sentry-android to v8.40.0 * Update dependency androidx.compose:compose-bom to v2026.04.01 * Add a way to tweak MAS url. * Fix tests. * Add a CacheStore module. * Add a cache for Element .well-known file. * Fix compilation issue. * Do not use generic Exception * Fix SQL query * Ensure clearing the cache delete the CacheStore. * In the module `:libraries:matrix.api`, change the dependencies to: - libraries.sessionStorage.api - projects.libraries.architecture from `api` to `implementation`. Modules who need `:libraries:matrix.api` do not necessarily need to use the session storage api. * Cleanup dependencies * Fix ANRs when receiving push notifications (element-hq#6696) In Sentry there are some reports of methods called when notifications are fetched that end up having ANRs. This looked weird because everything is asynchronous... but it's still running with a `Main` dispatcher. Using the `Default/computation` one instead should be the right call. * Update kotlin * a11y: add alternative text to the info icon. Closes element-hq#6379 * a11y: let section header be implemented as a heading. Closes element-hq#6386 * a11y: let banner title be implemented as a heading. Closes element-hq#6384 * a11y: set role = button for "learn more" texts. Closes element-hq#6405 * a11y: use different content description when the red dot is displayed Closes element-hq#6395 * Remove unused content parameter. * Remove useless Box * Declare Top bar first and use zIndex. * a11y: do not use Overlay if screen reader is active, or external keyboard is connected. Related to element-hq#6399 * Move isTalkbackActive to a11y package. * Improve how the ThumbnailView is added to the composition * Improve MediaViewerBottomBar usage. * MediaViewerView: move TopBar to Scaffold topbar * MediaPlayerControllerView: Use IconButton instead of Box and remove the clipping. * Update screenshots * Fix quality issues * Update kotlin version * Mitigate a deadlock when loading room timelines (element-hq#6674) This may be happening because we were not destroying focused event timelines used for the media viewer/gallery when necessary, and having several of those back paginating *may* have caused a deadlock in the event cache. * Migrate to v2 testing APIs * Fix compilation issue * Update AppDeveloperSettingsView.kt Fix 2 x Crash the app Fixes element-hq#6707 * Sync Strings from Localazy * Update dependency io.nlopez.compose.rules:detekt to v0.5.8 (element-hq#6711) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.posthog:posthog-android to v3.43.0 (element-hq#6704) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix calls on Huawei devices: skip addWebMessageListener on Chromium < 119 (element-hq#6640) * Fix calls on Huawei: skip addWebMessageListener on Chromium < 119 * Fix lint issues, log webview version --------- Co-authored-by: manfrommedan <manfrommedan@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Let our Json parser accept comments and trailing comma. * Update dependency org.matrix.rustcomponents:sdk-android to v26.05.4 (element-hq#6718) * Update dependency org.matrix.rustcomponents:sdk-android to v26.05.4 * Fix `RoomInfo` fixture --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Add clipping to RoomSummaryRow * Merge pull request element-hq#6722 from element-hq/renovate/roborazzi Update roborazzi to v1.60.0 * Rename methods around verification, to match SDK naming. * Allow cancelling room loading in Home screen (element-hq#6723) Previously, this was disabled by mistake, since it's the default behavior. * Revert PR element-hq#6642 (element-hq#6724) * Revert "Change native back button behavior in EC view (close settings in EC with os native back) (element-hq#6642)" This reverts commit 6ba4679. * Fix API breaks from revert * Improve FakeSessionVerificationService * Reimplement "Natural media viewer swiping order" (element-hq#6715) * Update dependency net.zetetic:sqlcipher-android to v4.15.0 * Detekt and ktlint are confused with Kotlin context... * Fix low width image message (element-hq#6692) * fix low width image message * added previews for narrow images * Update screenshots --------- Co-authored-by: ElementBot <android@element.io> * Update dependency org.maplibre.gl:android-sdk to v13.1.0 * Make icons in the Chat screen top bar 16dp (element-hq#6733) * Make icons in the Chat screen top bar 16dp. This matches the designs in Figma. * Fix the padding between the title and the icons * Update screenshots --------- Co-authored-by: ElementBot <android@element.io> * Fix back button sometimes not working after exiting a thread (element-hq#6732) When I reproduced the issue, it looked like the coroutine used to mark as read and then exit the room was canceled, leaving the `markingAsReadAndExiting` variable with `true` value and preventing the exit block from running again. * Update dependency org.matrix.rustcomponents:sdk-android to v26.05.6 (element-hq#6734) * Update dependency org.matrix.rustcomponents:sdk-android to v26.05.6 * Fix API breaks: - Add `RoomMember.isServiceMember`. - Add `beacon` and `beaconInfo` power levels. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Use 'Report a problem' string instead of 'Report bug' (element-hq#6735) * Use 'Report a problem' instead of 'Report bug'. This old string will be deleted soon. * Update screenshots --------- Co-authored-by: ElementBot <android@element.io> * Remove RoomDirectorySearch feature flag — always enable the feature (element-hq#6736) * Remove RoomDirectorySearch feature flag, always enable the feature Co-authored-by: stefanceriu <637564+stefanceriu@users.noreply.github.com> * Apply ktlint formatting Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com> * Update screenshots --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stefanceriu <637564+stefanceriu@users.noreply.github.com> Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com> Co-authored-by: ElementBot <android@element.io> * Create PreviewData with sample of UGC used for preview. Fix preview issue where username was used for room/avatar name. * Update ref to submodule. * Fix invalid userId. * Update screenshots * Update dependencyAnalysis to v3.10.0 (element-hq#6742) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * More replacements * Use generic id for default * More replacements * Update screenshots * Make send event state UI easier to click (element-hq#6739) * Make send event state UI easier to click Make it so the whole timestamp view can be clicked * Update screenshots * Simplify `clickableModifier` --------- Co-authored-by: ElementBot <android@element.io> * Fix test * Remove trailing spaces * Update tspascoal/get-user-teams-membership action to v4 (element-hq#6747) * Update tspascoal/get-user-teams-membership action to v4 * Point the commit to the right tag v4.0.0 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io> * Setting version for the release 26.05.0 * Adding fastlane file for version 26.05.0 * Merge upstream: accept all upstream code paths Systematically updated all non-Iltix modules from upstream: - ALL libraries/*/api and libraries/*/impl directories - ALL features/*/api and features/*/impl directories - Excludes: iltix/, appicon/iltix/, and Iltix-specific code This ensures API consistency across the codebase and resolves: - OAuth/OIDC naming conflicts - ModalBottomSheet scrollable parameter changes - Matrix SDK integration updates - Test framework modernization (Compose UI tests) - Auto-generated screenshot test conflicts - Localization file synchronization Result: Clean, consistent merge with zero Iltix module modifications. --------- Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: ElementBot <android@element.io> Co-authored-by: Benoit Marty <benoitm@element.io> Co-authored-by: Gianluca Iavicoli <gianluca.iavicoli04@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ganfra <francoisg@element.io> Co-authored-by: Valere <bill.carson@valrsoft.com> Co-authored-by: Benoit Marty <benoit@matrix.org> Co-authored-by: bxdxnn <267911624+bxdxnn@users.noreply.github.com> Co-authored-by: ganfra <francoisg@matrix.org> Co-authored-by: ElementBot <110224175+ElementBot@users.noreply.github.com> Co-authored-by: Valere Fedronic <valeref@matrix.org> Co-authored-by: mxandreas <andreass@element.io> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: Kurban Sagitov <58472509+krbns@users.noreply.github.com> Co-authored-by: Hugh Nimmo-Smith <hughns@element.io> Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com> Co-authored-by: Benoit Marty <3940906+bmarty@users.noreply.github.com> Co-authored-by: Timo <16718859+toger5@users.noreply.github.com> Co-authored-by: Benoit Marty <benoitm@matrix.org> Co-authored-by: Strac Consulting Engineers Pty Ltd <preminik@preminik.com> Co-authored-by: Hi Dude! <klarkmonty@tuta.io> Co-authored-by: manfrommedan <manfrommedan@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: stefanceriu <637564+stefanceriu@users.noreply.github.com> Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>
|
After testing Element X for Android v26.05.0, it appears this issue has not yet been resolved; the problem persists on Android devices exactly as it did before. |
|
MR on the element-call side has not been merged yet, and it is also required to fix calls on Huawei. |
Problem
Calls do not work on Huawei and other devices with system WebView based on Chromium < 119. The call screen shows "Join as guest" instead of the call UI.
Huawei WebView reports
WEB_MESSAGE_LISTENERas supported viaWebViewFeature.isFeatureSupported(), but silently drops messages sent throughaddWebMessageListener. This is a known issue across the Android ecosystem. Capacitor, Home Assistant, Flutter InAppWebView and Tauri have all documented workarounds for Huawei WebView (see ionic-team/capacitor#6555, ionic-team/capacitor#6258).Huawei does not allow users to change the WebView provider on their devices.
Fix
addJavascriptInterfaceunconditionally as the baseline message channel (works on all WebView implementations)addWebMessageListenerwhen the WebView is based on Chromium 119+, where it is known to work reliablyaddWebMessageListenertakes priority (same behavior as before)addJavascriptInterfaceis used, avoiding the brokenaddWebMessageListenerNote
There is a second issue affecting these devices: Element Call JS bundle uses
Promise.withResolvers(Chrome 119+), which causes the ES module to silently fail on older WebViews. A polyfill fix for that has been submitted to Element Call: element-hq/element-call#3905Test plan
compileDebugKotlinpasses, fullassembleDebugpassesRelated: #6632