Upgrade to 3.4.2 and fix service parameter and workflow

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

No files matched your search

@@ -205,8 +205,7 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
}
// New task needed because don't launch from an Activity context
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK or
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
Intent.FLAG_ACTIVITY_CLEAR_TASK
context.startActivity(intent)
}
}
@@ -248,7 +248,7 @@ class DatabaseTaskProvider {
private fun bindService() {
initServiceConnection()
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)
}
}
@@ -27,6 +27,7 @@ import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.util.Log
import androidx.core.app.ServiceCompat
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.database.action.DatabaseTaskProvider
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.tasks.BinaryDatabaseManager
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.concurrent.CopyOnWriteArrayList
@@ -275,7 +279,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
AttachmentState.COMPLETE,
AttachmentState.CANCELED,
AttachmentState.ERROR -> {
stopForeground(false)
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_DETACH)
notificationManager?.notify(attachmentNotification.notificationId, builder.build())
} else -> {
startForeground(attachmentNotification.notificationId, builder.build())
@@ -20,6 +20,7 @@
package com.kunzisoft.keepass.services
import android.content.Intent
import androidx.core.app.ServiceCompat
import com.kunzisoft.keepass.timeout.TimeoutHelper
import com.kunzisoft.keepass.utils.LockReceiver
import com.kunzisoft.keepass.utils.registerLockReceiver
@@ -33,6 +34,7 @@ abstract class LockNotificationService : NotificationService() {
protected open fun actionOnLock() {
// Stop the service in all cases
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
stopSelf()
}