[Android] Bump some dependencies including kotlin and kotlinx
Nicolas Pomepuy
git at videolan.org
Wed Jan 24 17:37:45 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jan 23 08:05:51 2024 +0100| [da2eb8987225462f823eb6f0577dac950d8d0334] | committer: Duncan McNamara
Bump some dependencies including kotlin and kotlinx
> https://code.videolan.org/videolan/vlc-android/commit/da2eb8987225462f823eb6f0577dac950d8d0334
---
application/app/build.gradle | 2 +-
application/tools/build.gradle | 2 +-
.../vlc-android/src/org/videolan/vlc/ExternalMonitor.kt | 13 ++++++-------
build.gradle | 11 ++++++-----
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/application/app/build.gradle b/application/app/build.gradle
index ec6048049d..a3fd9b2639 100644
--- a/application/app/build.gradle
+++ b/application/app/build.gradle
@@ -149,7 +149,7 @@ dependencies {
testImplementation "androidx.arch.core:core-testing:$rootProject.ext.archVersion"
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.ext.archVersion"
androidTestImplementation "androidx.test.ext:junit:$rootProject.ext.junitExtVersion"
- coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
+ coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$rootProject.ext.desugarLib"
androidTestUtil "androidx.test:orchestrator:$rootProject.ext.orchestrator"
testImplementation "androidx.test:core:$rootProject.ext.testCore"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$rootProject.ext.kotlinx_version"
diff --git a/application/tools/build.gradle b/application/tools/build.gradle
index de61fa07b1..a3ccec99ba 100644
--- a/application/tools/build.gradle
+++ b/application/tools/build.gradle
@@ -24,7 +24,7 @@ android {
dependencies {
api "androidx.appcompat:appcompat:$rootProject.ext.appCompatVersion"
implementation "androidx.lifecycle:lifecycle-process:$rootProject.ext.lifecycleVersion"
- implementation "androidx.preference:preference:$androidxPreferencesVersion"
+ implementation "androidx.preference:preference-ktx:$androidxPreferencesVersion"
api "androidx.tvprovider:tvprovider:$rootProject.ext.androidxLeanbackVersion"
implementation("com.squareup.okhttp3:logging-interceptor:4.2.1")
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.ext.kotlinx_version"
diff --git a/application/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt b/application/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
index 00434ae1a9..e29cd955e6 100644
--- a/application/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
+++ b/application/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
@@ -36,12 +36,11 @@ import android.util.Log
import androidx.core.content.getSystemService
import androidx.lifecycle.*
import kotlinx.coroutines.*
-import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.Channel
-import kotlinx.coroutines.channels.Channel.Factory.BUFFERED
import kotlinx.coroutines.channels.actor
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.asFlow
+import kotlinx.coroutines.flow.MutableSharedFlow
+import kotlinx.coroutines.flow.asSharedFlow
import org.videolan.medialibrary.interfaces.Medialibrary
import org.videolan.resources.ACTION_CHECK_STORAGES
import org.videolan.resources.AppContextProvider
@@ -79,7 +78,7 @@ object ExternalMonitor : BroadcastReceiver(), DefaultLifecycleObserver, Coroutin
delay(100L)
Log.i("ExternalMonitor", "Storage management: unmount: ${action.uuid} - ${action.path}")
Medialibrary.getInstance().removeDevice(action.uuid, action.path)
- storageChannel.trySend(action)
+ storageChannel.tryEmit(action)
}
}
}
@@ -113,10 +112,10 @@ object ExternalMonitor : BroadcastReceiver(), DefaultLifecycleObserver, Coroutin
}
@OptIn(ObsoleteCoroutinesApi::class)
- private val storageChannel = BroadcastChannel<DeviceAction>(BUFFERED)
+ private val storageChannel = MutableSharedFlow<DeviceAction>()
@OptIn(ObsoleteCoroutinesApi::class)
val storageEvents : Flow<DeviceAction>
- get() = storageChannel.asFlow()
+ get() = storageChannel.asSharedFlow()
private var storageObserver: WeakReference<Activity>? = null
var devices = LiveDataset<UsbDevice>()
@@ -161,7 +160,7 @@ object ExternalMonitor : BroadcastReceiver(), DefaultLifecycleObserver, Coroutin
private fun notifyNewStorage(mediaMounted: MediaMounted) {
val activity = storageObserver?.get() ?: return
UiTools.newStorageDetected(activity, mediaMounted.path)
- storageChannel.trySend(mediaMounted)
+ storageChannel.tryEmit(mediaMounted)
}
@Synchronized
diff --git a/build.gradle b/build.gradle
index ee2f9f4059..0ae59a4112 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.android_plugin_version = '8.2.0'
- ext.kotlin_version = '1.9.0'
- ext.kotlinx_version = '1.6.0'
+ ext.kotlin_version = '1.9.22'
+ ext.kotlinx_version = '1.7.1'
repositories {
flatDir dirs: "gradle/plugins"
google()
@@ -47,6 +47,7 @@ ext {
minSdkVersion = 17
targetSdkVersion = 34
compileSdkVersion = 34
+ desugarLib = '2.0.4'
androidxLegacyVersion = '1.0.0'
androidxCoreVersion = '1.12.0'
appCompatVersion = '1.6.1'
@@ -61,15 +62,15 @@ ext {
constraintLayoutVersion = '2.1.4'
viewPager2Version = "1.0.0"
archVersion = '2.2.0'
- roomVersion = '2.4.3'
- pagingVersion = '3.1.1'
+ roomVersion = '2.6.1'
+ pagingVersion = '3.2.1'
junitVersion = '4.13.2'
junitExtVersion = '1.1.5'
mockito = '2.25.0'
//Retrofit 2.7 drops Android 5 support
retrofit = '2.7.1'
moshi = '1.8.0'
- ktorVersion = '2.3.6'
+ ktorVersion = '2.3.7'
powerMock = '2.0.2'
espressoVersion = '3.5.1'
livedataTest = '1.2.0'
More information about the Android
mailing list