mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Merge branch 'develop' into feature/Database_Call
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
KeePassDX(3.0.0)
|
||||
* Fix search with non-latin chars #971
|
||||
* Fix action mode with search #972 (rollback ignore accents #945)
|
||||
* Fix timeout with 0s #974
|
||||
|
||||
KeePassDX(2.9.19)
|
||||
* Fix search slowdown #964
|
||||
|
||||
@@ -37,7 +37,6 @@ class ClipboardEntryNotificationService : LockNotificationService() {
|
||||
override val notificationId = 485
|
||||
private var mEntryInfo: EntryInfo? = null
|
||||
private var clipboardHelper: ClipboardHelper? = null
|
||||
private var mNotificationTimeoutMilliSecs: Long = 0
|
||||
|
||||
override fun retrieveChannelId(): String {
|
||||
return CHANNEL_CLIPBOARD_ID
|
||||
@@ -68,9 +67,6 @@ class ClipboardEntryNotificationService : LockNotificationService() {
|
||||
// Get entry info from intent
|
||||
mEntryInfo = intent?.getParcelableExtra(EXTRA_ENTRY_INFO)
|
||||
|
||||
//Get settings
|
||||
mNotificationTimeoutMilliSecs = PreferencesUtil.getClipboardTimeout(this)
|
||||
|
||||
when {
|
||||
intent == null -> Log.w(TAG, "null intent")
|
||||
ACTION_NEW_NOTIFICATION == intent.action -> {
|
||||
@@ -169,8 +165,10 @@ class ClipboardEntryNotificationService : LockNotificationService() {
|
||||
this, 0, cleanIntent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
builder.setDeleteIntent(cleanPendingIntent)
|
||||
|
||||
if (mNotificationTimeoutMilliSecs != NEVER) {
|
||||
defineTimerJob(builder, mNotificationTimeoutMilliSecs, {
|
||||
//Get settings
|
||||
val notificationTimeoutMilliSecs = PreferencesUtil.getClipboardTimeout(this)
|
||||
if (notificationTimeoutMilliSecs != NEVER) {
|
||||
defineTimerJob(builder, notificationTimeoutMilliSecs, {
|
||||
val newGeneratedValue = fieldToCopy.getGeneratedValue(mEntryInfo)
|
||||
// New auto generated value
|
||||
if (generatedValue != newGeneratedValue) {
|
||||
|
||||
@@ -80,17 +80,22 @@ abstract class NotificationService : Service() {
|
||||
actionEnd: () -> Unit) {
|
||||
mTimerJob?.cancel()
|
||||
mTimerJob = CoroutineScope(Dispatchers.Main).launch {
|
||||
val timeoutInSeconds = timeoutMilliseconds / 1000L
|
||||
for (currentTime in timeoutInSeconds downTo 0) {
|
||||
actionAfterASecond?.invoke()
|
||||
builder.setProgress(100,
|
||||
(currentTime * 100 / timeoutInSeconds).toInt(),
|
||||
false)
|
||||
startForeground(notificationId, builder.build())
|
||||
delay(1000)
|
||||
if (currentTime <= 0) {
|
||||
actionEnd()
|
||||
if (timeoutMilliseconds > 0) {
|
||||
val timeoutInSeconds = timeoutMilliseconds / 1000L
|
||||
for (currentTime in timeoutInSeconds downTo 0) {
|
||||
actionAfterASecond?.invoke()
|
||||
builder.setProgress(100,
|
||||
(currentTime * 100 / timeoutInSeconds).toInt(),
|
||||
false)
|
||||
startForeground(notificationId, builder.build())
|
||||
delay(1000)
|
||||
if (currentTime <= 0) {
|
||||
actionEnd()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If timeout is 0, run action once
|
||||
actionEnd()
|
||||
}
|
||||
notificationManager?.cancel(notificationId)
|
||||
mTimerJob = null
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Fix search with non-latin chars #971
|
||||
* Fix action mode with search #972 (rollback ignore accents #945)
|
||||
* Fix action mode with search #972 (rollback ignore accents #945)
|
||||
* Fix timeout with 0s #974
|
||||
@@ -1,2 +1,3 @@
|
||||
* Correction de la recherche avec des caractères non latin #971
|
||||
* Correction du mode action avec la recherche #972 (retour arrière des accents ignorés #945)
|
||||
* Correction du mode action avec la recherche #972 (retour arrière des accents ignorés #945)
|
||||
* Correction de l'expiration de temps à 0s #974
|
||||
Reference in New Issue
Block a user