From 9f048a56c47b504dac83afc08b3acab029441cad Mon Sep 17 00:00:00 2001 From: Ashutosh Gangwar Date: Sun, 1 Oct 2023 23:32:44 +0530 Subject: [PATCH] revert compileSdk to 33, downgrade deps, fix broken tests --- app/build.gradle | 4 ++-- .../noice/engine/SoundPlaybackMediaSessionTest.kt | 2 +- .../ashutoshgngwr/noice/shadows/ShadowMediaSession.kt | 4 ++++ build.gradle | 10 +++++----- gradle.properties | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 01f153094..f6bb9a16a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -104,7 +104,7 @@ dependencies { ksp "androidx.room:room-compiler:$roomVersion" implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.browser:browser:1.6.0' + implementation 'androidx.browser:browser:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation "androidx.core:core-ktx:$deps.androidXCoreVersion" implementation "androidx.fragment:fragment-ktx:$fragmentVersion" @@ -138,7 +138,7 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$deps.coroutinesVersion" implementation project(":api-client") - fullImplementation 'androidx.mediarouter:mediarouter:1.6.0' + fullImplementation 'androidx.mediarouter:mediarouter:1.4.0' fullImplementation 'com.android.billingclient:billing-ktx:6.0.1' fullImplementation 'com.google.android.gms:play-services-base:18.2.0' fullImplementation 'com.google.android.gms:play-services-cast-framework:21.3.0' diff --git a/app/src/test/java/com/github/ashutoshgngwr/noice/engine/SoundPlaybackMediaSessionTest.kt b/app/src/test/java/com/github/ashutoshgngwr/noice/engine/SoundPlaybackMediaSessionTest.kt index c3ffe9a32..3f7fd4b37 100644 --- a/app/src/test/java/com/github/ashutoshgngwr/noice/engine/SoundPlaybackMediaSessionTest.kt +++ b/app/src/test/java/com/github/ashutoshgngwr/noice/engine/SoundPlaybackMediaSessionTest.kt @@ -55,7 +55,7 @@ class SoundPlaybackMediaSessionTest { mediaSessionShadow.sendSetDeviceMuteCommand(false) assertEquals(15, fakeVolumeProvider.getVolume()) assertEquals(false, fakeVolumeProvider.isMute()) - // also check if changes propogate back to the media session. + // also check if changes propagate back to the media session. assertEquals(15, mediaSessionShadow.deviceVolume) assertEquals(false, mediaSessionShadow.isDeviceMute) diff --git a/app/src/test/java/com/github/ashutoshgngwr/noice/shadows/ShadowMediaSession.kt b/app/src/test/java/com/github/ashutoshgngwr/noice/shadows/ShadowMediaSession.kt index 0e3d7574b..58a3144fb 100644 --- a/app/src/test/java/com/github/ashutoshgngwr/noice/shadows/ShadowMediaSession.kt +++ b/app/src/test/java/com/github/ashutoshgngwr/noice/shadows/ShadowMediaSession.kt @@ -8,7 +8,9 @@ import androidx.media3.common.DeviceInfo import androidx.media3.common.MediaMetadata import androidx.media3.common.Player import androidx.media3.common.util.BitmapLoader +import androidx.media3.session.CommandButton import androidx.media3.session.MediaSession +import com.google.common.collect.ImmutableList import org.robolectric.annotation.Implementation import org.robolectric.annotation.Implements import org.robolectric.annotation.RealObject @@ -44,6 +46,7 @@ class ShadowMediaSession : Player.Listener { id: String, player: Player, sessionActivity: PendingIntent?, + customLayout: ImmutableList, callback: MediaSession.Callback, tokenExtras: Bundle, bitmapLoader: BitmapLoader, @@ -55,6 +58,7 @@ class ShadowMediaSession : Player.Listener { ReflectionHelpers.ClassParameter.from(String::class.java, id), ReflectionHelpers.ClassParameter.from(Player::class.java, player), ReflectionHelpers.ClassParameter.from(PendingIntent::class.java, sessionActivity), + ReflectionHelpers.ClassParameter.from(ImmutableList::class.java, customLayout), ReflectionHelpers.ClassParameter.from(MediaSession.Callback::class.java, callback), ReflectionHelpers.ClassParameter.from(Bundle::class.java, tokenExtras), ReflectionHelpers.ClassParameter.from(BitmapLoader::class.java, bitmapLoader), diff --git a/build.gradle b/build.gradle index a9e6bf3ba..6f9c39d1a 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { project.ext { deps = [ aboutLibrariesVersion: "${aboutLibrariesVersion}", - androidXCoreVersion : '1.12.0', + androidXCoreVersion : '1.10.1', coroutinesVersion : '1.7.3', hiltVersion : "${hiltVersion}", kotlinVersion : "${kotlinVersion}", @@ -39,11 +39,11 @@ subprojects { } android { - compileSdk 34 + compileSdk 33 defaultConfig { minSdk 21 - targetSdk 34 + targetSdk 33 } compileOptions { @@ -109,7 +109,7 @@ subprojects { sourceDirectories.setFrom(files(srcDirs)) classDirectories.setFrom(files( fileTree( - dir: "${project.buildDir}/tmp/kotlin-classes/${variant.name}", + dir: "${project.layout.buildDir}/tmp/kotlin-classes/${variant.name}", excludes: ['**/R.class', '**/R$*.class', '**/*$ViewInjector*.*', @@ -137,5 +137,5 @@ subprojects { } tasks.register('clean', Delete) { - delete rootProject.buildDir + delete rootProject.layout.buildDir } diff --git a/gradle.properties b/gradle.properties index ca7754ebd..4d6ef45ac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,5 +27,5 @@ kotlin.code.style=official agpVersion=8.1.2 hiltVersion=2.48 kotlinVersion=1.9.10 -navVersion=2.7.3 -aboutLibrariesVersion=10.9.1 +navVersion=2.6.0 +aboutLibrariesVersion=10.8.3