From eec47921e0f150168d152d79ad64dc32138c7986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 28 Jul 2023 17:23:26 +0200 Subject: [PATCH] Update targetSdkVersion to 34 Regardless of updating targetSdkVersion, the foreground service notification will now be dismissable by the user. Ongoing flag will only affect dismissing with *Clear all* or when phone is locked. Updating targetSdkVersion required updating the RecorderService type, since these are now mandatory. Setting `microphone` type also required additional permission, `FOREGROUND_SERVICE_MICROPHONE`. No other changes from these lists affects this app: - https://developer.android.com/about/versions/14/behavior-changes-all - https://developer.android.com/about/versions/14/behavior-changes-14 --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 ++ .../voicerecorder/services/RecorderService.kt | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 744febe..745dbbc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,12 +9,12 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.simplemobiletools.voicerecorder" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 37 versionName "5.11.4" setProperty("archivesBaseName", "voice-recorder") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 317bde6..b7c79ef 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ + diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt index b2cc9cc..99bf970 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt @@ -273,7 +273,7 @@ class RecorderService : Service() { visibility = NotificationCompat.VISIBILITY_SECRET } - val builder = NotificationCompat.Builder(this) + val builder = NotificationCompat.Builder(this, channelId) .setContentTitle(title) .setContentText(text) .setSmallIcon(icon) @@ -283,7 +283,6 @@ class RecorderService : Service() { .setSound(null) .setOngoing(true) .setAutoCancel(true) - .setChannelId(channelId) return builder.build() }