Fix runCallServiceInForeground handling for incoming PN and non-ringing call flows#1729
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
runCallServiceInForeground handling for incoming PN and non-ringing call flows
runCallServiceInForeground handling for incoming PN and non-ringing call flowsrunCallServiceInForeground handling for incoming PN and non-ringing call flows
runCallServiceInForeground handling for incoming PN and non-ringing call flowsrunCallServiceInForeground handling for incoming PN and non-ringing call flows
WalkthroughAdds per-call-type foreground service config gating to ChangesCore SDK: Foreground Service Gating and Notification Style Refactoring
Demo App: CallServiceConfig Debug Settings UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@demo-app/src/main/kotlin/io/getstream/video/android/ui/CallSettingsUi.kt`:
- Around line 94-107: The registry snapshot is being captured once with remember
on line 94, which prevents the UI from updating when the SDK initializes or the
registry is replaced. Remove the remember wrapper around
StreamVideoInitHelper.callServiceConfigRegistry so it reads the current registry
value on each recomposition. Additionally, restructure the items state
initialization so it recomputes whenever the live registry reference changes,
ensuring that when editableCallTypes.map runs, it always pulls fresh data from
the current registry instead of a stale captured snapshot.
In
`@demo-app/src/main/kotlin/io/getstream/video/android/ui/join/CallJoinScreen.kt`:
- Around line 342-354: The Spacer component following the StreamButton is using
width(5.dp) which creates horizontal spacing, but since this Spacer is placed
inside a vertical Column layout, the gap will not be visible between stacked
elements. Replace the width-based Spacer with a height-based Spacer to create
proper vertical spacing between the StreamButton and subsequent elements in the
Column. Change the Spacer modifier from width(5.dp) to height(5.dp) to ensure
the spacing is applied correctly in the vertical layout.
In
`@demo-app/src/main/kotlin/io/getstream/video/android/util/StreamVideoInitHelper.kt`:
- Around line 133-141: The callServiceConfigRegistry property (defined around
line 133) only gets assigned on successful initialization (line 402) but is
never cleared when teardown occurs or initialization fails. This causes the
debug UI to expose a stale registry instance from a previous client. Add a null
assignment to callServiceConfigRegistry in the teardown/cleanup path and
wherever initialization fails to ensure the property only reflects the current
active client's registry state and doesn't expose outdated configuration.
In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/style/StyleProvider.kt`:
- Around line 35-43: The icon selection logic in the setIcon block only sets the
single-user icon when remoteParticipantCount equals 0, but fails to handle the
case when remoteParticipantCount equals 1, which represents a valid one-to-one
active call scenario. Modify the conditional check to include both cases by
changing the condition from checking if remoteParticipantCount == 0 to checking
if remoteParticipantCount is less than or equal to 1, so that the
stream_video_ic_user icon is properly set for both single-user and one-to-one
call scenarios.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8f719784-4253-4dbf-a9e5-03de24db00d3
📒 Files selected for processing (8)
demo-app/src/main/kotlin/io/getstream/video/android/ui/CallSettingsUi.ktdemo-app/src/main/kotlin/io/getstream/video/android/ui/join/CallJoinScreen.ktdemo-app/src/main/kotlin/io/getstream/video/android/util/StreamVideoInitHelper.ktdemo-app/src/main/res/values/strings.xmlstream-video-android-core/src/main/kotlin/io/getstream/video/android/core/CallState.ktstream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ClientState.ktstream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/handlers/StreamDefaultNotificationHandler.ktstream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/style/StyleProvider.kt
|
|
🚀 Available in v1.28.0 |


Goal
Close #AND-1250
Demo-app
Implementation
Just add a boolean check of
runCallServiceInForegroundon critical code-flows🎨 UI Changes
None
Testing
Smoke test 1-1 calls, normal calls
Summary by CodeRabbit
Release Notes