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

ElementCall: allow user to switch to another call. #3833

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Nov 7, 2024

Content

When the user is in a call, starting (or joining) another call had no effect.

With the change in this PR, if the Activity get a new Intent with other call data, the current call is terminated and the new call starts. Actually the Activity is recreated as it was way simpler than trying to update all the internal state.

Motivation and context

Same behavior than on the iOS app.

Screenshots / GIFs

Tests

  • In room A start a call
  • Enter pip mode
  • Navigate to room B
  • In room B start a call

Call A should be terminated and Call B should be started

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner November 7, 2024 17:37
@bmarty bmarty requested review from jmartinesp and removed request for a team November 7, 2024 17:37
} else if (currentCallType == null) {
Timber.tag(loggerTag).d("Set the call type and create the presenter")
webViewTarget.value = callType
presenter = presenterFactory.create(callType!!, this)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly i had to use !! here, the compiler is not clever enough (or is it me?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also explicitly add && callType != null to the if clause.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but callType != null is always true in this case, so I think it's worse.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems more descriptive to me, but I don't really mind 🤷‍♂️ .

Copy link
Contributor

github-actions bot commented Nov 7, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/YHG5Do

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.

Project coverage is 82.99%. Comparing base (2386350) to head (d09df1b).
Report is 14 commits behind head on develop.

Files with missing lines Patch % Lines
...droid/features/call/impl/ui/ElementCallActivity.kt 5.55% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3833      +/-   ##
===========================================
- Coverage    83.00%   82.99%   -0.02%     
===========================================
  Files         1782     1782              
  Lines        44860    44873      +13     
  Branches      5265     5267       +2     
===========================================
+ Hits         37237    37242       +5     
- Misses        5789     5795       +6     
- Partials      1834     1836       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Nov 7, 2024
Copy link

sonarcloud bot commented Nov 8, 2024

@bmarty bmarty merged commit 64b1f30 into develop Nov 8, 2024
24 of 26 checks passed
@bmarty bmarty deleted the feature/bma/elementCallSwitch branch November 8, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants