From 5e10c285d7a58d37c298edff8a3aac8d60df367d Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Thu, 21 Mar 2024 15:01:43 +0100 Subject: [PATCH 1/4] Revert to Service.foreground to support sdk 33 --- .../theoplayer/media/MediaPlaybackService.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt b/android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt index c49314fbb..9263487cb 100644 --- a/android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt +++ b/android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt @@ -293,13 +293,18 @@ class MediaPlaybackService : MediaBrowserServiceCompat() { private fun startForegroundWithPlaybackState(@PlaybackStateCompat.State playbackState: Int, largeIcon: Bitmap? = null) { try { - ServiceCompat.startForeground( - this, NOTIFICATION_ID, - notificationBuilder.build(playbackState, largeIcon, enableMediaControls), - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + startForeground( + NOTIFICATION_ID, + notificationBuilder.build(playbackState, largeIcon, enableMediaControls), ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK - else 0 - ) + ) + } else { + startForeground( + NOTIFICATION_ID, + notificationBuilder.build(playbackState, largeIcon, enableMediaControls) + ) + } } catch (e: IllegalStateException) { // Make sure that app does not crash in case anything goes wrong with starting the service. // https://issuetracker.google.com/issues/229000935 From 4d60d6d6a35b41f133e42510381ad3b7ac7dacfb Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Thu, 21 Mar 2024 15:03:03 +0100 Subject: [PATCH 2/4] Set configurable dependency versions --- android/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 8459a22f2..bfac023b1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.2.2' + classpath "com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '8.2.2')}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.9.21')}" } } @@ -108,9 +108,9 @@ repositories { dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" - implementation "androidx.appcompat:appcompat:1.6.1" - implementation "androidx.core:core-ktx:1.12.0" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('coroutinesVersion', '1.7.3')}" + implementation "androidx.appcompat:appcompat:${safeExtGet('appcompatVersion', '1.6.1')}" + implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.12.0')}" // The minimum supported THEOplayer version is 6.0.0 def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[6.0.0,7.0)') From 0adade4ef316fa4bc0b105a3d3771f43a4b0bd2a Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Thu, 21 Mar 2024 16:35:42 +0100 Subject: [PATCH 3/4] Downgrade default core ktx version to support target sdk 33 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index bfac023b1..e2a7972c7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -110,7 +110,7 @@ dependencies { implementation "com.facebook.react:react-native:+" // From node_modules implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('coroutinesVersion', '1.7.3')}" implementation "androidx.appcompat:appcompat:${safeExtGet('appcompatVersion', '1.6.1')}" - implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.12.0')}" + implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.10.1')}" // The minimum supported THEOplayer version is 6.0.0 def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[6.0.0,7.0)') From 66a366662bb98889bdb3e50ac6503cef71fb31a2 Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Thu, 21 Mar 2024 16:40:57 +0100 Subject: [PATCH 4/4] Add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cc4edf3d..3e37e756d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [3.10.2] - 24-03-21 + +### Changed + +- Downgraded default `androidx.core:core-ktx` dependency version to support Android target sdk 33. + ## [3.10.1] - 24-03-19 ### Changed