From 869b2cc21ecec409ad9db1c5ab8f9b87cf245d1a Mon Sep 17 00:00:00 2001 From: Liviu Timar <65943217+liviu-timar@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:25:11 +0300 Subject: [PATCH 1/5] Init StreamVideo in onPreCreate if needed (#1121) Co-authored-by: Aleksandar Apostolov --- .../io/getstream/video/android/CallActivity.kt | 16 ++++++++++++++++ .../video/android/util/config/AppConfig.kt | 8 ++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/demo-app/src/main/kotlin/io/getstream/video/android/CallActivity.kt b/demo-app/src/main/kotlin/io/getstream/video/android/CallActivity.kt index eb1e16ebc7..2155e82c31 100644 --- a/demo-app/src/main/kotlin/io/getstream/video/android/CallActivity.kt +++ b/demo-app/src/main/kotlin/io/getstream/video/android/CallActivity.kt @@ -17,6 +17,8 @@ package io.getstream.video.android import android.content.Intent +import android.os.Bundle +import android.os.PersistableBundle import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState @@ -28,12 +30,16 @@ import io.getstream.result.onSuccessSuspend import io.getstream.video.android.compose.ui.ComposeStreamCallActivity import io.getstream.video.android.compose.ui.StreamCallActivityComposeDelegate import io.getstream.video.android.core.Call +import io.getstream.video.android.core.StreamVideo +import io.getstream.video.android.datastore.delegate.StreamUserDataStore import io.getstream.video.android.ui.call.CallScreen import io.getstream.video.android.ui.common.StreamActivityUiDelegate import io.getstream.video.android.ui.common.StreamCallActivity import io.getstream.video.android.ui.common.StreamCallActivityConfiguration import io.getstream.video.android.ui.common.util.StreamCallActivityDelicateApi import io.getstream.video.android.util.FullScreenCircleProgressBar +import io.getstream.video.android.util.StreamVideoInitHelper +import kotlinx.coroutines.runBlocking @OptIn(StreamCallActivityDelicateApi::class) class CallActivity : ComposeStreamCallActivity() { @@ -42,6 +48,16 @@ class CallActivity : ComposeStreamCallActivity() { override val configuration: StreamCallActivityConfiguration = StreamCallActivityConfiguration(closeScreenOnCallEnded = false) + @StreamCallActivityDelicateApi + override fun onPreCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { + runBlocking { + if (!StreamVideo.isInstalled) { + runBlocking { StreamVideoInitHelper.reloadSdk(StreamUserDataStore.instance()) } + } + } + super.onPreCreate(savedInstanceState, persistentState) + } + private class StreamDemoUiDelegate : StreamCallActivityComposeDelegate() { @Composable diff --git a/demo-app/src/main/kotlin/io/getstream/video/android/util/config/AppConfig.kt b/demo-app/src/main/kotlin/io/getstream/video/android/util/config/AppConfig.kt index a18d37bc11..9ca79031e1 100644 --- a/demo-app/src/main/kotlin/io/getstream/video/android/util/config/AppConfig.kt +++ b/demo-app/src/main/kotlin/io/getstream/video/android/util/config/AppConfig.kt @@ -31,7 +31,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.launch /** * Main entry point for remote / local configuration @@ -88,7 +87,7 @@ object AppConfig { * @param coroutineScope the scope used to run [onLoaded] */ @OptIn(DelicateCoroutinesApi::class) - fun load( + suspend fun load( context: Context, coroutineScope: CoroutineScope = GlobalScope, onLoaded: suspend () -> Unit = {}, @@ -103,10 +102,7 @@ object AppConfig { } val which = selectedEnvironment ?: availableEnvironments[0] selectEnv(which) - currentEnvironment.value = which - coroutineScope.launch { - onLoaded() - } + onLoaded() } catch (e: Exception) { logger.e(e) { "Failed to parse remote config. Deeplinks not working!" } } From a7b223fcb1c5ead94d6b4571e3c978ad613236c5 Mon Sep 17 00:00:00 2001 From: Jaewoong Eum Date: Thu, 27 Jun 2024 17:29:54 +0900 Subject: [PATCH 2/5] Set up stability configuration file and bump compose library dependencies (#1122) --- .../main/kotlin/io/getstream/video/AndroidCompose.kt | 1 + compose_compiler_config.conf | 11 ++++++++--- gradle/libs.versions.toml | 9 ++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt index 92a1839c25..659a289666 100644 --- a/build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt +++ b/build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt @@ -33,5 +33,6 @@ internal fun Project.configureAndroidCompose( extensions.configure { enableStrongSkippingMode = true reportsDestination = layout.buildDirectory.dir("compose_compiler") + stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_compiler_config.conf") } } \ No newline at end of file diff --git a/compose_compiler_config.conf b/compose_compiler_config.conf index 76a3fdecac..2bcbf29125 100644 --- a/compose_compiler_config.conf +++ b/compose_compiler_config.conf @@ -1,3 +1,8 @@ -kotlin.collections.List -org.threeten.bp.OffsetDateTime -org.threeten.bp.LocalDateTime \ No newline at end of file +// Kotlin collections and datetime classes +kotlin.collections.* +org.threeten.bp.* +java.time.* + +// We always use immutable classes for our data model, to avoid running the Compose compiler +// in the module we declare it to be stable here. +io.getstream.video.android.core.model.* \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2a6e308506..e2cfc4aa40 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ cameraCamera2 = "1.3.0" spotless = "6.21.0" nexusPlugin = "1.3.0" kotlin = "2.0.0" -ksp = "2.0.0-1.0.21" +ksp = "2.0.0-1.0.22" kotlinSerialization = "1.6.3" kotlinSerializationConverter = "1.0.0" kotlinxCoroutines = "1.8.0" @@ -22,15 +22,14 @@ androidxActivity = "1.9.0" androidxDataStore = "1.0.0" googleService = "4.3.14" -androidxComposeBom = "2024.05.00" -androidxComposeCompiler = "1.5.11" +androidxComposeBom = "2024.06.00" androidxComposeTracing = "1.0.0-beta01" androidxHiltNavigation = "1.2.0" androidxComposeNavigation = "2.7.7" -composeStableMarker = "1.0.2" +composeStableMarker = "1.0.5" coil = "2.6.0" -landscapist = "2.3.3" +landscapist = "2.3.5" accompanist = "0.32.0" telephoto = "0.3.0" audioswitch = "1.1.8" From f8a588be462c4ad47350ed806bf5f13968b4df90 Mon Sep 17 00:00:00 2001 From: Liviu Timar <65943217+liviu-timar@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:27:40 +0300 Subject: [PATCH 3/5] Add keep rules for VideoPushDelegate and PushDelegate (#1124) --- stream-video-android-core/consumer-proguard-rules.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stream-video-android-core/consumer-proguard-rules.pro b/stream-video-android-core/consumer-proguard-rules.pro index 2177ce6266..3f69180ecb 100644 --- a/stream-video-android-core/consumer-proguard-rules.pro +++ b/stream-video-android-core/consumer-proguard-rules.pro @@ -62,4 +62,8 @@ -keep,allowoptimization,allowshrinking,allowobfuscation class <3> # With R8 full mode generic signatures are stripped for classes that are not kept. --keep,allowobfuscation,allowshrinking class retrofit2.Response \ No newline at end of file +-keep,allowobfuscation,allowshrinking class retrofit2.Response + +# Prevent R8 from stripping notification-handling classes. +-keep class io.getstream.video.android.core.notifications.internal.VideoPushDelegate { *; } +-keep class io.getstream.android.push.delegate.PushDelegate { *; } \ No newline at end of file From 61069e6e44e36313d1bef5ba4544f5b019a92cbe Mon Sep 17 00:00:00 2001 From: Aleksandar Apostolov Date: Tue, 2 Jul 2024 15:59:23 +0200 Subject: [PATCH 4/5] Bugfixes 20240702 (#1125) --- .../io/getstream/video/android/core/StreamVideoBuilder.kt | 2 +- .../kotlin/io/getstream/video/android/core/utils/DebugInfo.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoBuilder.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoBuilder.kt index d93bd1a5a1..acf07d7013 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoBuilder.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoBuilder.kt @@ -210,7 +210,7 @@ public class StreamVideoBuilder @JvmOverloads constructor( }.onError { streamLog { it.message } } - } catch (e: Exception) { + } catch (e: Throwable) { // If the connect continuation was resumed with an exception, we catch it here. streamLog { e.message.orEmpty() } } diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DebugInfo.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DebugInfo.kt index 247baa29e6..bc65500f55 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DebugInfo.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DebugInfo.kt @@ -24,6 +24,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import java.util.Collections internal data class Timer(val name: String, val start: Long = System.currentTimeMillis()) { var end: Long = 0 @@ -58,7 +59,7 @@ internal class DebugInfo(val client: StreamVideoImpl) { private val logger by taggedLogger("DebugInfo") // timers to help track performance issues in prod - val timers = mutableListOf() + val timers = Collections.synchronizedList(mutableListOf()) // last 20 events // phone type From 65517b8b16abbca79f64ef4afbefa5f990def353 Mon Sep 17 00:00:00 2001 From: Aleksandar Apostolov Date: Tue, 2 Jul 2024 18:00:31 +0200 Subject: [PATCH 5/5] Prepare release 1.0.8 (#1126) --- .../main/kotlin/io/getstream/video/android/Configuration.kt | 4 ++-- docusaurus/docs/Android/02-tutorials/01-video-calling.mdx | 2 +- docusaurus/docs/Android/02-tutorials/02-audio-room.mdx | 2 +- docusaurus/docs/Android/02-tutorials/03-livestream.mdx | 2 +- docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt b/buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt index d3d6f76932..862e13c982 100644 --- a/buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt +++ b/buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt @@ -6,9 +6,9 @@ object Configuration { const val minSdk = 24 const val majorVersion = 1 const val minorVersion = 0 - const val patchVersion = 7 + const val patchVersion = 8 const val versionName = "$majorVersion.$minorVersion.$patchVersion" - const val versionCode = 31 + const val versionCode = 32 const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" const val artifactGroup = "io.getstream" const val streamVideoCallGooglePlayVersion = "1.1.4" diff --git a/docusaurus/docs/Android/02-tutorials/01-video-calling.mdx b/docusaurus/docs/Android/02-tutorials/01-video-calling.mdx index 74660dd751..320ca0a7dd 100644 --- a/docusaurus/docs/Android/02-tutorials/01-video-calling.mdx +++ b/docusaurus/docs/Android/02-tutorials/01-video-calling.mdx @@ -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:1.0.7") + implementation("io.getstream:stream-video-android-ui-compose:1.0.8") // Optionally add Jetpack Compose if Android studio didn't automatically include them implementation(platform("androidx.compose:compose-bom:2023.08.00")) diff --git a/docusaurus/docs/Android/02-tutorials/02-audio-room.mdx b/docusaurus/docs/Android/02-tutorials/02-audio-room.mdx index ac9b342862..a9e505dfb2 100644 --- a/docusaurus/docs/Android/02-tutorials/02-audio-room.mdx +++ b/docusaurus/docs/Android/02-tutorials/02-audio-room.mdx @@ -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:1.0.7") + implementation("io.getstream:stream-video-android-ui-compose:1.0.8") // Jetpack Compose (optional/ android studio typically adds them when you create a new project) implementation(platform("androidx.compose:compose-bom:2023.08.00")) diff --git a/docusaurus/docs/Android/02-tutorials/03-livestream.mdx b/docusaurus/docs/Android/02-tutorials/03-livestream.mdx index 63291c90bf..3799426f33 100644 --- a/docusaurus/docs/Android/02-tutorials/03-livestream.mdx +++ b/docusaurus/docs/Android/02-tutorials/03-livestream.mdx @@ -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:1.0.7") + implementation("io.getstream:stream-video-android-ui-compose:1.0.8") // Jetpack Compose (optional/ android studio typically adds them when you create a new project) implementation(platform("androidx.compose:compose-bom:2023.08.00")) diff --git a/docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx b/docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx index 7bc251d255..19d9677ba4 100644 --- a/docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx +++ b/docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx @@ -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:1.0.7") + implementation("io.getstream:stream-video-android-ui-compose:1.0.8") // Stream Chat implementation(libs.stream.chat.compose)