Fix crash when starting screen sharing during a call.#9154
Open
bmarty wants to merge 3 commits into
Open
Conversation
jmartinesp
approved these changes
Jun 24, 2026
ganfra
reviewed
Jun 24, 2026
| val notificationId = clock.epochMillis().toInt() | ||
| val notification = notificationUtils.buildScreenSharingNotification() | ||
| startForegroundCompat(notificationId, notification) | ||
| startForegroundCompat( |
Member
There was a problem hiding this comment.
Why not using ServiceCompat.startForeground?
Member
Author
There was a problem hiding this comment.
Oh yes, and this is fixing some other potential issues: 13fdb03
ElementBot
reviewed
Jun 24, 2026
| this, | ||
| callId.hashCode(), | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL
| this, | ||
| callId.hashCode(), | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL
| this, | ||
| callId.hashCode(), | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL
| this, | ||
| callId.hashCode(), | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL
| this, | ||
| callId.hashCode(), | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_PHONE_CALL
| this, | ||
| NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC
| this, | ||
| notificationId, | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE, |
There was a problem hiding this comment.
⚠️ Field requires API level 30 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE⚠️ Field requires API level 30 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE
| this, | ||
| notificationId, | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
| this, | ||
| FOREGROUND_SERVICE_NOTIFICATION_ID, | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_LOCATION⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_LOCATION
| this, | ||
| notificationId, | ||
| notification, | ||
| ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC, |
There was a problem hiding this comment.
⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC⚠️ Field requires API level 29 (current min is 21):android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Content
Fix crash when user wants to share the screen during a call
Motivation and context
Closes #9153
Screenshots / GIFs
Tests
Tested devices
Checklist