-
Notifications
You must be signed in to change notification settings - Fork 26
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: keep OngoingCallService always running during call [WPB-10467] 🍒 #3302
fix: keep OngoingCallService always running during call [WPB-10467] 🍒 #3302
Conversation
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3302 +/- ##
===========================================
- Coverage 44.42% 44.42% -0.01%
===========================================
Files 453 453
Lines 15308 15299 -9
Branches 2558 2557 -1
===========================================
- Hits 6801 6797 -4
+ Misses 7791 7787 -4
+ Partials 716 715 -1
Continue to review full report in Codecov by Sentry.
|
Built wire-android-staging-compat-pr-3302.apk is available for download |
Built wire-android-dev-debug-pr-3302.apk is available for download |
This PR was automatically cherry-picked based on the following PR:
Original PR description:
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
There are some
ForegroundServiceStartNotAllowedException
crashes.Causes (Optional)
This exception happens when when trying to start foreground service while the app is not allowed to do so, like when the app is considered to be in the background. More on that here: https://developer.android.com/develop/background-work/services/foreground-services#bg-access-restrictions
Sometimes the
onStop
event is emitted with some delay, we can't really make sure that the app will fit within the allowed time, it's not clear how the system determines whether the app is still able to start foreground service or not.Solutions
Instead of starting the
OngoingCallService
only when the app goes into background, start it always when there's a new ongoing call and keep it running until it ends, so that the service is not stopped and started again when user puts app into foreground and background, so it's way less error-prone, and in that case starting foreground service should always be allowed because it happens right when the user makes an action to start or answer the call.We actually already have that logic for Android 14 upwards, because of the microphone background restrictions, so another benefit of this change is that we will have that unified for all Android versions.
Testing
Test Coverage (Optional)
How to Test
Create or join a call, the notification about ongoing call indicating that the
OngoingCallService
is running should be visible during the entire call, no matter if the app is in the background or foreground and it shouldn't crash when putting the app into background during the call.PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.