Skip to content

Integrate Telecom into the Stream Video SDK #1322

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

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

aleksandar-apostolov
Copy link
Contributor

🎯 Goal

Introduce support for Telecom integration in the Android SDK.

🛠 Implementation details

Implements integration as ConnectionService with separate Connection object managed by the SDK.

🧪 Testing

A phone with SIM is required to do testing because apart from regular ringing scenarios also tests needs to be made to verify ringing scenarios while:

  1. Device is already in a SIM call
  2. SIM call comes in while the user is in a Stream call.
  3. Integration with wearables (e.g. watch and routing of audio)

aleksandar-apostolov and others added 12 commits February 20, 2025 14:13
# Conflicts:
#	stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/MediaManager.kt
#	stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/DefaultNotificationHandler.kt
#	stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/activecall/AudioCallContent.kt
Copy link
Contributor

github-actions bot commented Mar 17, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 11.21 MB 11.23 MB 0.02 MB 🟢
stream-video-android-ui-xml 5.66 MB 5.68 MB 0.02 MB 🟢
stream-video-android-ui-compose 5.83 MB 5.83 MB 0.00 MB 🟢

@aleksandar-apostolov aleksandar-apostolov changed the title Telecom v3 Integrate Telecom into the Stream Video SDK Mar 19, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
35.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@aleksandar-apostolov aleksandar-apostolov marked this pull request as ready for review March 21, 2025 09:56
@aleksandar-apostolov aleksandar-apostolov requested a review from a team as a code owner March 21, 2025 09:56
}
}

private fun playCallSound(soundUri: Uri?) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any plan to refactor duplicate function like this one and other one requestAudioFocus which are also present CallService ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we'll extract a CallController of a sort. Do you think its worthwhile to do it now or later? (both "service" classes are internal)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think its better to do it now, otherwise it will become a tech debt

Copy link
Member

Choose a reason for hiding this comment

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

The sound related functions were extracted in a CallSoundPlayer on the telecom-v2 branch. I'll add it on the list to do the same here.

* limitations under the License.
*/

package io.getstream.video.android.core.notifications.internal.service.telecom
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can make some methods internal if they are not part of public apis

Comment on lines +74 to +80
"Stream calls", // Visible to the user in the system settings
)
// Capabilities define what kind of calls this account supports
.setCapabilities(capabilities)
// Optionally set an icon (for display in system dialer)
.setIcon(Icon.createWithResource(context, R.drawable.stream_video_ic_call))
.setShortDescription("My VoIP calls")
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m concerned about hardcoding the label, icon, and description for the PhoneAccount.

If two or more apps using our SDK are installed on the same device, the system settings would display identical names and icons for each app's calling account.

This could confuse users, as they wouldn’t be able to distinguish between the accounts

Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 19 out of 22 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • stream-video-android-core/api/stream-video-android-core.api: Language not supported
  • stream-video-android-core/src/main/AndroidManifest.xml: Language not supported
  • stream-video-android-ui-core/api/stream-video-android-ui-core.api: Language not supported
Comments suppressed due to low confidence (1)

stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/telecom/TelecomConnection.kt:257

  • The selectDevice implementation in the AudioHandler returned by setDeviceListener is commented out. If this functionality is required for proper device selection, please implement it or remove the commented code with a clarifying note.
//                    currentConnection?.deviceListener = listener

Comment on lines +25 to 26
private var enableTelecomIntegration: Boolean = false

Copy link
Preview

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

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

The default value for enableTelecomIntegration in the builder is false, while the corresponding default in CallServiceConfig is true. Please align these defaults to ensure consistent behavior.

Suggested change
private var enableTelecomIntegration: Boolean = false
private var enableTelecomIntegration: Boolean = true

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants