Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Apr 15, 2024
2 parents 55fc028 + 7454393 commit 9370bf1
Show file tree
Hide file tree
Showing 19 changed files with 251 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ object Configuration {
const val minSdk = 24
const val majorVersion = 0
const val minorVersion = 5
const val patchVersion = 5
const val patchVersion = 6
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 19
const val versionCode = 20
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.0.7"
const val streamVideoCallGooglePlayVersion = "1.0.8"
const val streamWebRtcVersionName = "1.1.1"
}
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/01-video-calling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```kotlin
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:0.5.5")
implementation("io.getstream:stream-video-android-ui-compose:0.5.6")

// Optionally add Jetpack Compose if Android studio didn't automatically include them
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/02-audio-room.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```groovy
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:0.5.5")
implementation("io.getstream:stream-video-android-ui-compose:0.5.6")
// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/03-livestream.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```kotlin
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:0.5.5")
implementation("io.getstream:stream-video-android-ui-compose:0.5.6")

// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Let the project sync. It should have all the dependencies required for you to fi
```groovy
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:0.5.5")
implementation("io.getstream:stream-video-android-ui-compose:0.5.6")
// Stream Chat
implementation(libs.stream.chat.compose)
Expand Down
6 changes: 0 additions & 6 deletions stream-video-android-core/api/stream-video-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -4116,7 +4116,6 @@ public final class io/getstream/video/android/core/notifications/NotificationCon

public abstract interface class io/getstream/video/android/core/notifications/NotificationHandler : io/getstream/android/push/permissions/NotificationPermissionHandler {
public static final field ACTION_ACCEPT_CALL Ljava/lang/String;
public static final field ACTION_DISMISS_NOTIFICATION Ljava/lang/String;
public static final field ACTION_INCOMING_CALL Ljava/lang/String;
public static final field ACTION_LEAVE_CALL Ljava/lang/String;
public static final field ACTION_LIVE_CALL Ljava/lang/String;
Expand All @@ -4128,8 +4127,6 @@ public abstract interface class io/getstream/video/android/core/notifications/No
public static final field INCOMING_CALL_NOTIFICATION_ID I
public static final field INTENT_EXTRA_CALL_CID Ljava/lang/String;
public static final field INTENT_EXTRA_CALL_DISPLAY_NAME Ljava/lang/String;
public static final field INTENT_EXTRA_NEXT_ACTION Ljava/lang/String;
public static final field INTENT_EXTRA_NEXT_ACTION_BUNDLE Ljava/lang/String;
public static final field INTENT_EXTRA_NOTIFICATION_ID Ljava/lang/String;
public abstract fun getOngoingCallNotification (Lio/getstream/video/android/model/StreamCallId;)Landroid/app/Notification;
public abstract fun getRingingCallNotification (Lio/getstream/video/android/core/RingingState;Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)Landroid/app/Notification;
Expand All @@ -4140,7 +4137,6 @@ public abstract interface class io/getstream/video/android/core/notifications/No

public final class io/getstream/video/android/core/notifications/NotificationHandler$Companion {
public static final field ACTION_ACCEPT_CALL Ljava/lang/String;
public static final field ACTION_DISMISS_NOTIFICATION Ljava/lang/String;
public static final field ACTION_INCOMING_CALL Ljava/lang/String;
public static final field ACTION_LEAVE_CALL Ljava/lang/String;
public static final field ACTION_LIVE_CALL Ljava/lang/String;
Expand All @@ -4151,8 +4147,6 @@ public final class io/getstream/video/android/core/notifications/NotificationHan
public static final field INCOMING_CALL_NOTIFICATION_ID I
public static final field INTENT_EXTRA_CALL_CID Ljava/lang/String;
public static final field INTENT_EXTRA_CALL_DISPLAY_NAME Ljava/lang/String;
public static final field INTENT_EXTRA_NEXT_ACTION Ljava/lang/String;
public static final field INTENT_EXTRA_NEXT_ACTION_BUNDLE Ljava/lang/String;
public static final field INTENT_EXTRA_NOTIFICATION_ID Ljava/lang/String;
}

Expand Down
7 changes: 0 additions & 7 deletions stream-video-android-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@
</intent-filter>
</receiver>

<receiver android:name=".notifications.internal.receivers.DismissNotificationBroadcastReceiver"
android:exported="false">
<intent-filter android:priority="-1">
<action android:name="io.getstream.video.android.action.DISMISS_NOTIFICATION" />
</intent-filter>
</receiver>


<service android:name=".notifications.internal.service.CallService"
android:foregroundServiceType="shortService|microphone"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,8 @@ public class Call(
}

suspend fun accept(): Result<AcceptCallResponse> {
clientImpl.state.removeRingingCall()
clientImpl.state.maybeStopForegroundService()
return clientImpl.accept(type, id)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ class ClientState(client: StreamVideo) {
_ringingCall.value = null
}

// Internal logic
private fun maybeStartForegroundService(call: Call, trigger: String) {
/**
* Start a foreground service that manages the call even when the UI is gone.
* This depends on the flag in [StreamVideoBuilder] called `runForegroundServiceForCalls`
*/
internal fun maybeStartForegroundService(call: Call, trigger: String) {
if (clientImpl.runForegroundService) {
val context = clientImpl.context
val serviceIntent = CallService.buildStartIntent(
Expand All @@ -140,7 +143,10 @@ class ClientState(client: StreamVideo) {
}
}

private fun maybeStopForegroundService() {
/**
* Stop the foreground service that manages the call even when the UI is gone.
*/
internal fun maybeStopForegroundService() {
if (clientImpl.runForegroundService) {
val context = clientImpl.context
val serviceIntent = CallService.buildStopIntent(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public interface NotificationHandler : NotificationPermissionHandler {
const val ACTION_INCOMING_CALL = "io.getstream.video.android.action.INCOMING_CALL"
const val ACTION_OUTGOING_CALL = "io.getstream.video.android.action.OUTGOING_CALL"
const val ACTION_ACCEPT_CALL = "io.getstream.video.android.action.ACCEPT_CALL"
const val ACTION_DISMISS_NOTIFICATION = "io.getstream.video.android.action.DISMISS_NOTIFICATION"
const val ACTION_REJECT_CALL = "io.getstream.video.android.action.REJECT_CALL"
const val ACTION_LEAVE_CALL = "io.getstream.video.android.action.LEAVE_CALL"
const val ACTION_ONGOING_CALL = "io.getstream.video.android.action.ONGOING_CALL"
Expand All @@ -47,10 +46,6 @@ public interface NotificationHandler : NotificationPermissionHandler {

const val INTENT_EXTRA_NOTIFICATION_ID: String =
"io.getstream.video.android.intent-extra.notification_id"
const val INTENT_EXTRA_NEXT_ACTION: String =
"io.getstream.video.android.intent-extra.next_action"
const val INTENT_EXTRA_NEXT_ACTION_BUNDLE: String =
"io.getstream.video.android.intent-extra.next_action_data"
const val INCOMING_CALL_NOTIFICATION_ID = 24756
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import android.content.pm.ResolveInfo
import io.getstream.log.taggedLogger
import io.getstream.video.android.core.notifications.DefaultNotificationHandler
import io.getstream.video.android.core.notifications.NotificationHandler
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.ACTION_ACCEPT_CALL
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.ACTION_LIVE_CALL
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.ACTION_ONGOING_CALL
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.ACTION_REJECT_CALL
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.INCOMING_CALL_NOTIFICATION_ID
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.INTENT_EXTRA_CALL_CID
import io.getstream.video.android.model.StreamCallId

Expand Down Expand Up @@ -96,7 +94,7 @@ internal class DefaultStreamIntentResolver(val context: Context) {
notificationId: Int,
): PendingIntent? =
searchActivityPendingIntent(
Intent(ACTION_LIVE_CALL),
Intent(NotificationHandler.ACTION_LIVE_CALL),
callId,
notificationId,
)
Expand All @@ -109,32 +107,13 @@ internal class DefaultStreamIntentResolver(val context: Context) {
*/
internal fun searchAcceptCallPendingIntent(
callId: StreamCallId,
): PendingIntent? = searchDismissNotificationPendingIntent(
callId,
notificationId: Int = NotificationHandler.INCOMING_CALL_NOTIFICATION_ID,
): PendingIntent? =
searchActivityPendingIntent(
Intent(ACTION_ACCEPT_CALL),
callId,
INCOMING_CALL_NOTIFICATION_ID,
),
)

/**
* Search for a broadcast that will dismiss a notification and will then proceed to call the [nextIntent].
*
* @param callId the callID
* @param nextIntent the next action intent.
*/
internal fun searchDismissNotificationPendingIntent(
callId: StreamCallId,
nextIntent: PendingIntent? = null,
): PendingIntent? {
val baseIntent = Intent(NotificationHandler.ACTION_DISMISS_NOTIFICATION)
baseIntent.putExtra(NotificationHandler.INTENT_EXTRA_NEXT_ACTION, nextIntent)
return searchBroadcastPendingIntent(
baseIntent,
Intent(NotificationHandler.ACTION_ACCEPT_CALL),
callId,
notificationId,
)
}

/**
* Searches for a broadcast receiver that can consume the [ACTION_REJECT_CALL] intent to reject
Expand Down Expand Up @@ -267,17 +246,16 @@ internal class DefaultStreamIntentResolver(val context: Context) {
baseIntent: Intent,
resolveInfo: ResolveInfo,
callId: StreamCallId,
notificationId: Int = INCOMING_CALL_NOTIFICATION_ID,
): Intent {
return Intent(baseIntent).apply {
component = ComponentName(
resolveInfo.activityInfo.applicationInfo.packageName,
resolveInfo.activityInfo.name,
)
putExtra(INTENT_EXTRA_CALL_CID, callId)
putExtra(NotificationHandler.INTENT_EXTRA_CALL_CID, callId)
putExtra(
NotificationHandler.INTENT_EXTRA_NOTIFICATION_ID,
notificationId,
NotificationHandler.INCOMING_CALL_NOTIFICATION_ID,
)
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ public final class io/getstream/video/android/compose/theme/VideoThemeKt {
public final class io/getstream/video/android/compose/ui/ComposableSingletons$StreamCallActivityComposeDelegateKt {
public static final field INSTANCE Lio/getstream/video/android/compose/ui/ComposableSingletons$StreamCallActivityComposeDelegateKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public static field lambda-3 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-3$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
}

public class io/getstream/video/android/compose/ui/ComposeStreamCallActivity : io/getstream/video/android/ui/common/StreamCallActivity {
Expand All @@ -374,8 +378,11 @@ public class io/getstream/video/android/compose/ui/StreamCallActivityComposeDele
public fun DefaultCallContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun NoAnswerContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun NoPermissions (Lio/getstream/video/android/ui/common/StreamCallActivity;Ljava/util/List;Ljava/util/List;ZLandroidx/compose/runtime/Composer;II)V
public fun OnIncomingCallContent (Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;ZZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;I)V
public fun OnOutgoingCallContent (Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;ZZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;I)V
public fun RejectedContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun RootContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun loadingContent (Lio/getstream/video/android/ui/common/StreamCallActivity;)V
public fun setContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;)V
}

Expand Down Expand Up @@ -1584,7 +1591,7 @@ public final class io/getstream/video/android/compose/ui/components/call/ringing
}

public final class io/getstream/video/android/compose/ui/components/call/ringing/RingingCallContentKt {
public static final fun RingingCallContent (Lio/getstream/video/android/core/Call;Landroidx/compose/ui/Modifier;ZZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
public static final fun RingingCallContent (Lio/getstream/video/android/core/Call;Landroidx/compose/ui/Modifier;ZZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function11;Lkotlin/jvm/functions/Function11;Landroidx/compose/runtime/Composer;III)V
}

public final class io/getstream/video/android/compose/ui/components/call/ringing/incomingcall/ComposableSingletons$IncomingCallContentKt {
Expand Down
Loading

0 comments on commit 9370bf1

Please sign in to comment.