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
This commit is contained in:
Ensar Sarajčić 2023-07-28 17:23:26 +02:00
parent 272f5a8b21
commit eec47921e0
3 changed files with 5 additions and 4 deletions

View File

@ -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")

View File

@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
@ -106,6 +107,7 @@
<service
android:name=".services.RecorderService"
android:foregroundServiceType="microphone"
android:exported="false">
<intent-filter>
<action android:name="com.simplemobiletools.voicerecorder.action.GET_RECORDER_INFO" />

View File

@ -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()
}