Make the Android Video SDK compatible with Android 17.#1752
Make the Android Video SDK compatible with Android 17.#1752rahul-lohra wants to merge 4 commits into
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
WalkthroughIncoming-call foreground service selection now uses a dedicated SDK-aware path. Android 17+ uses the phone-call service type when supported, while earlier versions retain the existing fallback. Tests cover both runtime SDK branches. ChangesIncoming call foreground service type
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 1
🤖 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
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/permissions/ForegroundServicePermissionManager.kt`:
- Around line 103-106: Replace the hardcoded 37 in the API-level check within
ForegroundServicePermissionManager with a named ANDROID_17_API_LEVEL constant,
and remove the TODO comment. Use the constant in the Build.VERSION.SDK_INT
comparison while preserving the existing foreground service type condition;
track the future compileSdk upgrade separately.
🪄 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 Plus
Run ID: 74a1c0bf-57c9-4fc2-b260-e8e63754ed25
📒 Files selected for processing (2)
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/permissions/ForegroundServicePermissionManager.ktstream-video-android-core/src/test/kotlin/io/getstream/video/android/core/notifications/internal/service/permissions/ForegroundServicePermissionManagerTest.kt
| // TODO: replace the hardcoded 37 with Build.VERSION_CODES.<ANDROID_17> once compileSdk / | ||
| // targetSdk are raised to 37; the constant does not exist at the current compileSdk. | ||
| if (requiredForegroundTypes.contains(ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL) && | ||
| Build.VERSION.SDK_INT >= 37 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Replace the TODO-backed API-level literal.
SonarCloud reports this TODO as unresolved. Extract 37 into a named ANDROID_17_API_LEVEL constant and track the compileSdk upgrade separately, rather than retaining a warning in production code.
🧰 Tools
🪛 GitHub Check: SonarCloud Code Analysis
[warning] 103-103: Complete the task associated to this TODO comment.
🤖 Prompt for 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.
In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/permissions/ForegroundServicePermissionManager.kt`
around lines 103 - 106, Replace the hardcoded 37 in the API-level check within
ForegroundServicePermissionManager with a named ANDROID_17_API_LEVEL constant,
and remove the TODO comment. Use the constant in the Build.VERSION.SDK_INT
comparison while preserving the existing foreground service type condition;
track the future compileSdk upgrade separately.
Source: Linters/SAST tools



Goal
Closes AND-1324
Make the Android Video SDK compatible with Android 17.
Android 17 introduces new restrictions on background media playback Link . Previously, the SDK relied on the
SHORT_SERVICEforeground service type to play the incoming call ringtone while the app was in the background. This approach is no longer suitable on Android 17.Solution:
For incoming calls on Android 17, replace
SHORT_SERVICEwithServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL.Implementation
Replace
SHORT_SERVICEwithServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALLfor the incoming call foreground service on Android 17.🎨 UI Changes
None
Testing
Summary by CodeRabbit
Bug Fixes
Tests