Upgrade to 3.4.2 and fix service parameter and workflow

This commit is contained in:
J-Jamet
2022-04-15 12:21:14 +02:00
parent 3b21f8add2
commit 2a87eaf3e5
9 changed files with 18 additions and 7 deletions

View File

@@ -1,3 +1,6 @@
KeePassDX(3.4.2)
* Fix service parameter and workflow to remove notification when service is killed
KeePassDX(3.4.1) KeePassDX(3.4.1)
* Fix search mode with Magikeyboard #1292 * Fix search mode with Magikeyboard #1292
* Fix select another entry with Magikeyboard #1293 * Fix select another entry with Magikeyboard #1293

View File

@@ -12,8 +12,8 @@ android {
applicationId "com.kunzisoft.keepass" applicationId "com.kunzisoft.keepass"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 31 targetSdkVersion 31
versionCode = 110 versionCode = 111
versionName = "3.4.1" versionName = "3.4.2"
multiDexEnabled true multiDexEnabled true
testApplicationId = "com.kunzisoft.keepass.tests" testApplicationId = "com.kunzisoft.keepass.tests"

View File

@@ -158,6 +158,7 @@
<activity <activity
android:name="com.kunzisoft.keepass.activities.EntrySelectionLauncherActivity" android:name="com.kunzisoft.keepass.activities.EntrySelectionLauncherActivity"
android:theme="@style/Theme.Transparent" android:theme="@style/Theme.Transparent"
android:launchMode="singleInstance"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />

View File

@@ -205,8 +205,7 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
} }
// New task needed because don't launch from an Activity context // New task needed because don't launch from an Activity context
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
context.startActivity(intent) context.startActivity(intent)
} }
} }

View File

@@ -248,7 +248,7 @@ class DatabaseTaskProvider {
private fun bindService() { private fun bindService() {
initServiceConnection() initServiceConnection()
serviceConnection?.let { serviceConnection?.let {
context.bindService(intentDatabaseTask, it, BIND_AUTO_CREATE or BIND_NOT_FOREGROUND or BIND_ABOVE_CLIENT) context.bindService(intentDatabaseTask, it, BIND_AUTO_CREATE or BIND_IMPORTANT or BIND_ABOVE_CLIENT)
} }
} }

View File

@@ -27,6 +27,7 @@ import android.os.Binder
import android.os.Build import android.os.Build
import android.os.IBinder import android.os.IBinder
import android.util.Log import android.util.Log
import androidx.core.app.ServiceCompat
import com.kunzisoft.keepass.R import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.database.action.DatabaseTaskProvider import com.kunzisoft.keepass.database.action.DatabaseTaskProvider
import com.kunzisoft.keepass.database.element.Attachment import com.kunzisoft.keepass.database.element.Attachment
@@ -36,7 +37,10 @@ import com.kunzisoft.keepass.model.EntryAttachmentState
import com.kunzisoft.keepass.model.StreamDirection import com.kunzisoft.keepass.model.StreamDirection
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
import com.kunzisoft.keepass.utils.UriUtil import com.kunzisoft.keepass.utils.UriUtil
import kotlinx.coroutines.* import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.* import java.util.*
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
@@ -275,7 +279,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
AttachmentState.COMPLETE, AttachmentState.COMPLETE,
AttachmentState.CANCELED, AttachmentState.CANCELED,
AttachmentState.ERROR -> { AttachmentState.ERROR -> {
stopForeground(false) ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_DETACH)
notificationManager?.notify(attachmentNotification.notificationId, builder.build()) notificationManager?.notify(attachmentNotification.notificationId, builder.build())
} else -> { } else -> {
startForeground(attachmentNotification.notificationId, builder.build()) startForeground(attachmentNotification.notificationId, builder.build())

View File

@@ -20,6 +20,7 @@
package com.kunzisoft.keepass.services package com.kunzisoft.keepass.services
import android.content.Intent import android.content.Intent
import androidx.core.app.ServiceCompat
import com.kunzisoft.keepass.timeout.TimeoutHelper import com.kunzisoft.keepass.timeout.TimeoutHelper
import com.kunzisoft.keepass.utils.LockReceiver import com.kunzisoft.keepass.utils.LockReceiver
import com.kunzisoft.keepass.utils.registerLockReceiver import com.kunzisoft.keepass.utils.registerLockReceiver
@@ -33,6 +34,7 @@ abstract class LockNotificationService : NotificationService() {
protected open fun actionOnLock() { protected open fun actionOnLock() {
// Stop the service in all cases // Stop the service in all cases
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
stopSelf() stopSelf()
} }

View File

@@ -0,0 +1 @@
* Fix service parameter and workflow to remove notification when service is killed

View File

@@ -0,0 +1 @@
* Correction du paramètre de service et du flux de travail pour supprimer la notification lorsque le service est tué