Skip to content

Commit

Permalink
Update to Kotlin 2
Browse files Browse the repository at this point in the history
Signed-off-by: mueller-ma <[email protected]>
  • Loading branch information
mueller-ma committed Jun 23, 2024
1 parent 36736ef commit cf4f630
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ captures/
.idea/navEditor.xml
.idea/workspace.xml
.idea/deploymentTargetSelector.xml
.idea/other.xml

# Keystore files
*.jks
Expand Down
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.24" />
<option name="version" value="2.0.0" />
</component>
</project>
Empty file.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cf4f630

Please sign in to comment.