From e7f8fa21cbdec8ceed812b7a42ed376746be310a Mon Sep 17 00:00:00 2001 From: tzugen Date: Tue, 21 Jun 2022 21:05:58 +0200 Subject: [PATCH] =?UTF-8?q?Merge=20update=20build=20tools=20#755=20by=20Ho?= =?UTF-8?q?lger=20Mu=CC=88ller=20Squashed=20commit=20of=20the=20following:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 4491c65b1bfa8f507e9c998878254d61bc52f962 Merge: 51ff716f 77865a14 Author: tzugen <67737443+tzugen@users.noreply.github.com> Date: Tue Jun 21 20:50:05 2022 +0200 Merge branch 'develop' into gradle-update commit 51ff716ff5fc8aeb29bc557844747c0127ab1f78 Author: Holger Müller Date: Tue Jun 21 20:38:52 2022 +0200 fixed lint warning commit 18c31a5704e7d92a04009e2f3ed8f8b9ca28b577 Author: Holger Müller Date: Tue Jun 21 20:38:35 2022 +0200 fixed lint warning commit 603654c262ed86a66b4127513764cd252cdedfff Author: Holger Müller Date: Tue Jun 21 20:37:51 2022 +0200 API is > lollipop ... target removed commit b38a7211de0f206465640d39f8f3189695afbd38 Author: Holger Müller Date: Tue Jun 21 20:37:07 2022 +0200 new created after fixes commit 4929a526f7e9154755cae2c16fdf431550ae2c2a Author: tzugen Date: Tue Jun 21 10:43:16 2022 +0200 Disable ObsoleteLintCustomCheck commit d0c30f0b6b1d4de2f3c46a166a4f1058223ad3a8 Author: tzugen Date: Tue Jun 21 10:14:06 2022 +0200 Update more libs commit e2fa447bbfbd19119393297c19de0f3237e1ccd3 Merge: d4ead495 ff9c7b24 Author: tzugen <67737443+tzugen@users.noreply.github.com> Date: Tue Jun 21 09:47:03 2022 +0200 Merge branch 'develop' into gradle-update commit d4ead49548d11f51dd9c29478972dcd4553d352a Merge: 2dac6a7e 9a73d72f Author: Holger Müller Date: Tue Jun 21 08:50:42 2022 +0200 merged with develop branch commit 2dac6a7e01e4ce5dc619426553ea08743bd9524e Author: Holger Müller Date: Mon Jun 20 21:45:22 2022 +0200 update to android image tag 2022.06.1 commit f3dc259c390c256a66f96c3f003e34daf0fdea14 Author: Holger Müller Date: Mon Jun 20 20:56:37 2022 +0200 rebuild lint-baseline.xml commit c71bc1212a8570f8ee99a80926c7b3b6036c672f Author: Holger Müller Date: Mon Jun 20 20:55:00 2022 +0200 removed unneeded cast commit eca136dabedab838e8a02be1a6fd740c4d0934ec Author: Holger Müller Date: Fri Jun 17 23:58:37 2022 +0200 commit signed commit 540f47633485cddeb4e68626532e54707a66bab8 Author: Holger Müller Date: Fri Jun 17 23:40:59 2022 +0200 commit signed Signed-off-by: Holger Müller commit 986bd013a49afc56ff8992634f2ce126339eecfc Author: Holger Müller Date: Fri Jun 17 23:27:20 2022 +0200 push to latest gradle version, set targetSdk to 33 Signed-off-by: tzugen --- .circleci/config.yml | 4 ++-- .../ultrasonic/api/subsonic/Extensions.kt | 2 +- gradle/libs.versions.toml | 14 +++++++------- gradle/versions.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 5 +++-- ultrasonic/build.gradle | 1 + ultrasonic/lint-baseline.xml | 2 +- .../moire/ultrasonic/playback/APIDataSource.kt | 18 +++++++++--------- .../playback/AutoMediaBrowserCallback.kt | 4 ++-- .../ultrasonic/playback/CachedDataSource.kt | 18 +++++++++--------- .../src/main/res/drawable/default_ripple.xml | 4 +--- .../src/main/res/drawable/select_ripple.xml | 4 +--- .../main/res/drawable/select_ripple_circle.xml | 4 +--- 13 files changed, 39 insertions(+), 43 deletions(-) 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">