diff --git a/.circleci/config.yml b/.circleci/config.yml index cc65a597..6eee27c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ parameters: jobs: build: docker: - - image: cimg/android:2022.03.1 + - image: cimg/android:2022.06.1 working_directory: ~/ultrasonic environment: JVM_OPTS: << pipeline.parameters.memory-config >> @@ -82,7 +82,7 @@ jobs: tx push -s generate_signed_apk: docker: - - image: cimg/android:2022.03.1 + - image: cimg/android:2022.06.1 working_directory: ~/ultrasonic environment: JVM_OPTS: << pipeline.parameters.memory-config >> diff --git a/core/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/Extensions.kt b/core/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/Extensions.kt index 9e745be1..8bc5e19a 100644 --- a/core/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/Extensions.kt +++ b/core/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/Extensions.kt @@ -44,7 +44,7 @@ fun Response.throwOnFailure(): Response { val response = this if (response.isSuccessful && response.body()!!.status === SubsonicResponse.Status.OK) { - return this as Response + return this } if (!response.isSuccessful) { throw IOException("Server error, code: " + response.code()) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dd18430b..5da218cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,9 @@ [versions] # You need to run ./gradlew wrapper after updating the version -gradle = "7.3.2" +gradle = "7.3.3" navigation = "2.3.5" -gradlePlugin = "7.1.1" +gradlePlugin = "7.2.1" androidxcore = "1.6.0" ktlint = "0.43.2" ktlintGradle = "10.2.0" @@ -12,16 +12,16 @@ preferences = "1.1.1" media = "1.3.1" media3 = "1.0.0-beta01" -androidSupport = "28.0.0" +androidSupport = "1.4.0" androidLegacySupport = "1.0.0" -androidSupportDesign = "1.4.0" +androidSupportDesign = "1.6.1" constraintLayout = "2.1.1" multidex = "2.0.1" -room = "2.4.0" +room = "2.4.2" kotlin = "1.6.10" kotlinxCoroutines = "1.6.0-native-mt" kotlinxGuava = "1.6.0" -viewModelKtx = "2.3.0" +viewModelKtx = "2.4.1" retrofit = "2.9.0" jackson = "2.10.1" @@ -52,7 +52,7 @@ detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle- core = { module = "androidx.core:core-ktx", version.ref = "androidxcore" } support = { module = "androidx.legacy:legacy-support-v4", version.ref = "androidLegacySupport" } design = { module = "com.google.android.material:material", version.ref = "androidSupportDesign" } -annotations = { module = "com.android.support:support-annotations", version.ref = "androidSupport" } +annotations = { module = "androidx.annotation:annotation", version.ref = "androidSupport" } multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" } constraintLayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintLayout" } room = { module = "androidx.room:room-compiler", version.ref = "room" } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index a37848a0..f82eeea8 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -1,5 +1,5 @@ ext.versions = [ minSdk : 21, - targetSdk : 31, + targetSdk : 33, compileSdk : 31, ] \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac0b842f..757ed58b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Fri Jun 17 23:13:49 CEST 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-all.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/ultrasonic/build.gradle b/ultrasonic/build.gradle index ed161214..16892319 100644 --- a/ultrasonic/build.gradle +++ b/ultrasonic/build.gradle @@ -73,6 +73,7 @@ android { disable 'IconMissingDensityFolder', 'VectorPath' ignore 'MissingTranslation', 'UnusedQuantity', 'MissingQuantity' warning 'ImpliedQuantity' + disable 'ObsoleteLintCustomCheck' } } diff --git a/ultrasonic/lint-baseline.xml b/ultrasonic/lint-baseline.xml index 4b9c04b2..dbf21cde 100644 --- a/ultrasonic/lint-baseline.xml +++ b/ultrasonic/lint-baseline.xml @@ -1,5 +1,5 @@ - + 0) { + while (bytesToSkipCpy > 0) { val readLength = - bytesToSkip.coerceAtMost(skipBuffer.size.toLong()).toInt() + bytesToSkipCpy.coerceAtMost(skipBuffer.size.toLong()).toInt() val read = Util.castNonNull(responseByteStream).read(skipBuffer, 0, readLength) if (Thread.currentThread().isInterrupted) { throw InterruptedIOException() @@ -271,7 +271,7 @@ open class APIDataSource private constructor( HttpDataSourceException.TYPE_OPEN ) } - bytesToSkip -= read.toLong() + bytesToSkipCpy -= read.toLong() bytesTransferred(read) } return @@ -305,8 +305,8 @@ open class APIDataSource private constructor( */ @Throws(IOException::class) private fun readInternal(buffer: ByteArray, offset: Int, readLength: Int): Int { - var readLength = readLength - if (readLength == 0) { + var readLengthCpy = readLength + if (readLengthCpy == 0) { return 0 } if (bytesToRead != C.LENGTH_UNSET.toLong()) { @@ -314,9 +314,9 @@ open class APIDataSource private constructor( if (bytesRemaining == 0L) { return C.RESULT_END_OF_INPUT } - readLength = readLength.toLong().coerceAtMost(bytesRemaining).toInt() + readLengthCpy = readLengthCpy.toLong().coerceAtMost(bytesRemaining).toInt() } - val read = Util.castNonNull(responseByteStream).read(buffer, offset, readLength) + val read = Util.castNonNull(responseByteStream).read(buffer, offset, readLengthCpy) if (read == -1) { return C.RESULT_END_OF_INPUT } diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/AutoMediaBrowserCallback.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/AutoMediaBrowserCallback.kt index 1f1b8e85..29905d24 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/AutoMediaBrowserCallback.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/AutoMediaBrowserCallback.kt @@ -534,8 +534,8 @@ class AutoMediaBrowserCallback(var player: Player) : val songs = listSongsInMusicService(id, name) if (songs != null) { - if (songs.getChildren(includeDirs = true, includeFiles = false).count() == 0 && - songs.getChildren(includeDirs = false, includeFiles = true).count() > 0 + if (songs.getChildren(includeDirs = true, includeFiles = false).isEmpty() && + songs.getChildren(includeDirs = false, includeFiles = true).isNotEmpty() ) mediaItems.addPlayAllItem(listOf(MEDIA_ALBUM_ITEM, id, name).joinToString("|")) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/CachedDataSource.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/CachedDataSource.kt index 79bae338..54878505 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/CachedDataSource.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/CachedDataSource.kt @@ -101,8 +101,8 @@ class CachedDataSource( } private fun readInternal(buffer: ByteArray, offset: Int, readLength: Int): Int { - var readLength = readLength - if (readLength == 0) { + var readLengthCpy = readLength + if (readLengthCpy == 0) { return 0 } if (bytesToRead != C.LENGTH_UNSET.toLong()) { @@ -110,9 +110,9 @@ class CachedDataSource( if (bytesRemaining == 0L) { return C.RESULT_END_OF_INPUT } - readLength = readLength.toLong().coerceAtMost(bytesRemaining).toInt() + readLengthCpy = readLengthCpy.toLong().coerceAtMost(bytesRemaining).toInt() } - val read = Util.castNonNull(responseByteStream).read(buffer, offset, readLength) + val read = Util.castNonNull(responseByteStream).read(buffer, offset, readLengthCpy) if (read == -1) { Timber.i("CachedDatasource: EndOfInput") return C.RESULT_END_OF_INPUT @@ -134,15 +134,15 @@ class CachedDataSource( @Suppress("ThrowsCount") @Throws(HttpDataSourceException::class) private fun skipFully(bytesToSkip: Long, dataSpec: DataSpec) { - var bytesToSkip = bytesToSkip - if (bytesToSkip == 0L) { + var bytesToSkipCpy = bytesToSkip + if (bytesToSkipCpy == 0L) { return } val skipBuffer = ByteArray(4096) try { - while (bytesToSkip > 0) { + while (bytesToSkipCpy > 0) { val readLength = - bytesToSkip.coerceAtMost(skipBuffer.size.toLong()).toInt() + bytesToSkipCpy.coerceAtMost(skipBuffer.size.toLong()).toInt() val read = Util.castNonNull(responseByteStream).read(skipBuffer, 0, readLength) if (Thread.currentThread().isInterrupted) { throw InterruptedIOException() @@ -154,7 +154,7 @@ class CachedDataSource( HttpDataSourceException.TYPE_OPEN ) } - bytesToSkip -= read.toLong() + bytesToSkipCpy -= read.toLong() bytesTransferred(read) } return diff --git a/ultrasonic/src/main/res/drawable/default_ripple.xml b/ultrasonic/src/main/res/drawable/default_ripple.xml index 90bf9914..3f6be79e 100644 --- a/ultrasonic/src/main/res/drawable/default_ripple.xml +++ b/ultrasonic/src/main/res/drawable/default_ripple.xml @@ -1,9 +1,7 @@ + android:color="?android:colorControlHighlight"> diff --git a/ultrasonic/src/main/res/drawable/select_ripple.xml b/ultrasonic/src/main/res/drawable/select_ripple.xml index 746466c4..f2b692e8 100644 --- a/ultrasonic/src/main/res/drawable/select_ripple.xml +++ b/ultrasonic/src/main/res/drawable/select_ripple.xml @@ -1,9 +1,7 @@ + android:color="?android:colorControlHighlight"> diff --git a/ultrasonic/src/main/res/drawable/select_ripple_circle.xml b/ultrasonic/src/main/res/drawable/select_ripple_circle.xml index 2a270deb..bffa4862 100644 --- a/ultrasonic/src/main/res/drawable/select_ripple_circle.xml +++ b/ultrasonic/src/main/res/drawable/select_ripple_circle.xml @@ -1,9 +1,7 @@ + android:color="?android:colorControlHighlight">