From 174f458637f5f294d401b7cd899dac4a61a11b36 Mon Sep 17 00:00:00 2001 From: Kieron Quinn Date: Thu, 8 Jun 2023 02:50:47 +0100 Subject: [PATCH] Fixed crash on Android 14 Beta 3 --- app/build.gradle | 6 +++--- .../app/ambientmusicmod/service/ShizukuService.kt | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 11a18ff..3e641e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ apply plugin: 'com.google.android.gms.oss-licenses-plugin' String DEFAULT_MANIFEST = "248:https://storage.googleapis.com/music-iq-db/updatable_ytm_db/20230507-030029/manifest.json" String DEFAULT_MANIFEST_V3 = "3050:https://storage.googleapis.com/music-iq-db/updatable_db_v3/20230507-030029/manifest.json" -def tagName = '2.3' -def version = 230 +def tagName = '2.3.1' +def version = 231 def getKeystoreProperties() { def properties = new Properties() @@ -36,7 +36,7 @@ def getKeystoreProperties() { } android { - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.kieronquinn.app.ambientmusicmod" diff --git a/app/src/main/java/com/kieronquinn/app/ambientmusicmod/service/ShizukuService.kt b/app/src/main/java/com/kieronquinn/app/ambientmusicmod/service/ShizukuService.kt index f24c1cc..e100a5e 100644 --- a/app/src/main/java/com/kieronquinn/app/ambientmusicmod/service/ShizukuService.kt +++ b/app/src/main/java/com/kieronquinn/app/ambientmusicmod/service/ShizukuService.kt @@ -16,7 +16,6 @@ import android.media.musicrecognition.MusicRecognitionManager import android.media.musicrecognition.RecognitionRequest import android.os.* import android.view.IWindowManager -import androidx.core.os.BuildCompat import androidx.core.os.bundleOf import com.android.internal.policy.IKeyguardDismissCallback import com.android.internal.widget.ILockSettings @@ -181,7 +180,7 @@ class ShizukuService: IShellProxy.Stub() { bufferSizeInBytes: Int ): AudioRecord { return when { - BuildCompat.isAtLeastU() -> createAudioRecordApi34( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE -> createAudioRecordApi34( audioAttributes, audioFormat, sessionId, bufferSizeInBytes ) Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> createAudioRecordApi31(