diff --git a/.gitignore b/.gitignore index 55d58e37f5..50e006fdc9 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,9 @@ captures/ .idea/navEditor.xml .idea/workspace.xml .idea/deploymentTargetSelector.xml +.idea/other.xml + +.kotlin # Keystore files *.jks diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 148fdd2469..6d0ee1c2a9 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3e92890587..bfb2587d10 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { - ext.kotlin_version = '1.9.24' + ext.kotlin_version = '2.0.0' repositories { mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:8.4.1' + classpath 'com.android.tools.build:gradle:8.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle.properties b/gradle.properties index f6238a6cb2..96ce217402 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,8 @@ # SPDX-License-Identifier: EPL-2.0 # -android.enableJetifier=true +android.enableJetifier=false android.nonFinalResIds=false android.nonTransitiveRClass=false android.useAndroidX=true +org.gradle.configuration-cache=true diff --git a/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt b/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt index 918e223f52..0054343441 100644 --- a/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt +++ b/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt @@ -37,7 +37,6 @@ import android.os.Parcelable import android.speech.RecognizerIntent import android.telephony.TelephonyManager import android.util.Log -import androidx.annotation.RequiresApi import androidx.annotation.StringRes import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat @@ -810,17 +809,20 @@ class BackgroundTasksManager : BroadcastReceiver() { } ItemUpdateWorker.ValueWithInfo(ssidToSend) } - @RequiresApi(Build.VERSION_CODES.M) VALUE_GETTER_MAP[PrefKeys.SEND_DND_MODE] = { context, _ -> - val nm = context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager - val mode = when (nm.currentInterruptionFilter) { - NotificationManager.INTERRUPTION_FILTER_NONE -> "TOTAL_SILENCE" - NotificationManager.INTERRUPTION_FILTER_PRIORITY -> "PRIORITY" - NotificationManager.INTERRUPTION_FILTER_ALARMS -> "ALARMS" - NotificationManager.INTERRUPTION_FILTER_ALL -> "OFF" - else -> "UNDEF" + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + val nm = context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager + val mode = when (nm.currentInterruptionFilter) { + NotificationManager.INTERRUPTION_FILTER_NONE -> "TOTAL_SILENCE" + NotificationManager.INTERRUPTION_FILTER_PRIORITY -> "PRIORITY" + NotificationManager.INTERRUPTION_FILTER_ALARMS -> "ALARMS" + NotificationManager.INTERRUPTION_FILTER_ALL -> "OFF" + else -> "UNDEF" + } + ItemUpdateWorker.ValueWithInfo(mode) + } else { + ItemUpdateWorker.ValueWithInfo("UNDEF") } - ItemUpdateWorker.ValueWithInfo(mode) } VALUE_GETTER_MAP[PrefKeys.SEND_BLUETOOTH_DEVICES] = { context, _ -> fun BluetoothDevice.isConnected(): Boolean {