Commit graph

139 commits

Author SHA1 Message Date
Jorge Martin Espinosa
17dfd18f5d
Display error dialog if Element Call can't be joined (#4919) 2025-06-25 08:43:29 +02:00
Benoit Marty
52ad634504 Remove default param for Avatar.avatarType 2025-06-23 21:36:53 +02:00
bmarty
78def8a6e7 Sync Strings from Localazy 2025-06-16 00:31:39 +00:00
Jorge Martin Espinosa
c598b0699e
Disable BT audio devices for Element Call on Android < 12 (#4876)
Display an error dialog muting the call when a bluetooth audio device is selected on Android 11 or lower, re-enable the audio once another device is used.
2025-06-13 16:29:07 +02:00
Benoit Marty
770e16d0e0
Merge pull request #4861 from element-hq/feature/bma/doc
Add documentation on WebViewPipController
2025-06-11 16:24:22 +02:00
ganfra
2eda54d264
Merge pull request #4855 from element-hq/feature/fga/deps_rust_sdk_25.06.10
deps (matrix rust sdk) : bump version to 25.06.10
2025-06-10 17:08:57 +02:00
Jorge Martin Espinosa
39aa7500de
Element Call: add delay before selecting the default audio device (#4854) 2025-06-10 16:17:05 +02:00
ganfra
77f6cab1a7 deps (matrix rust sdk) : bump version to 25.06.10 2025-06-10 16:01:20 +02:00
Jorge Martin Espinosa
f224fe5c3b
Fix crash when using Element Call on API <= 30 (#4847) 2025-06-09 17:48:37 +02:00
Jorge Martin Espinosa
c156fd58bd
Element Call: Add audio output selector handled by Android (#4663)
- Add onUrlLoaded callback to WebViewWidgetMessageInterceptor
- Add WebViewAudioManager component and use it instead of the AudioManager extension functions
- Enable controlling the audio devices in Element Call from the OS instead of automatically detecting them
- Simplify the window flags in ElementCallActivity
- Work around the issue where the default audio device wasn't using the right audio stream
- Add onAudioPlaybackStarted, use it to start the audio-device related logic
2025-06-09 09:12:53 +02:00
Jorge Martin Espinosa
3ba11db282
Add extra logs the 'send call notification' flow (#4819) 2025-06-05 13:34:45 +02:00
Benoit Marty
5f191d9f9c
Fix coroutine scope (#4820)
* Inject the session scope instead of the application scope where it's possible.

* Create AppCoroutineScope annotation to let developers explicitly choose the appropriate CoroutineScope when injecting one.
2025-06-04 15:33:51 +00:00
Jorge Martin Espinosa
efdc10e60a
Add catchingExceptions method to replace runCatching (#4797)
- Add `runCatchingExceptions` and `mapCatchingExceptions` to replace `runCatching` and `mapCatching`.
- Make `tryOrNull { ... }` catch only exceptions too.
- Apply the changes to the whole project.
- Add new Rust fakes for tests to handle the code that's now unblocked - previously it just threw an `UnsatisfiedLinkError` which we ignored.
- Add a new `detekt-rules` project with a `RunCatchingRule` to prevent `runCatching` and `mapCatching` usages.
2025-06-04 09:02:26 +02:00
ElementBot
e8f29a38bf
Sync Strings (#4775) 2025-05-30 08:47:39 +00:00
Benoit Marty
4572419ed2
Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
Benoit Marty
ae2bcda9e8 Add documentation on WebViewPipController 2025-05-27 11:23:56 +02:00
Jorge Martin Espinosa
9b9d75aa5f
Add ActiveRoomsHolder to manage the active rooms for a session (#4758) 2025-05-26 11:03:55 +00:00
Benoit Marty
0255111528
Improve audio focus management (#4707)
* Extract Audio focus management to its own modules.

* Request Audio focus when playing a voice message.

* Add missing dependency.
(and remove a duplicated one)

* Request Audio focus when playing a video/audio in the media viewer.

* Pause audio when audio focus is lost.

* Rename class

* Fix tests

* Fix detekt issue.

* Audio focus: let the system handle automatic ducking when playing media.

* Document and update API

* Remove useless space.
2025-05-13 09:54:58 +00:00
Benoit Marty
0beec202a5
Ensure that the Rust room is not closed while the driver needs it. (#4694) 2025-05-08 09:33:35 +02:00
Jorge Martin Espinosa
1904c98c9a
Make sure any JoinedRustRoom is destroyed after use (#4678) 2025-05-05 16:09:07 +02:00
ElementBot
847f8fcbf6
Sync Strings from Localazy (#4648)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-28 10:59:35 +02:00
Benoit Marty
f6fe5fda35
Cleanup element call and UI (#4641)
* Use ElementTheme.colors.bgCanvasDefault instead of MaterialTheme.colorScheme.background

Even if the value is the same, we should use color from ElementTheme.

* Remove background management of ElementCallActivity. It does not work as expected and also changing theme during a call would require to load the url again with the new theme.

* Do not use isSystemInDarkTheme() directly.

* Use bgSubtleSecondary for background color of Preview.

* Use default colors for Preview.

* Fix copy paste issue.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-25 17:30:54 +02:00
Benoit Marty
add03ab33a
Render caller avatar on Incoming call screen (#4635)
* Ensure that the image loader is set, else the IncomingCallActivity will not be able to render the avatar.

Fixes #4633

* Add background color to OnboardingBackground

Fixes #4629

* Trigger CI
2025-04-24 21:32:46 +00:00
Jorge Martin Espinosa
619aa6f2de
Split MatrixRoom into BaseRoom and JoinedRoom (#4561)
`JoinedRoom` will now contain both a mandatory live timeline reference and all the functionality associated to it.

`BaseRoom` on the other hand will contain only functionality that's shared for both joined and not joined rooms.

`NotJoinedRoom` is a wrapper around `RoomPreviewInfo` data and a possible local `BaseRoom`, if it exists.

The `RustRoomFactory` cache is now gone since the persistent event cache should have the same effect.
2025-04-23 15:53:40 +02:00
Jorge Martin Espinosa
3b35d96e1a
Fix ringing calls not stopping when the other user cancels the call (#4613)
* Fix ringing calls not being automatically canceled

This will keep the sync active while the user is screening an incoming call, allowing receiving a call cancellation event, which will terminate the incoming call ringing early.

* Add extra logs to help debugging ringing call issues.
2025-04-22 11:30:10 +00:00
Benoit Marty
bacfa09916
[a11y] Make more items focusable (#4605)
* Fix settings entry point not available when there is no avatar on the account. Fixes #4599.

* Use Ktx extension `String.toUri()`

* Allow screen reader to focus on the user avatar to allow editing it.

* Fix import order
2025-04-22 08:50:50 +02:00
Benoit Marty
dc64d9cf74
Merge commit from fork
* Check validity of Element Call url host.

* Prepare release 25.04.2
2025-04-17 11:39:38 +02:00
Benoit Marty
be1c9b793b
Fix audio output selection for Element Call (#4602)
* Fix audio output selection.

* Ensure that Element Call audio output uses a new connected device, even during a call.
Also add a few logs.

* Extract functions.

* Add more log and protect from crash.

* Revert formatting change

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-17 10:36:42 +02:00
ElementBot
d9bfcc6c52
Sync Strings (#4590)
* Sync Strings from Localazy

* Fix strings usage after some were moved

* Fix Norwegian string that was causing lint to fail

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-04-14 11:24:28 +02:00
Jorge Martin Espinosa
a6d7741a60
Use in-call volume and mode for EC, allow external audio devices (#4481)
* Use in-call volume and mode for EC:
* Try routing audio to external device
* Place speaker before earpiece in list of audio devices
2025-04-11 16:46:51 +02:00
Jorge Martin Espinosa
2e191de343
Add WakeLock to dismiss ringing call screen when call is cancelled (#4478)
* Add `WakeLock` to dismiss ringing call screen when call is cancelled

We had already some checks in place to automatically cancel a ringing call notification/screen when the call was no longer active, but the `RoomInfo` updates weren't being processed because the app was 'paused'.

The partial wakelock should ensure these room info updates are handled.

* Add mutual exclusion to `ActiveCallManager` methods to improve thread safety
2025-04-02 09:51:39 +00:00
Jorge Martin Espinosa
ba626fc173
Use embedded version of Element Call (#4470)
* Use embedded version of Element Call: for in-app room calls, the app will use an embedded version of Element Call shipped with the app instead of using an external service.

* Remove `ElementCallBaseUrlProvider` so we don't use the Element well known file to get the base URL anymore

* Remove `ElementCallConfig.DEFAULT_BASE_URL` since it's not used anymore

* Restore the usage of the custom EC base URL in developer settings as the actual base URL, it present

* Add a way to customise the embedded EC analytic credentials

* Update CI to use the EC analytic credentials as secrets

* Improve the custom URL placeholder to include the `/room` suffix
2025-03-26 09:35:21 +01:00
Jorge Martin Espinosa
fccd881b1f
Update SDK version to 25.03.13 and fix breaking changes (#4406)
Breaking changes addressed:
* Make `MatrixClient.getNotificationSettings()` async, cache its result.
* Use `RoomInfo` for accessing the updated room's info.
* Refactor `MatrixRoom` so it always receives an initial `MatrixRoomInfo` value: this value will be used to make `MatrixRoom.roomInfoFlow` a `StateFlow` so we can assume the initial updated Room data will be present.
* Fetch encryption state when loading a room if it's unknown
2025-03-19 12:52:57 +01:00
Benoit Marty
44b837a6bd
Merge pull request #4378 from element-hq/feature/bma/customSuperButton
Be able to correctly render the UI with other colors.
2025-03-11 09:26:54 +01:00
Benoit Marty
7f59cebe2c Provide buildMeta in IncomingCallActivity. 2025-03-10 14:26:30 +01:00
Benoit Marty
96683850ba Change LocalIsEnterpriseBuild to LocalBuildMeta 2025-03-10 11:08:50 +01:00
bmarty
9a75f40855 Sync Strings from Localazy 2025-03-10 00:28:38 +00:00
Benoit Marty
6459e3cabd Rename ic_notification_small to ic_notification 2025-03-07 14:21:09 +01:00
Benoit Marty
0c35ad7834
Merge pull request #4297 from robintown/ec-close
Show error screens in group calls
2025-03-06 16:22:24 +01:00
Benoit Marty
a70249769d Migrate to coil3 2025-03-03 12:30:26 +01:00
bmarty
46acf414c1 Sync Strings from Localazy 2025-03-03 00:29:16 +00:00
Jorge Martin Espinosa
f029c4dd09
Use Settings.System.DEFAULT_RINGTONE_URI for ringing notifications (#4310)
* Use `Settings.System.DEFAULT_RINGTONE_URI` for ringing notifications

This replaces `RingtoneManager.getActualDefaultRingtoneUri`, it should get the same audio file and avoid some reported issues about not having permission to load the audio file.
2025-02-27 12:57:43 +00:00
Benoit Marty
420b6135d2 Change CompoundIcons.VoiceCall to CompoundIcons.VoiceCallSolid 2025-02-26 18:49:22 +01:00
Robin
cf57927310 Show error screens in group calls
Element Call now sends a 'close' widget action when the widget is ready to close. Usually this will be sent immediately after the 'hangup' action, but it could be sent later if the widget wants to present an error screen before closing. So by listening to the 'close' action rather than the 'hangup' action, we get to see these error screens.
2025-02-23 20:16:52 +07:00
bmarty
f549e7bba2 Sync Strings from Localazy 2025-02-17 00:30:17 +00:00
Benoit Marty
5456f0e38e
Merge pull request #4226 from element-hq/feature/bma/themeOverride
Theme override
2025-02-06 16:48:16 +01:00
Jorge Martin Espinosa
3c87fb05b2
Create SyncOrchestrator (#4176)
* Create `SyncOrchestrator` to centralise the sync start/stop flow through the whole app: the decision is based on several inputs: sync state, network available, app in foreground, app in call, app needing to sync an event for a notification.

* Make network monitor return network connectivity status, not internet connectivity

* Don't stop the `SyncService` when network connection is lost, let it fail instead. This prevents an issue when using the offline mode of the SDK, which made the wrong UI states to be shown when the `SyncState` is `Idle` (that is, after the service being manually stopped).

* Rename `NetworkStatus.Online/Offline` to `Connected/Disconnected` so they're not easily mistaken with internet connectivity instead
2025-02-06 16:36:57 +01:00
Benoit Marty
1654f569a0 Add ability to EnterpriseService to override theme colors 2025-02-06 15:10:14 +01:00
Benoit Marty
7878f97453 Update incoming call notification content to "📹 Incoming call" 2025-02-04 16:20:53 +01:00
Benoit Marty
f84aa03605 Enable Offline mode of the SyncService, so that the sync starts automatically when the network is back.
Also rely on the sync state to render the "Offline" banner.
2025-02-03 18:27:32 +01:00